Commit e1f0f0dd authored by Sergei Golubchik's avatar Sergei Golubchik

Revert "MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work"

This reverts commit 1f372cf1.
Wasn't supposed to be pushed just yet.
parent 1f372cf1
......@@ -402,6 +402,15 @@ json_object("a", json_object("b", "abcd"))
select json_object("a", '{"b": "abcd"}');
json_object("a", '{"b": "abcd"}')
{"a": "{\"b\": \"abcd\"}"}
select json_object("a", cast('{"b": "abcd"}' as json));
json_object("a", cast('{"b": "abcd"}' as json))
{"a": {"b": "abcd"}}
select cast(NULL AS JSON);
cast(NULL AS JSON)
NULL
select json_depth(cast(NULL as JSON));
json_depth(cast(NULL as JSON))
NULL
select json_depth('[[], {}]');
json_depth('[[], {}]')
2
......
......@@ -161,10 +161,10 @@ select json_unquote('abc');
select json_object("a", json_object("b", "abcd"));
select json_object("a", '{"b": "abcd"}');
#select json_object("a", cast('{"b": "abcd"}' as json));
select json_object("a", cast('{"b": "abcd"}' as json));
#select cast(NULL AS JSON);
#select json_depth(cast(NULL as JSON));
select cast(NULL AS JSON);
select json_depth(cast(NULL as JSON));
select json_depth('[[], {}]');
select json_depth('[[[1,2,3],"s"], {}, []]');
select json_depth('[10, {"a": 20}]');
......
......@@ -10714,6 +10714,7 @@ cast_type:
}
| cast_type_numeric { $$= $1; Lex->charset= NULL; }
| cast_type_temporal { $$= $1; Lex->charset= NULL; }
| JSON_SYM { $$.set(ITEM_CAST_JSON); }
;
cast_type_numeric:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment