Skip to content

Commit b487701

Browse files
committed
add json conv and \ch enginetests
1 parent e28c488 commit b487701

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

enginetest/queries/json_scripts.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,28 @@ var JsonScripts = []ScriptTest{
187187
},
188188
},
189189
},
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+
},
190212
{
191213
Name: "json_value preserves types",
192214
Assertions: []ScriptTestAssertion{

0 commit comments

Comments
 (0)