Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: update json字段 内容必须要转义吗?

【TiDB Usage Environment】Production Environment / Testing / Poc
【TiDB Version】7.3
【Reproduction Path】What operations were performed to cause the issue
【Encountered Issue: Issue Phenomenon and Impact】
【Resource Configuration】Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】
UPDATE mt_label_article
SET content = '{"id": 106, "title": "Test 1", "content": "I have been associated with travel since I was a child. Every holiday, my mother would take me to see my father who works in another city, and we would play there for several days. So, since childhood, my love for travel has been like a pine tree that cannot leave the land, and branches that cannot leave the leaves.\n In August, during the hot summer vacation, our whole family embarked on a journey to Peach Blossom Island,\n The best place on Peach Blossom Island is the Tower Bay Sands.\n Tower Bay Sands is a beach overflow area. Looking forward, there is an endless sea, with turbulent waves and deafening sounds, like a roaring lion, and more like thousands of troops coming towards me, immediately invigorating my spirit. The most beautiful are the peaks of different heights. Some look like hands holding, some like camels, and some like saints. This was the first time I saw the real sea, and I was so happy! I couldn't wait to put on my swimsuit and ran with my father to the crowded part of the sea, where people were racing waves. We also enthusiastically joined their wave racing team. Seeing a fierce wave coming towards me, I hadn't thought of a way to avoid it yet. Suddenly, I had a brainwave and shouted in my heart, one, two, three, jump! I escaped the oncoming wave with all my might, and everyone laughed excitedly, turning the place into a sea of joy.\n The sun disappeared from the horizon, and after playing all day, I fell asleep with a sweet smile. Our tent was filled with swimsuits, goggles, and swim rings. Tomorrow, as long as it is sunny, I will plunge into the hot wave race again.", "lyricSen": ["more like thousands of troops coming towards me,"], "talkDesc": ["branches cannot leave the leaves."], "gradeName": "Sixth Grade", "senseDesc": ["turbulent waves,", "deafening sounds,"], "themeName": "Narrative", "actionDesc": ["Every holiday,"], "analogySen": ["Some look like hands holding"], "discussSen": [""], "sceneryDesc": ["Looking forward, there is an endless sea,"], "demeanorDesc": ["We would play there for several days"], "appearanceDesc": ["During the hot summer vacation,"], "psychologyDesc": ["The best place on Peach Blossom Island is the Tower Bay Sands"], "anthropomorphicSen": ["This was the first time I saw the real sea,"]}'
WHERE
id = 106;
The above code will report error 3140. Adding the following escape characters to the JSON field will work normally:
UPDATE `mp_user`.`mt_label_article`
SET `content` = '{\"id\": 106, \"title\": \"Test 1\", \"content\": \"I have been associated with travel since I was a child. Every holiday, my mother would take me to see my father who works in another city, and we would play there for several days. So, since childhood, my love for travel has been like a pine tree that cannot leave the land, and branches that cannot leave the leaves.\\n In August, during the hot summer vacation, our whole family embarked on a journey to Peach Blossom Island,\\n The best place on Peach Blossom Island is the Tower Bay Sands.\\n Tower Bay Sands is a beach overflow area. Looking forward, there is an endless sea, with turbulent waves and deafening sounds, like a roaring lion, and more like thousands of troops coming towards me, immediately invigorating my spirit. The most beautiful are the peaks of different heights. Some look like hands holding, some like camels, and some like saints. This was the first time I saw the real sea, and I was so happy! I couldn't wait to put on my swimsuit and ran with my father to the crowded part of the sea, where people were racing waves. We also enthusiastically joined their wave racing team. Seeing a fierce wave coming towards me, I hadn't thought of a way to avoid it yet. Suddenly, I had a brainwave and shouted in my heart, one, two, three, jump! I escaped the oncoming wave with all my might, and everyone laughed excitedly, turning the place into a sea of joy.\\n The sun disappeared from the horizon, and after playing all day, I fell asleep with a sweet smile. Our tent was filled with swimsuits, goggles, and swim rings. Tomorrow, as long as it is sunny, I will plunge into the hot wave race again.\", \"lyricSen\": [\"more like thousands of troops coming towards me,\"], \"talkDesc\": [\"branches cannot leave the leaves.\"], \"gradeName\": \"Sixth Grade\", \"senseDesc\": [\"turbulent waves,\", \"deafening sounds,\"], \"themeName\": \"Narrative\", \"actionDesc\": [\"Every holiday,\"], \"analogySen\": [\"Some look like hands holding\"], \"discussSen\": [\"\"], \"sceneryDesc\": [\"Looking forward, there is an endless sea,\"], \"demeanorDesc\": [\"We would play there for several days\"], \"appearanceDesc\": [\"During the hot summer vacation,\"], \"psychologyDesc\": [\"The best place on Peach Blossom Island is the Tower Bay Sands\"], \"anthropomorphicSen\": [\"This was the first time I saw the real sea,\"]}'
WHERE
`id` = 106;
What is going on here?