1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Dlee json update (#2558)

* JSON functions have been implemented.  Updated MTR test cases
This commit is contained in:
Daniel Lee
2022-09-07 13:42:29 -05:00
committed by GitHub
parent fdff42f750
commit e000236af7
43 changed files with 101 additions and 85 deletions

View File

@ -21,13 +21,17 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 [1, 2, [3, 4]] [1, 2, [3, 4]]
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[0]', 5), cText, JSON_ARRAY_APPEND(cText, '$[0]', 5) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_append' isn't supported.
cVarchar JSON_ARRAY_APPEND(cVarchar, '$[0]', 5) cText JSON_ARRAY_APPEND(cText, '$[0]', 5)
[1, 2, [3, 4]] [[1, 5], 2, [3, 4]] [1, 2, [3, 4]] [[1, 5], 2, [3, 4]]
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[1]', 6), cText, JSON_ARRAY_APPEND(cText, '$[1]', 6) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_append' isn't supported.
cVarchar JSON_ARRAY_APPEND(cVarchar, '$[1]', 6) cText JSON_ARRAY_APPEND(cText, '$[1]', 6)
[1, 2, [3, 4]] [1, [2, 6], [3, 4]] [1, 2, [3, 4]] [1, [2, 6], [3, 4]]
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[1]', 6, '$[2]', 7), cText, JSON_ARRAY_APPEND(cText, '$[1]', 6, '$[2]', 7) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_append' isn't supported.
cVarchar JSON_ARRAY_APPEND(cVarchar, '$[1]', 6, '$[2]', 7) cText JSON_ARRAY_APPEND(cText, '$[1]', 6, '$[2]', 7)
[1, 2, [3, 4]] [1, [2, 6], [3, 4, 7]] [1, 2, [3, 4]] [1, [2, 6], [3, 4, 7]]
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$', 5), cText, JSON_ARRAY_APPEND(cText, '$', 5) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_append' isn't supported.
cVarchar JSON_ARRAY_APPEND(cVarchar, '$', 5) cText JSON_ARRAY_APPEND(cText, '$', 5)
[1, 2, [3, 4]] [1, 2, [3, 4], 5] [1, 2, [3, 4]] [1, 2, [3, 4], 5]
TRUNCATE TABLE jsontest;
SET @json = '{"A": 1, "B": [2], "C": [3, 4]}';
SELECT @json;
@ -41,5 +45,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 {"A": 1, "B": [2], "C": [3, 4]} {"A": 1, "B": [2], "C": [3, 4]}
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$.B', 5), cText, JSON_ARRAY_APPEND(cText, '$.B', 5) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_append' isn't supported.
cVarchar JSON_ARRAY_APPEND(cVarchar, '$.B', 5) cText JSON_ARRAY_APPEND(cText, '$.B', 5)
{"A": 1, "B": [2], "C": [3, 4]} {"A": 1, "B": [2, 5], "C": [3, 4]} {"A": 1, "B": [2], "C": [3, 4]} {"A": 1, "B": [2, 5], "C": [3, 4]}
TRUNCATE TABLE jsontest;

View File

@ -18,9 +18,12 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 [1, 2, [3, 4]] [1, 2, [3, 4]]
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[0]', 5), cText, JSON_ARRAY_INSERT(cText, '$[0]', 5) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_insert' isn't supported.
cVarchar JSON_ARRAY_INSERT(cVarchar, '$[0]', 5) cText JSON_ARRAY_INSERT(cText, '$[0]', 5)
[1, 2, [3, 4]] [5, 1, 2, [3, 4]] [1, 2, [3, 4]] [5, 1, 2, [3, 4]]
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[1]', 6), cText, JSON_ARRAY_INSERT(cText, '$[1]', 6) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_insert' isn't supported.
cVarchar JSON_ARRAY_INSERT(cVarchar, '$[1]', 6) cText JSON_ARRAY_INSERT(cText, '$[1]', 6)
[1, 2, [3, 4]] [1, 6, 2, [3, 4]] [1, 2, [3, 4]] [1, 6, 2, [3, 4]]
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[1]', 6, '$[2]', 7), cText, JSON_ARRAY_INSERT(cText, '$[1]', 6, '$[2]', 7) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_array_insert' isn't supported.
cVarchar JSON_ARRAY_INSERT(cVarchar, '$[1]', 6, '$[2]', 7) cText JSON_ARRAY_INSERT(cText, '$[1]', 6, '$[2]', 7)
[1, 2, [3, 4]] [1, 6, 7, 2, [3, 4]] [1, 2, [3, 4]] [1, 6, 7, 2, [3, 4]]
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 { "A": 1, "B": [2, 3]} { "A": 1, "B": [2, 3]}
SELECT cVarchar, JSON_COMPACT(cVarchar), cText, JSON_COMPACT(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_compact' isn't supported.
cVarchar JSON_COMPACT(cVarchar) cText JSON_COMPACT(cText)
{ "A": 1, "B": [2, 3]} {"A":1,"B":[2,3]} { "A": 1, "B": [2, 3]} {"A":1,"B":[2,3]}
TRUNCATE TABLE jsontest;

View File

@ -21,11 +21,15 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 {"A": 0, "B": {"C": 1}, "D": 2} {"A": 0, "B": {"C": 1}, "D": 2}
SELECT cVarchar, JSON_CONTAINS(cVarchar, '2', '$.A'), cText, JSON_CONTAINS(cText, '2', '$.A') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains' isn't supported.
cVarchar JSON_CONTAINS(cVarchar, '2', '$.A') cText JSON_CONTAINS(cText, '2', '$.A')
{"A": 0, "B": {"C": 1}, "D": 2} 0 {"A": 0, "B": {"C": 1}, "D": 2} 0
SELECT cVarchar, JSON_CONTAINS(cVarchar, '2', '$.D'), cText, JSON_CONTAINS(cText, '2', '$.D') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains' isn't supported.
cVarchar JSON_CONTAINS(cVarchar, '2', '$.D') cText JSON_CONTAINS(cText, '2', '$.D')
{"A": 0, "B": {"C": 1}, "D": 2} 1 {"A": 0, "B": {"C": 1}, "D": 2} 1
SELECT cVarchar, JSON_CONTAINS(cVarchar, '{"C": 1}', '$.A'), cText, JSON_CONTAINS(cText, '{"C": 1}', '$.A') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains' isn't supported.
cVarchar JSON_CONTAINS(cVarchar, '{"C": 1}', '$.A') cText JSON_CONTAINS(cText, '{"C": 1}', '$.A')
{"A": 0, "B": {"C": 1}, "D": 2} 0 {"A": 0, "B": {"C": 1}, "D": 2} 0
SELECT cVarchar, JSON_CONTAINS(cVarchar, '{"C": 1}', '$.B'), cText, JSON_CONTAINS(cText, '{"C": 1}', '$.B') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains' isn't supported.
cVarchar JSON_CONTAINS(cVarchar, '{"C": 1}', '$.B') cText JSON_CONTAINS(cText, '{"C": 1}', '$.B')
{"A": 0, "B": {"C": 1}, "D": 2} 1 {"A": 0, "B": {"C": 1}, "D": 2} 1
TRUNCATE TABLE jsontest;

View File

@ -15,7 +15,9 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 {"A": 1, "B": [2], "C": [3, 4]} {"A": 1, "B": [2], "C": [3, 4]}
SELECT cVarchar, JSON_CONTAINS_PATH(cVarchar, 'one', '$.A', '$.D'), cText, JSON_CONTAINS_PATH(cText, 'one', '$.A', '$.D') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains_path' isn't supported.
cVarchar JSON_CONTAINS_PATH(cVarchar, 'one', '$.A', '$.D') cText JSON_CONTAINS_PATH(cText, 'one', '$.A', '$.D')
{"A": 1, "B": [2], "C": [3, 4]} 1 {"A": 1, "B": [2], "C": [3, 4]} 1
SELECT cVarchar, JSON_CONTAINS_PATH(cVarchar, 'all', '$.A', '$.D'), cText, JSON_CONTAINS_PATH(cText, 'all', '$.A', '$.D') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_contains_path' isn't supported.
cVarchar JSON_CONTAINS_PATH(cVarchar, 'all', '$.A', '$.D') cText JSON_CONTAINS_PATH(cText, 'all', '$.A', '$.D')
{"A": 1, "B": [2], "C": [3, 4]} 0 {"A": 1, "B": [2], "C": [3, 4]} 0
TRUNCATE TABLE jsontest;

View File

@ -21,5 +21,11 @@ cInt cVarchar cText
5 [[], {}, []] [[], {}, []]
6 [1, 2, [3, 4, 5, 6], 7] [1, 2, [3, 4, 5, 6], 7]
SELECT cVarchar, JSON_DEPTH(cVarchar), cText, JSON_DEPTH(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_depth' isn't supported.
cVarchar JSON_DEPTH(cVarchar) cText JSON_DEPTH(cText)
[] 1 [] 1
true 1 true 1
{} 1 {} 1
[1, 2, 3] 2 [1, 2, 3] 2
[[], {}, []] 2 [[], {}, []] 2
[1, 2, [3, 4, 5, 6], 7] 3 [1, 2, [3, 4, 5, 6], 7] 3
TRUNCATE TABLE jsontest;

View File

@ -21,11 +21,15 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 {"key1":"xxxx", "key2":[1, 2, 3]} {"key1":"xxxx", "key2":[1, 2, 3]}
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2"), cText, JSON_EXISTS(cText, "$.key2") from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_exists' isn't supported.
cVarchar JSON_EXISTS(cVarchar, "$.key2") cText JSON_EXISTS(cText, "$.key2")
{"key1":"xxxx", "key2":[1, 2, 3]} 1 {"key1":"xxxx", "key2":[1, 2, 3]} 1
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key3"), cText, JSON_EXISTS(cText, "$.key3") from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_exists' isn't supported.
cVarchar JSON_EXISTS(cVarchar, "$.key3") cText JSON_EXISTS(cText, "$.key3")
{"key1":"xxxx", "key2":[1, 2, 3]} 0 {"key1":"xxxx", "key2":[1, 2, 3]} 0
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2[1]"), cText, JSON_EXISTS(cText, "$.key2[1]") from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_exists' isn't supported.
cVarchar JSON_EXISTS(cVarchar, "$.key2[1]") cText JSON_EXISTS(cText, "$.key2[1]")
{"key1":"xxxx", "key2":[1, 2, 3]} 1 {"key1":"xxxx", "key2":[1, 2, 3]} 1
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2[10]"), cText, JSON_EXISTS(cText, "$.key2[10]") from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_exists' isn't supported.
cVarchar JSON_EXISTS(cVarchar, "$.key2[10]") cText JSON_EXISTS(cText, "$.key2[10]")
{"key1":"xxxx", "key2":[1, 2, 3]} 0 {"key1":"xxxx", "key2":[1, 2, 3]} 0
TRUNCATE TABLE jsontest;

View File

@ -18,9 +18,12 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 [1, 2, [3, 4]] [1, 2, [3, 4]]
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[1]'), cText, JSON_EXTRACT(cText, '$[1]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_extract' isn't supported.
cVarchar JSON_EXTRACT(cVarchar, '$[1]') cText JSON_EXTRACT(cText, '$[1]')
[1, 2, [3, 4]] 2 [1, 2, [3, 4]] 2
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[2]'), cText, JSON_EXTRACT(cText, '$[2]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_extract' isn't supported.
cVarchar JSON_EXTRACT(cVarchar, '$[2]') cText JSON_EXTRACT(cText, '$[2]')
[1, 2, [3, 4]] [3, 4] [1, 2, [3, 4]] [3, 4]
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[2][1]'), cText, JSON_EXTRACT(cText, '$[2][1]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_extract' isn't supported.
cVarchar JSON_EXTRACT(cVarchar, '$[2][1]') cText JSON_EXTRACT(cText, '$[2][1]')
[1, 2, [3, 4]] 4 [1, 2, [3, 4]] 4
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 { "A": 0, "B": [1, 2]} { "A": 0, "B": [1, 2]}
SELECT cVarchar, JSON_INSERT(cVarchar, '$.C', '[3, 4]'), cText, JSON_INSERT(cText, '$.C', '[3, 4]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_insert' isn't supported.
cVarchar JSON_INSERT(cVarchar, '$.C', '[3, 4]') cText JSON_INSERT(cText, '$.C', '[3, 4]')
{ "A": 0, "B": [1, 2]} {"A": 0, "B": [1, 2], "C": "[3, 4]"} { "A": 0, "B": [1, 2]} {"A": 0, "B": [1, 2], "C": "[3, 4]"}
TRUNCATE TABLE jsontest;

View File

@ -21,7 +21,11 @@ cInt cVarchar cText
1 {"A": 1, "B": {"C": 2}} {"A": 1, "B": {"C": 2}}
1 {"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2, "C": {"D": 3}}
SELECT cVarchar, JSON_KEYS(cVarchar), cText, JSON_KEYS(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_keys' isn't supported.
cVarchar JSON_KEYS(cVarchar) cText JSON_KEYS(cText)
{"A": 1, "B": {"C": 2}} ["A", "B"] {"A": 1, "B": {"C": 2}} ["A", "B"]
{"A": 1, "B": 2, "C": {"D": 3}} ["A", "B", "C"] {"A": 1, "B": 2, "C": {"D": 3}} ["A", "B", "C"]
SELECT cVarchar, JSON_KEYS(cVarchar, '$.C'), cText, JSON_KEYS(cText, '$.C') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_keys' isn't supported.
cVarchar JSON_KEYS(cVarchar, '$.C') cText JSON_KEYS(cText, '$.C')
{"A": 1, "B": {"C": 2}} NULL {"A": 1, "B": {"C": 2}} NULL
{"A": 1, "B": 2, "C": {"D": 3}} ["D"] {"A": 1, "B": 2, "C": {"D": 3}} ["D"]
TRUNCATE TABLE jsontest;

View File

@ -24,7 +24,11 @@ cInt cVarchar cText
1 [1, 2, {"a": 3}] [1, 2, {"a": 3}]
2 {"a": 1, "b": {"c": 30}} {"a": 1, "b": {"c": 30}}
SELECT cVarchar, JSON_LENGTH(cVarchar), cText, JSON_LENGTH(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_length' isn't supported.
cVarchar JSON_LENGTH(cVarchar) cText JSON_LENGTH(cText)
[1, 2, {"a": 3}] 3 [1, 2, {"a": 3}] 3
{"a": 1, "b": {"c": 30}} 2 {"a": 1, "b": {"c": 30}} 2
SELECT cVarchar, JSON_LENGTH(cVarchar, '$.b'), cText, JSON_LENGTH(cText, '$.b') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_length' isn't supported.
cVarchar JSON_LENGTH(cVarchar, '$.b') cText JSON_LENGTH(cText, '$.b')
[1, 2, {"a": 3}] NULL [1, 2, {"a": 3}] NULL
{"a": 1, "b": {"c": 30}} 1 {"a": 1, "b": {"c": 30}} 1
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 { "A":1,"B":[2,3]} { "A":1,"B":[2,3]}
SELECT cVarchar, JSON_LOOSE(cVarchar), cText, JSON_LOOSE(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_loose' isn't supported.
cVarchar JSON_LOOSE(cVarchar) cText JSON_LOOSE(cText)
{ "A":1,"B":[2,3]} {"A": 1, "B": [2, 3]} { "A":1,"B":[2,3]} {"A": 1, "B": [2, 3]}
TRUNCATE TABLE jsontest;

View File

@ -18,7 +18,11 @@ cInt cVarchar cText
1 [1, 2] [1, 2]
1 [3, 4] [3, 4]
SELECT cVarchar, JSON_MERGE(cVarchar, @json2), cText, JSON_MERGE(cText, @json2) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_merge_preserve' isn't supported.
cVarchar JSON_MERGE(cVarchar, @json2) cText JSON_MERGE(cText, @json2)
[1, 2] [1, 2, 3, 4] [1, 2] [1, 2, 3, 4]
[3, 4] [3, 4, 3, 4] [3, 4] [3, 4, 3, 4]
SELECT cVarchar, JSON_MERGE(cVarchar, cText), cText, JSON_MERGE(cText, cVarchar) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_merge_preserve' isn't supported.
cVarchar JSON_MERGE(cVarchar, cText) cText JSON_MERGE(cText, cVarchar)
[1, 2] [1, 2, 1, 2] [1, 2] [1, 2, 1, 2]
[3, 4] [3, 4, 3, 4] [3, 4] [3, 4, 3, 4]
TRUNCATE TABLE jsontest;

View File

@ -21,5 +21,7 @@ cInt cVarchar cText
1 {"key1":{"a":1, "b":[1,2]}} {"key1":{"a":1, "b":[1,2]}}
1 {"key1":123, "key1": [1,2,3]} {"key1":123, "key1": [1,2,3]}
SELECT cVarchar, JSON_QUERY(cVarchar, '$.key1'), cText, JSON_QUERY(cText, '$.key1') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_query' isn't supported.
cVarchar JSON_QUERY(cVarchar, '$.key1') cText JSON_QUERY(cText, '$.key1')
{"key1":{"a":1, "b":[1,2]}} {"a":1, "b":[1,2]} {"key1":{"a":1, "b":[1,2]}} {"a":1, "b":[1,2]}
{"key1":123, "key1": [1,2,3]} [1,2,3] {"key1":123, "key1": [1,2,3]} [1,2,3]
TRUNCATE TABLE jsontest;

View File

@ -20,7 +20,11 @@ cInt cVarchar cText
1 {"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2, "C": {"D": 3}}
2 ["A", "B", ["C", "D"], "E"] ["A", "B", ["C", "D"], "E"]
SELECT cVarchar, JSON_REMOVE(cVarchar, '$.C'), cText, JSON_REMOVE(cText, '$.C') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_remove' isn't supported.
cVarchar JSON_REMOVE(cVarchar, '$.C') cText JSON_REMOVE(cText, '$.C')
{"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2} {"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2}
["A", "B", ["C", "D"], "E"] ["A", "B", ["C", "D"], "E"] ["A", "B", ["C", "D"], "E"] ["A", "B", ["C", "D"], "E"]
SELECT cVarchar, JSON_REMOVE(cVarchar, '$[1]'), cText, JSON_REMOVE(cText, '$[1]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_remove' isn't supported.
cVarchar JSON_REMOVE(cVarchar, '$[1]') cText JSON_REMOVE(cText, '$[1]')
{"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2, "C": {"D": 3}} {"A": 1, "B": 2, "C": {"D": 3}}
["A", "B", ["C", "D"], "E"] ["A", ["C", "D"], "E"] ["A", "B", ["C", "D"], "E"] ["A", ["C", "D"], "E"]
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 { "A": 1, "B": [2, 3]} { "A": 1, "B": [2, 3]}
SELECT cVarchar, JSON_REPLACE(cVarchar, '$.B[1]', 4), cText, JSON_REPLACE(cText, '$.B[1]', 4) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_replace' isn't supported.
cVarchar JSON_REPLACE(cVarchar, '$.B[1]', 4) cText JSON_REPLACE(cText, '$.B[1]', 4)
{ "A": 1, "B": [2, 3]} {"A": 1, "B": [2, 4]} { "A": 1, "B": [2, 3]} {"A": 1, "B": [2, 4]}
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 ["A", [{"B": "1"}], {"C":"AB"}, {"D":"BC"}] ["A", [{"B": "1"}], {"C":"AB"}, {"D":"BC"}]
SELECT cVarchar, JSON_SEARCH(cVarchar, 'one', 'AB'), cText, JSON_SEARCH(cText, 'one', 'AB') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_search' isn't supported.
cVarchar JSON_SEARCH(cVarchar, 'one', 'AB') cText JSON_SEARCH(cText, 'one', 'AB')
["A", [{"B": "1"}], {"C":"AB"}, {"D":"BC"}] "$[2].C" ["A", [{"B": "1"}], {"C":"AB"}, {"D":"BC"}] "$[2].C"
TRUNCATE TABLE jsontest;

View File

@ -12,5 +12,6 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 { "a": 1, "b": [2, 3]} { "a": 1, "b": [2, 3]}
SELECT cVarchar, JSON_SET(cVarchar,'$.a', 10, '$.c', '[true, false]'), cText, JSON_SET(cText,'$.a', 10, '$.c', '[true, false]') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_set' isn't supported.
cVarchar JSON_SET(cVarchar,'$.a', 10, '$.c', '[true, false]') cText JSON_SET(cText,'$.a', 10, '$.c', '[true, false]')
{ "a": 1, "b": [2, 3]} {"a": 10, "b": [2, 3], "c": "[true, false]"} { "a": 1, "b": [2, 3]} {"a": 10, "b": [2, 3], "c": "[true, false]"}
TRUNCATE TABLE jsontest;

View File

@ -17,11 +17,15 @@ SELECT JSON_UNQUOTE(@json2);
JSON_UNQUOTE(@json2)
Sing ing
SELECT cVarchar, JSON_UNQUOTE(cVarchar), cText, JSON_UNQUOTE(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_unquote' isn't supported.
cVarchar JSON_UNQUOTE(cVarchar) cText JSON_UNQUOTE(cText)
"Monty" Monty "Monty" Monty
Sing ing Sing ing Sing ing Sing ing
SET @@sql_mode = 'NO_BACKSLASH_ESCAPES';
SELECT JSON_UNQUOTE(@json2);
JSON_UNQUOTE(@json2)
Sing ing
SELECT cVarchar, JSON_UNQUOTE(cVarchar), cText, JSON_UNQUOTE(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_unquote' isn't supported.
cVarchar JSON_UNQUOTE(cVarchar) cText JSON_UNQUOTE(cText)
"Monty" Monty "Monty" Monty
Sing ing Sing ing Sing ing Sing ing
TRUNCATE TABLE jsontest;

View File

@ -21,7 +21,9 @@ SELECT * FROM jsontest;
cInt cVarchar cText
1 {"id": 1, "name": "Monty"} {"id": 1, "name": "Monty"}
SELECT cVarchar, JSON_VALID(cVarchar), cText, JSON_VALID(cText) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_valid' isn't supported.
cVarchar JSON_VALID(cVarchar) cText JSON_VALID(cText)
{"id": 1, "name": "Monty"} 1 {"id": 1, "name": "Monty"} 1
SELECT cVarchar, JSON_VALID(CONCAT(cVarchar,'HELLO WORLD')), cText, JSON_VALID(CONCAT(cText,'HELLO WORLD')) from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_valid' isn't supported.
cVarchar JSON_VALID(CONCAT(cVarchar,'HELLO WORLD')) cText JSON_VALID(CONCAT(cText,'HELLO WORLD'))
{"id": 1, "name": "Monty"} 0 {"id": 1, "name": "Monty"} 0
TRUNCATE TABLE jsontest;

View File

@ -21,5 +21,7 @@ cInt cVarchar cText
1 {"key1":123} {"key1":123}
1 {"key1": [1,2,3], "key1":123} {"key1": [1,2,3], "key1":123}
SELECT cVarchar, JSON_VALUE(cVarchar, '$.key1'), cText, JSON_VALUE(cText, '$.key1') from jsontest;
ERROR 42000: The storage engine for the table doesn't support MCS-1001: Function 'json_value' isn't supported.
cVarchar JSON_VALUE(cVarchar, '$.key1') cText JSON_VALUE(cText, '$.key1')
{"key1":123} 123 {"key1":123} 123
{"key1": [1,2,3], "key1":123} 123 {"key1": [1,2,3], "key1":123} 123
TRUNCATE TABLE jsontest;

View File

@ -19,13 +19,9 @@ SELECT JSON_ARRAY_APPEND(@json, '$[1]', 6, '$[2]', 7);
SELECT JSON_ARRAY_APPEND(@json, '$', 5);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[0]', 5), cText, JSON_ARRAY_APPEND(cText, '$[0]', 5) from jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[1]', 6), cText, JSON_ARRAY_APPEND(cText, '$[1]', 6) from jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$[1]', 6, '$[2]', 7), cText, JSON_ARRAY_APPEND(cText, '$[1]', 6, '$[2]', 7) from jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$', 5), cText, JSON_ARRAY_APPEND(cText, '$', 5) from jsontest;
#
TRUNCATE TABLE jsontest;
@ -35,7 +31,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
#
SELECT JSON_ARRAY_APPEND(@json, '$.B', 5);
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_APPEND(cVarchar, '$.B', 5), cText, JSON_ARRAY_APPEND(cText, '$.B', 5) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -18,11 +18,8 @@ SELECT JSON_ARRAY_INSERT(@json, '$[1]', 6);
SELECT JSON_ARRAY_INSERT(@json, '$[1]', 6, '$[2]', 7);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[0]', 5), cText, JSON_ARRAY_INSERT(cText, '$[0]', 5) from jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[1]', 6), cText, JSON_ARRAY_INSERT(cText, '$[1]', 6) from jsontest;
--error 1178
SELECT cVarchar, JSON_ARRAY_INSERT(cVarchar, '$[1]', 6, '$[2]', 7), cText, JSON_ARRAY_INSERT(cText, '$[1]', 6, '$[2]', 7) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT @json, JSON_COMPACT(@json);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_COMPACT(cVarchar), cText, JSON_COMPACT(cText) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -19,13 +19,9 @@ SELECT JSON_CONTAINS(@json, '{"C": 1}', '$.A');
SELECT JSON_CONTAINS(@json, '{"C": 1}', '$.B');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS(cVarchar, '2', '$.A'), cText, JSON_CONTAINS(cText, '2', '$.A') from jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS(cVarchar, '2', '$.D'), cText, JSON_CONTAINS(cText, '2', '$.D') from jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS(cVarchar, '{"C": 1}', '$.A'), cText, JSON_CONTAINS(cText, '{"C": 1}', '$.A') from jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS(cVarchar, '{"C": 1}', '$.B'), cText, JSON_CONTAINS(cText, '{"C": 1}', '$.B') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -17,9 +17,7 @@ SELECT JSON_CONTAINS_PATH(@json, 'one', '$.A', '$.D');
SELECT JSON_CONTAINS_PATH(@json, 'all', '$.A', '$.D');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS_PATH(cVarchar, 'one', '$.A', '$.D'), cText, JSON_CONTAINS_PATH(cText, 'one', '$.A', '$.D') from jsontest;
--error 1178
SELECT cVarchar, JSON_CONTAINS_PATH(cVarchar, 'all', '$.A', '$.D'), cText, JSON_CONTAINS_PATH(cText, 'all', '$.A', '$.D') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -18,7 +18,6 @@ SELECT JSON_DEPTH('[1, 2, 3]'), JSON_DEPTH('[[], {}, []]');
SELECT JSON_DEPTH('[1, 2, [3, 4, 5, 6], 7]');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_DEPTH(cVarchar), cText, JSON_DEPTH(cText) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -19,13 +19,9 @@ SELECT JSON_EXISTS(@json, "$.key2[1]");
SELECT JSON_EXISTS(@json, "$.key2[10]");
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2"), cText, JSON_EXISTS(cText, "$.key2") from jsontest;
--error 1178
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key3"), cText, JSON_EXISTS(cText, "$.key3") from jsontest;
--error 1178
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2[1]"), cText, JSON_EXISTS(cText, "$.key2[1]") from jsontest;
--error 1178
SELECT cVarchar, JSON_EXISTS(cVarchar, "$.key2[10]"), cText, JSON_EXISTS(cText, "$.key2[10]") from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -18,11 +18,8 @@ SELECT JSON_EXTRACT(@json, '$[2]');
SELECT JSON_EXTRACT(@json, '$[2][1]');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[1]'), cText, JSON_EXTRACT(cText, '$[1]') from jsontest;
--error 1178
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[2]'), cText, JSON_EXTRACT(cText, '$[2]') from jsontest;
--error 1178
SELECT cVarchar, JSON_EXTRACT(cVarchar, '$[2][1]'), cText, JSON_EXTRACT(cText, '$[2][1]') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_INSERT(@json, '$.C', '[3, 4]');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_INSERT(cVarchar, '$.C', '[3, 4]'), cText, JSON_INSERT(cText, '$.C', '[3, 4]') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -20,9 +20,7 @@ SELECT JSON_KEYS('{"A": 1, "B": {"C": 2}}');
SELECT JSON_KEYS('{"A": 1, "B": 2, "C": {"D": 3}}', '$.C');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_KEYS(cVarchar), cText, JSON_KEYS(cText) from jsontest;
--error 1178
SELECT cVarchar, JSON_KEYS(cVarchar, '$.C'), cText, JSON_KEYS(cText, '$.C') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -21,9 +21,7 @@ SELECT JSON_LENGTH(@json2);
SELECT JSON_LENGTH(@json2, '$.b');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_LENGTH(cVarchar), cText, JSON_LENGTH(cText) from jsontest;
--error 1178
SELECT cVarchar, JSON_LENGTH(cVarchar, '$.b'), cText, JSON_LENGTH(cText, '$.b') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_LOOSE(@json);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_LOOSE(cVarchar), cText, JSON_LOOSE(cText) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -19,9 +19,7 @@ INSERT INTO jsontest VALUES (1, @json2, @json2);
SELECT JSON_MERGE(@json1,@json2);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_MERGE(cVarchar, @json2), cText, JSON_MERGE(cText, @json2) from jsontest;
--error 1178
SELECT cVarchar, JSON_MERGE(cVarchar, cText), cText, JSON_MERGE(cText, cVarchar) from jsontest;
TRUNCATE TABLE jsontest;
#

View File

@ -20,7 +20,6 @@ SELECT JSON_QUERY(@json1, '$.key1');
SELECT JSON_QUERY(@json2, '$.key1');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_QUERY(cVarchar, '$.key1'), cText, JSON_QUERY(cText, '$.key1') from jsontest;
TRUNCATE TABLE jsontest;
#

View File

@ -19,9 +19,7 @@ SELECT JSON_REMOVE(@json1, '$.C');
SELECT JSON_REMOVE(@json2, '$[1]');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_REMOVE(cVarchar, '$.C'), cText, JSON_REMOVE(cText, '$.C') from jsontest;
--error 1178
SELECT cVarchar, JSON_REMOVE(cVarchar, '$[1]'), cText, JSON_REMOVE(cText, '$[1]') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_REPLACE(@json, '$.B[1]', 4);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_REPLACE(cVarchar, '$.B[1]', 4), cText, JSON_REPLACE(cText, '$.B[1]', 4) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_SEARCH(@json, 'one', 'AB');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_SEARCH(cVarchar, 'one', 'AB'), cText, JSON_SEARCH(cText, 'one', 'AB') from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_SET(@json, '$.a', 10, '$.c', '[true, false]');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_SET(cVarchar,'$.a', 10, '$.c', '[true, false]'), cText, JSON_SET(cText,'$.a', 10, '$.c', '[true, false]') from jsontest;
TRUNCATE TABLE jsontest;
#

View File

@ -16,7 +16,6 @@ INSERT INTO jsontest VALUES (1, @json, @json);
SELECT JSON_TYPE(@json);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_TYPE(cVarchar), cText, JSON_TYPE(cText) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -20,12 +20,10 @@ INSERT INTO jsontest VALUES (1, @json2, @json2);
#
SELECT JSON_UNQUOTE(@json1);
SELECT JSON_UNQUOTE(@json2);
--error 1178
SELECT cVarchar, JSON_UNQUOTE(cVarchar), cText, JSON_UNQUOTE(cText) from jsontest;
#
SET @@sql_mode = 'NO_BACKSLASH_ESCAPES';
SELECT JSON_UNQUOTE(@json2);
--error 1178
SELECT cVarchar, JSON_UNQUOTE(cVarchar), cText, JSON_UNQUOTE(cText) from jsontest;
TRUNCATE TABLE jsontest;
#

View File

@ -23,9 +23,7 @@ SELECT @tmpstr2;
INSERT INTO jsontest VALUES (1, @tmpstr1, @tmpstr1);
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_VALID(cVarchar), cText, JSON_VALID(cText) from jsontest;
--error 1178
SELECT cVarchar, JSON_VALID(CONCAT(cVarchar,'HELLO WORLD')), cText, JSON_VALID(CONCAT(cText,'HELLO WORLD')) from jsontest;
#
TRUNCATE TABLE jsontest;

View File

@ -20,7 +20,6 @@ SELECT JSON_VALUE(@json1, '$.key1');
SELECT JSON_VALUE(@json2, '$.key1');
#
SELECT * FROM jsontest;
--error 1178
SELECT cVarchar, JSON_VALUE(cVarchar, '$.key1'), cText, JSON_VALUE(cText, '$.key1') from jsontest;
#
TRUNCATE TABLE jsontest;