Recently, I have been using mysql's json storage format, and a very strange problem has occurred.
INSERT INTO `json` (`notes`) VALUES ('[{"name":1}]');
I use the above statement to insert the json array, and the display of navicat is normal The
When I use UPDATE json SET notes =json_array_append(notes, '$' , '["sa"]' ) WHERE ID=6 ;
The escape character appears when adding new json
What's the problem?
黄舟2017-06-06 09:54:13
json_array_append(notes, '$' , '["sa"]' )
改为json_array_append(notes, '$' , CAST('["sa"]' AS JSON))