File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,28 @@ var JsonScripts = []ScriptTest{
187
187
},
188
188
},
189
189
},
190
+ {
191
+ Name : "json_object preserves escaped characters in key and values" ,
192
+ Assertions : []ScriptTestAssertion {
193
+ {
194
+ Query : `select cast(JSON_OBJECT('key"with"quotes\n','3"\\') as char);` ,
195
+ Expected : []sql.Row {
196
+ {`{"key\"with\"quotes\n": "3\"\\"}` },
197
+ },
198
+ },
199
+ },
200
+ },
201
+ {
202
+ Name : "json conversion works with escaped characters" ,
203
+ Assertions : []ScriptTestAssertion {
204
+ {
205
+ Query : `select cast(cast(JSON_OBJECT('key"with"quotes', 1) as char) as json);` ,
206
+ Expected : []sql.Row {
207
+ {`{"key\"with\"quotes": 1}` },
208
+ },
209
+ },
210
+ },
211
+ },
190
212
{
191
213
Name : "json_value preserves types" ,
192
214
Assertions : []ScriptTestAssertion {
You can’t perform that action at this time.
0 commit comments