File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1004,4 +1004,25 @@ var JsonScripts = []ScriptTest{
1004
1004
},
1005
1005
},
1006
1006
},
1007
+ {
1008
+ Name : "Comparisons with JSON values containing non-JSON types" ,
1009
+ SetUpScript : []string {
1010
+ "CREATE TABLE test (j json);" ,
1011
+ "insert into test VALUES ('{ \" key\" : 1.0 }');" ,
1012
+ },
1013
+ Assertions : []ScriptTestAssertion {
1014
+ {
1015
+ Query : "select * from test where JSON_OBJECT(\" key\" , 0.0) < test.j;" ,
1016
+ Expected : []sql.Row {{types .MustJSON ("{\" key\" : 1.0}" )}},
1017
+ },
1018
+ {
1019
+ Query : `select * from test where JSON_OBJECT("key", 1.0) = test.j;` ,
1020
+ Expected : []sql.Row {{types .MustJSON ("{\" key\" : 1.0}" )}},
1021
+ },
1022
+ {
1023
+ Query : `select * from test where JSON_OBJECT("key", 2.0) > test.j;` ,
1024
+ Expected : []sql.Row {{types .MustJSON ("{\" key\" : 1.0}" )}},
1025
+ },
1026
+ },
1027
+ },
1007
1028
}
You can’t perform that action at this time.
0 commit comments