diff --git a/mysql-test/main/type_json.result b/mysql-test/main/type_json.result index 15b183a12873d..4caa885acda34 100644 --- a/mysql-test/main/type_json.result +++ b/mysql-test/main/type_json.result @@ -2,40 +2,39 @@ create or replace table t1(a json); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci create or replace table t1(a json character set utf8); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character set utf8)' at line 1 -create or replace table t1(a json default '{a:1}'); +create or replace table t1(a json default '{"a":1}'); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '{a:1}' CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '{"a":1}' ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci create or replace table t1(a json not null check (json_valid(a))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a`)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci insert t1 values ('[]'); insert t1 values ('a'); -ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` +ERROR 22007: Incorrect json value: 'a' for column `test`.`t1`.`a` at row 1 create or replace table t1(a json not null); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci insert t1 values ('[]'); insert t1 values ('a'); -ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` +ERROR 22007: Incorrect json value: 'a' for column `test`.`t1`.`a` at row 1 set timestamp=unix_timestamp('2010:11:12 13:14:15'); create or replace table t1(a json default(json_object('now', now()))); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',current_timestamp()) CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',current_timestamp()) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci insert t1 values (); select * from t1; @@ -51,31 +50,41 @@ t show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`t`)) + `t` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`a`)), + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, `t` varchar(38) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `t` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`t`)) + `t` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci drop table t1,t2,t3; create table t1 (t json check (length(t) > 0)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (octet_length(`t`) > 0) + `t` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (octet_length(`t`) > 0) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci drop table t1; create table t1 (t text) engine=myisam; insert into t1 values ("{}"),(""); create table t2 (t json) select t from t1; -ERROR 23000: CONSTRAINT `t2.t` failed for `test`.`t2` +Warnings: +Warning 1292 Incorrect json value: '' for column `test`.`t2`.`t` at row 2 +select * from t2; +t +{} + +drop table t1, t2; +create table t1 (t text) engine=myisam; +insert into t1 values (""),("{}"); +create table t2 (t json) select t from t1; +ERROR 22007: Incorrect json value: '' for column `test`.`t2`.`t` at row 1 select * from t2; ERROR 42S02: Table 'test.t2' doesn't exist drop table t1; @@ -83,7 +92,7 @@ create or replace table t1(a json default(json_object('now', 1)) check (json_val insert into t1 values (); insert into t1 values ("{}"); insert into t1 values ("xxx"); -ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` +ERROR 22007: Incorrect json value: 'xxx' for column `test`.`t1`.`a` at row 1 select * from t1; a {"now": 1} @@ -91,13 +100,9 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',1) CHECK (json_valid(`a`)) + `a` json CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',1) CHECK (json_valid(`a`)) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci drop table t1; -select cast('{a:1}' as text); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'text)' at line 1 -select cast('{a:1}' as json); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json)' at line 1 # # Start of 10.5 tests # @@ -113,14 +118,14 @@ js3 TEXT CHECK (LENGTH(js2) > 0 OR JSON_VALID(js2)) ) CHARACTER SET utf8; SELECT * FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 js0 js0 252 (format=json) 4294967295 0 Y 144 0 192 +def test t1 t1 js0 js0 252 4294967295 0 Y 144 0 192 def test t1 t1 js1 js1 252 (format=json) 196605 0 Y 16 0 192 def test t1 t1 js2 js2 252 (format=json) 196605 0 Y 16 0 192 def test t1 t1 js3 js3 252 196605 0 Y 16 0 192 js0 js1 js2 js3 SELECT js0, JSON_COMPACT(js0), JSON_COMPACT('{}') FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 js0 js0 252 (format=json) 4294967295 0 Y 144 0 192 +def test t1 t1 js0 js0 252 4294967295 0 Y 144 0 192 def JSON_COMPACT(js0) 251 (format=json) 4294967295 0 Y 128 0 192 def JSON_COMPACT('{}') 253 (format=json) 6 0 Y 0 0 192 js0 JSON_COMPACT(js0) JSON_COMPACT('{}') @@ -132,23 +137,23 @@ CREATE TABLE t1 (a JSON); INSERT INTO t1 VALUES ('{"a":"b"}'); SELECT a, JSON_COMPACT(a), COALESCE(a) FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 a a 252 (format=json) 4294967295 9 Y 144 0 192 +def test t1 t1 a a 252 4294967295 9 Y 144 0 192 def JSON_COMPACT(a) 251 (format=json) 4294967295 9 Y 128 0 192 -def COALESCE(a) 251 (format=json) 4294967295 9 Y 128 39 192 +def COALESCE(a) 251 4294967295 9 Y 128 39 192 a JSON_COMPACT(a) COALESCE(a) {"a":"b"} {"a":"b"} {"a":"b"} SELECT JSON_ARRAYAGG(1), JSON_ARRAYAGG(a) FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def JSON_ARRAYAGG(1) 252 (format=json) 9437184 3 Y 0 0 192 -def JSON_ARRAYAGG(a) 252 (format=json) 12582912 11 Y 128 0 192 +def JSON_ARRAYAGG(a) 252 (format=json) 12582912 17 Y 128 0 192 JSON_ARRAYAGG(1) JSON_ARRAYAGG(a) -[1] [{"a":"b"}] +[1] ["{\"a\":\"b\"}"] SELECT JSON_OBJECTAGG('a','b'), JSON_OBJECTAGG('a',a) FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def JSON_OBJECTAGG('a','b') 252 (format=json) 9437184 9 Y 0 0 192 -def JSON_OBJECTAGG('a',a) 252 (format=json) 12582912 15 Y 128 0 192 +def JSON_OBJECTAGG('a',a) 252 (format=json) 12582912 21 Y 128 0 192 JSON_OBJECTAGG('a','b') JSON_OBJECTAGG('a',a) -{"a":"b"} {"a":{"a":"b"}} +{"a":"b"} {"a":"{\"a\":\"b\"}"} DROP TABLE t1; # # MDEV-27018 IF and COALESCE lose "json" property @@ -176,6 +181,16 @@ select json_arrayagg(v1_json) from v1; json_arrayagg(v1_json) [{"a": "b"}] drop view v1; +create table t1 (a json); +insert into t1 values (777); +insert into t1 values (123.45); +insert into t1 values (true); +select * from t1; +a +777 +123.45 +1 +drop table t1; # # End of 10.5 tests # diff --git a/mysql-test/main/type_json.test b/mysql-test/main/type_json.test index 8effe78f803d4..0ab2e9d73a698 100644 --- a/mysql-test/main/type_json.test +++ b/mysql-test/main/type_json.test @@ -5,22 +5,22 @@ create or replace table t1(a json); show create table t1; ---error ER_PARSE_ERROR create or replace table t1(a json character set utf8); -create or replace table t1(a json default '{a:1}'); +create or replace table t1(a json default '{"a":1}'); show create table t1; + create or replace table t1(a json not null check (json_valid(a))); show create table t1; insert t1 values ('[]'); ---error ER_CONSTRAINT_FAILED +--error ER_TRUNCATED_WRONG_VALUE insert t1 values ('a'); create or replace table t1(a json not null); show create table t1; insert t1 values ('[]'); ---error ER_CONSTRAINT_FAILED +--error ER_TRUNCATED_WRONG_VALUE insert t1 values ('a'); set timestamp=unix_timestamp('2010:11:12 13:14:15'); @@ -45,7 +45,13 @@ drop table t1; create table t1 (t text) engine=myisam; insert into t1 values ("{}"),(""); ---error ER_CONSTRAINT_FAILED +create table t2 (t json) select t from t1; +select * from t2; +drop table t1, t2; + +create table t1 (t text) engine=myisam; +insert into t1 values (""),("{}"); +--error ER_TRUNCATED_WRONG_VALUE create table t2 (t json) select t from t1; --error ER_NO_SUCH_TABLE select * from t2; @@ -54,16 +60,16 @@ drop table t1; create or replace table t1(a json default(json_object('now', 1)) check (json_valid(a))); insert into t1 values (); insert into t1 values ("{}"); ---error ER_CONSTRAINT_FAILED +--error ER_TRUNCATED_WRONG_VALUE insert into t1 values ("xxx"); select * from t1; show create table t1; drop table t1; ---error ER_PARSE_ERROR -select cast('{a:1}' as text); ---error ER_PARSE_ERROR -select cast('{a:1}' as json); +#--error ER_PARSE_ERROR +#select cast('{a:1}' as text); +#--error ER_PARSE_ERROR +#select cast('{a:1}' as json); --echo # --echo # Start of 10.5 tests @@ -135,6 +141,13 @@ select v1_json from v1; select json_arrayagg(v1_json) from v1; drop view v1; +create table t1 (a json); +insert into t1 values (777); +insert into t1 values (123.45); +insert into t1 values (true); +select * from t1; +drop table t1; + --echo # --echo # End of 10.5 tests --echo # diff --git a/mysql-test/suite/json/r/type_json.result b/mysql-test/suite/json/r/type_json.result index 48d11a608d7e2..4ec49aea12c7c 100644 --- a/mysql-test/suite/json/r/type_json.result +++ b/mysql-test/suite/json/r/type_json.result @@ -85,27 +85,27 @@ c12 ENUM('1','2') DEFAULT '1' INSERT INTO t2 VALUES (); CALL p1('t1', 'COALESCE(colt1, colt2)'); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c0) 254 (format=json) 30 1 Y 0 39 8 +def COALESCE(c0, c0) 254 30 1 Y 0 39 8 COALESCE(c0, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c1) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c0, c1) 253 30 1 Y 0 39 8 COALESCE(c0, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c0, c2) 252 1020 1 Y 0 39 8 COALESCE(c0, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c0, c3) 250 262140 1 Y 0 39 8 COALESCE(c0, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c0, c4) 251 67108860 1 Y 0 39 8 COALESCE(c0, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c0, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c0, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -113,31 +113,31 @@ def COALESCE(c0, c6) 254 30 1 Y 0 39 8 COALESCE(c0, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c7) 253 30 1 Y 0 39 8 +def COALESCE(c0, c7) 254 (format=json) 30 1 Y 0 39 8 COALESCE(c0, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c0) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c1, c0) 253 30 1 Y 0 39 8 COALESCE(c1, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c1) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c1, c1) 253 30 1 Y 0 39 8 COALESCE(c1, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c1, c2) 252 1020 1 Y 0 39 8 COALESCE(c1, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c1, c3) 250 262140 1 Y 0 39 8 COALESCE(c1, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c1, c4) 251 67108860 1 Y 0 39 8 COALESCE(c1, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c1, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c1, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -145,31 +145,31 @@ def COALESCE(c1, c6) 253 30 1 Y 0 39 8 COALESCE(c1, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c7) 253 30 1 Y 0 39 8 +def COALESCE(c1, c7) 253 (format=json) 30 1 Y 0 39 8 COALESCE(c1, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c0) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c0) 252 1020 1 Y 0 39 8 COALESCE(c2, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c1) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c1) 252 1020 1 Y 0 39 8 COALESCE(c2, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c2) 252 1020 1 Y 0 39 8 COALESCE(c2, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c2, c3) 250 262140 1 Y 0 39 8 COALESCE(c2, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c2, c4) 251 67108860 1 Y 0 39 8 COALESCE(c2, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c2, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c2, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -177,31 +177,31 @@ def COALESCE(c2, c6) 252 1020 1 Y 0 39 8 COALESCE(c2, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c7) 252 1020 1 Y 0 39 8 +def COALESCE(c2, c7) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(c2, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c0) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c0) 250 262140 1 Y 0 39 8 COALESCE(c3, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c1) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c1) 250 262140 1 Y 0 39 8 COALESCE(c3, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c2) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c2) 250 262140 1 Y 0 39 8 COALESCE(c3, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c3) 250 262140 1 Y 0 39 8 COALESCE(c3, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c3, c4) 251 67108860 1 Y 0 39 8 COALESCE(c3, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c3, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c3, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -209,31 +209,31 @@ def COALESCE(c3, c6) 250 262140 1 Y 0 39 8 COALESCE(c3, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c7) 250 262140 1 Y 0 39 8 +def COALESCE(c3, c7) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(c3, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c0) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c0) 251 67108860 1 Y 0 39 8 COALESCE(c4, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c1) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c1) 251 67108860 1 Y 0 39 8 COALESCE(c4, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c2) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c2) 251 67108860 1 Y 0 39 8 COALESCE(c4, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c3) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c3) 251 67108860 1 Y 0 39 8 COALESCE(c4, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c4) 251 67108860 1 Y 0 39 8 COALESCE(c4, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c4, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c4, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -241,31 +241,31 @@ def COALESCE(c4, c6) 251 67108860 1 Y 0 39 8 COALESCE(c4, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c7) 251 67108860 1 Y 0 39 8 +def COALESCE(c4, c7) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(c4, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c0) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c0) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c1) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c1) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c2) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c2) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c3) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c3) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c4) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c4) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -273,7 +273,7 @@ def COALESCE(c5, c6) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c7) 251 4294967292 1 Y 0 39 8 +def COALESCE(c5, c7) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(c5, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -309,27 +309,27 @@ def COALESCE(c6, c7) 253 11 1 Y 0 39 8 COALESCE(c6, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c0) 253 30 1 Y 0 39 8 +def COALESCE(c7, c0) 254 (format=json) 30 1 Y 0 39 8 COALESCE(c7, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c1) 253 30 1 Y 0 39 8 +def COALESCE(c7, c1) 253 (format=json) 30 1 Y 0 39 8 COALESCE(c7, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c2) 252 1020 1 Y 0 39 8 +def COALESCE(c7, c2) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(c7, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c3) 250 262140 1 Y 0 39 8 +def COALESCE(c7, c3) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(c7, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c4) 251 67108860 1 Y 0 39 8 +def COALESCE(c7, c4) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(c7, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(c7, c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(c7, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -370,7 +370,7 @@ def LEAST(c0, c6) 5 23 1 Y 32896 31 63 LEAST(c0, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c0, c7) 253 30 1 Y 0 39 8 +def LEAST(c0, c7) 254 (format=json) 30 1 Y 0 39 8 LEAST(c0, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -402,7 +402,7 @@ def LEAST(c1, c6) 5 23 1 Y 32896 31 63 LEAST(c1, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c1, c7) 253 30 1 Y 0 39 8 +def LEAST(c1, c7) 253 (format=json) 30 1 Y 0 39 8 LEAST(c1, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -434,7 +434,7 @@ def LEAST(c2, c6) 5 23 1 Y 32896 31 63 LEAST(c2, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c2, c7) 252 1020 1 Y 0 39 8 +def LEAST(c2, c7) 252 (format=json) 1020 1 Y 0 39 8 LEAST(c2, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -466,7 +466,7 @@ def LEAST(c3, c6) 5 23 1 Y 32896 31 63 LEAST(c3, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c3, c7) 250 262140 1 Y 0 39 8 +def LEAST(c3, c7) 250 (format=json) 262140 1 Y 0 39 8 LEAST(c3, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -498,7 +498,7 @@ def LEAST(c4, c6) 5 23 1 Y 32896 31 63 LEAST(c4, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c4, c7) 251 67108860 1 Y 0 39 8 +def LEAST(c4, c7) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(c4, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -530,7 +530,7 @@ def LEAST(c5, c6) 5 23 1 Y 32896 31 63 LEAST(c5, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c5, c7) 251 4294967292 1 Y 0 39 8 +def LEAST(c5, c7) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(c5, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -566,27 +566,27 @@ def LEAST(c6, c7) 5 17 1 Y 32896 0 63 LEAST(c6, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c0) 253 30 1 Y 0 39 8 +def LEAST(c7, c0) 254 (format=json) 30 1 Y 0 39 8 LEAST(c7, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c1) 253 30 1 Y 0 39 8 +def LEAST(c7, c1) 253 (format=json) 30 1 Y 0 39 8 LEAST(c7, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c2) 252 1020 1 Y 0 39 8 +def LEAST(c7, c2) 252 (format=json) 1020 1 Y 0 39 8 LEAST(c7, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c3) 250 262140 1 Y 0 39 8 +def LEAST(c7, c3) 250 (format=json) 262140 1 Y 0 39 8 LEAST(c7, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c4) 251 67108860 1 Y 0 39 8 +def LEAST(c7, c4) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(c7, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c5) 251 4294967292 1 Y 0 39 8 +def LEAST(c7, c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(c7, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -856,27 +856,27 @@ c7+c7 2 CALL p1('t1c', 'COALESCE(colt1, colt2)'); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c0) 254 (format=json) 30 1 Y 0 39 8 +def COALESCE(c0, c0) 254 30 1 Y 0 39 8 COALESCE(c0, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c1) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c0, c1) 253 30 1 Y 0 39 8 COALESCE(c0, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c0, c2) 252 1020 1 Y 0 39 8 COALESCE(c0, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c0, c3) 250 262140 1 Y 0 39 8 COALESCE(c0, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c0, c4) 251 67108860 1 Y 0 39 8 COALESCE(c0, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c0, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c0, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -884,31 +884,31 @@ def COALESCE(c0, c6) 254 30 1 Y 0 39 8 COALESCE(c0, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c0, c7) 253 30 1 Y 0 39 8 +def COALESCE(c0, c7) 254 (format=json) 30 1 Y 0 39 8 COALESCE(c0, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c0) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c1, c0) 253 30 1 Y 0 39 8 COALESCE(c1, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c1) 253 (format=json) 30 1 Y 0 39 8 +def COALESCE(c1, c1) 253 30 1 Y 0 39 8 COALESCE(c1, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c1, c2) 252 1020 1 Y 0 39 8 COALESCE(c1, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c1, c3) 250 262140 1 Y 0 39 8 COALESCE(c1, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c1, c4) 251 67108860 1 Y 0 39 8 COALESCE(c1, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c1, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c1, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -916,31 +916,31 @@ def COALESCE(c1, c6) 253 30 1 Y 0 39 8 COALESCE(c1, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c1, c7) 253 30 1 Y 0 39 8 +def COALESCE(c1, c7) 253 (format=json) 30 1 Y 0 39 8 COALESCE(c1, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c0) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c0) 252 1020 1 Y 0 39 8 COALESCE(c2, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c1) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c1) 252 1020 1 Y 0 39 8 COALESCE(c2, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c2) 252 (format=json) 1020 1 Y 0 39 8 +def COALESCE(c2, c2) 252 1020 1 Y 0 39 8 COALESCE(c2, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c2, c3) 250 262140 1 Y 0 39 8 COALESCE(c2, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c2, c4) 251 67108860 1 Y 0 39 8 COALESCE(c2, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c2, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c2, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -948,31 +948,31 @@ def COALESCE(c2, c6) 252 1020 1 Y 0 39 8 COALESCE(c2, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c2, c7) 252 1020 1 Y 0 39 8 +def COALESCE(c2, c7) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(c2, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c0) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c0) 250 262140 1 Y 0 39 8 COALESCE(c3, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c1) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c1) 250 262140 1 Y 0 39 8 COALESCE(c3, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c2) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c2) 250 262140 1 Y 0 39 8 COALESCE(c3, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c3) 250 (format=json) 262140 1 Y 0 39 8 +def COALESCE(c3, c3) 250 262140 1 Y 0 39 8 COALESCE(c3, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c3, c4) 251 67108860 1 Y 0 39 8 COALESCE(c3, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c3, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c3, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -980,31 +980,31 @@ def COALESCE(c3, c6) 250 262140 1 Y 0 39 8 COALESCE(c3, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c3, c7) 250 262140 1 Y 0 39 8 +def COALESCE(c3, c7) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(c3, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c0) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c0) 251 67108860 1 Y 0 39 8 COALESCE(c4, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c1) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c1) 251 67108860 1 Y 0 39 8 COALESCE(c4, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c2) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c2) 251 67108860 1 Y 0 39 8 COALESCE(c4, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c3) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c3) 251 67108860 1 Y 0 39 8 COALESCE(c4, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c4) 251 (format=json) 67108860 1 Y 0 39 8 +def COALESCE(c4, c4) 251 67108860 1 Y 0 39 8 COALESCE(c4, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c4, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c4, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1012,31 +1012,31 @@ def COALESCE(c4, c6) 251 67108860 1 Y 0 39 8 COALESCE(c4, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c4, c7) 251 67108860 1 Y 0 39 8 +def COALESCE(c4, c7) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(c4, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c0) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c0) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c1) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c1) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c2) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c2) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c3) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c3) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c4) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c4) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c5) 251 (format=json) 4294967292 1 Y 0 39 8 +def COALESCE(c5, c5) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1044,7 +1044,7 @@ def COALESCE(c5, c6) 251 4294967292 1 Y 0 39 8 COALESCE(c5, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c5, c7) 251 4294967292 1 Y 0 39 8 +def COALESCE(c5, c7) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(c5, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1080,27 +1080,27 @@ def COALESCE(c6, c7) 253 11 1 Y 0 39 8 COALESCE(c6, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c0) 253 30 1 Y 0 39 8 +def COALESCE(c7, c0) 254 (format=json) 30 1 Y 0 39 8 COALESCE(c7, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c1) 253 30 1 Y 0 39 8 +def COALESCE(c7, c1) 253 (format=json) 30 1 Y 0 39 8 COALESCE(c7, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c2) 252 1020 1 Y 0 39 8 +def COALESCE(c7, c2) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(c7, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c3) 250 262140 1 Y 0 39 8 +def COALESCE(c7, c3) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(c7, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c4) 251 67108860 1 Y 0 39 8 +def COALESCE(c7, c4) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(c7, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(c7, c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(c7, c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(c7, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1141,7 +1141,7 @@ def LEAST(c0, c6) 5 23 1 Y 32896 31 63 LEAST(c0, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c0, c7) 253 30 1 Y 0 39 8 +def LEAST(c0, c7) 254 (format=json) 30 1 Y 0 39 8 LEAST(c0, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1173,7 +1173,7 @@ def LEAST(c1, c6) 5 23 1 Y 32896 31 63 LEAST(c1, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c1, c7) 253 30 1 Y 0 39 8 +def LEAST(c1, c7) 253 (format=json) 30 1 Y 0 39 8 LEAST(c1, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1205,7 +1205,7 @@ def LEAST(c2, c6) 5 23 1 Y 32896 31 63 LEAST(c2, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c2, c7) 252 1020 1 Y 0 39 8 +def LEAST(c2, c7) 252 (format=json) 1020 1 Y 0 39 8 LEAST(c2, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1237,7 +1237,7 @@ def LEAST(c3, c6) 5 23 1 Y 32896 31 63 LEAST(c3, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c3, c7) 250 262140 1 Y 0 39 8 +def LEAST(c3, c7) 250 (format=json) 262140 1 Y 0 39 8 LEAST(c3, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1269,7 +1269,7 @@ def LEAST(c4, c6) 5 23 1 Y 32896 31 63 LEAST(c4, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c4, c7) 251 67108860 1 Y 0 39 8 +def LEAST(c4, c7) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(c4, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1301,7 +1301,7 @@ def LEAST(c5, c6) 5 23 1 Y 32896 31 63 LEAST(c5, c6) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c5, c7) 251 4294967292 1 Y 0 39 8 +def LEAST(c5, c7) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(c5, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1337,27 +1337,27 @@ def LEAST(c6, c7) 5 17 1 Y 32896 0 63 LEAST(c6, c7) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c0) 253 30 1 Y 0 39 8 +def LEAST(c7, c0) 254 (format=json) 30 1 Y 0 39 8 LEAST(c7, c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c1) 253 30 1 Y 0 39 8 +def LEAST(c7, c1) 253 (format=json) 30 1 Y 0 39 8 LEAST(c7, c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c2) 252 1020 1 Y 0 39 8 +def LEAST(c7, c2) 252 (format=json) 1020 1 Y 0 39 8 LEAST(c7, c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c3) 250 262140 1 Y 0 39 8 +def LEAST(c7, c3) 250 (format=json) 262140 1 Y 0 39 8 LEAST(c7, c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c4) 251 67108860 1 Y 0 39 8 +def LEAST(c7, c4) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(c7, c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(c7, c5) 251 4294967292 1 Y 0 39 8 +def LEAST(c7, c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(c7, c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1627,27 +1627,27 @@ c7+c7 2 CALL p2('COALESCE(t1.colt1, t2.colt2)'); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c0) 254 30 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c0) 254 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c0, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c1) 253 30 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c1) 254 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c0, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c2) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c2) 254 (format=json) 255 1 Y 0 39 8 COALESCE(t1.c0, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c3) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c3) 254 (format=json) 65535 1 Y 0 39 8 COALESCE(t1.c0, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c4) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c4) 254 (format=json) 16777215 1 Y 0 39 8 COALESCE(t1.c0, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c5) 254 (format=json) 1073741823 1 Y 0 39 8 COALESCE(t1.c0, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1675,31 +1675,31 @@ def COALESCE(t1.c0, t2.c11) 254 30 1 Y 0 39 8 COALESCE(t1.c0, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c0, t2.c12) 253 30 1 Y 0 39 8 +def COALESCE(t1.c0, t2.c12) 254 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c0, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c0) 253 30 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c0) 253 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c1, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c1) 253 30 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c1) 253 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c1, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c2) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c2) 253 (format=json) 255 1 Y 0 39 8 COALESCE(t1.c1, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c3) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c3) 253 (format=json) 65535 1 Y 0 39 8 COALESCE(t1.c1, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c4) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c4) 253 (format=json) 16777215 1 Y 0 39 8 COALESCE(t1.c1, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c5) 253 (format=json) 1073741823 1 Y 0 39 8 COALESCE(t1.c1, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1727,31 +1727,31 @@ def COALESCE(t1.c1, t2.c11) 253 30 1 Y 0 39 8 COALESCE(t1.c1, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c1, t2.c12) 253 30 1 Y 0 39 8 +def COALESCE(t1.c1, t2.c12) 253 (format=json) 30 1 Y 0 39 8 COALESCE(t1.c1, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c0) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c0) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(t1.c2, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c1) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c1) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(t1.c2, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c2) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c2) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(t1.c2, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c3) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c3) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c2, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c4) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c2, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c2, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1779,31 +1779,31 @@ def COALESCE(t1.c2, t2.c11) 252 1020 1 Y 0 39 8 COALESCE(t1.c2, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c2, t2.c12) 252 1020 1 Y 0 39 8 +def COALESCE(t1.c2, t2.c12) 252 (format=json) 1020 1 Y 0 39 8 COALESCE(t1.c2, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c0) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c0) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c1) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c1) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c2) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c2) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c3) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c3) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c4) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c3, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c3, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1831,31 +1831,31 @@ def COALESCE(t1.c3, t2.c11) 250 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c3, t2.c12) 250 262140 1 Y 0 39 8 +def COALESCE(t1.c3, t2.c12) 250 (format=json) 262140 1 Y 0 39 8 COALESCE(t1.c3, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c0) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c0) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c1) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c1) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c2) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c2) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c3) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c3) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c4) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c4, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1883,31 +1883,31 @@ def COALESCE(t1.c4, t2.c11) 251 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c4, t2.c12) 251 67108860 1 Y 0 39 8 +def COALESCE(t1.c4, t2.c12) 251 (format=json) 67108860 1 Y 0 39 8 COALESCE(t1.c4, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c0) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c0) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c1) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c1) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c2) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c2) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c3) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c3) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c4) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c4) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c5) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1935,7 +1935,7 @@ def COALESCE(t1.c5, t2.c11) 251 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c11) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COALESCE(t1.c5, t2.c12) 251 4294967292 1 Y 0 39 8 +def COALESCE(t1.c5, t2.c12) 251 (format=json) 4294967292 1 Y 0 39 8 COALESCE(t1.c5, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2044,27 +2044,27 @@ COALESCE(t1.c7, t2.c12) 1 CALL p2('LEAST(t1.colt1, t2.colt2)'); Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c0) 254 30 1 Y 0 39 8 +def LEAST(t1.c0, t2.c0) 254 (format=json) 30 1 Y 0 39 8 LEAST(t1.c0, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c1) 253 30 1 Y 0 39 8 +def LEAST(t1.c0, t2.c1) 254 (format=json) 30 1 Y 0 39 8 LEAST(t1.c0, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c2) 252 1020 1 Y 0 39 8 +def LEAST(t1.c0, t2.c2) 254 (format=json) 255 1 Y 0 39 8 LEAST(t1.c0, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c3) 250 262140 1 Y 0 39 8 +def LEAST(t1.c0, t2.c3) 254 (format=json) 65535 1 Y 0 39 8 LEAST(t1.c0, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c4) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c0, t2.c4) 254 (format=json) 16777215 1 Y 0 39 8 LEAST(t1.c0, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c0, t2.c5) 254 (format=json) 1073741823 1 Y 0 39 8 LEAST(t1.c0, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2092,31 +2092,31 @@ def LEAST(t1.c0, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c0, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c0, t2.c12) 253 30 1 Y 0 39 8 +def LEAST(t1.c0, t2.c12) 254 (format=json) 30 1 Y 0 39 8 LEAST(t1.c0, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c0) 253 30 1 Y 0 39 8 +def LEAST(t1.c1, t2.c0) 253 (format=json) 30 1 Y 0 39 8 LEAST(t1.c1, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c1) 253 30 1 Y 0 39 8 +def LEAST(t1.c1, t2.c1) 253 (format=json) 30 1 Y 0 39 8 LEAST(t1.c1, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c2) 252 1020 1 Y 0 39 8 +def LEAST(t1.c1, t2.c2) 253 (format=json) 255 1 Y 0 39 8 LEAST(t1.c1, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c3) 250 262140 1 Y 0 39 8 +def LEAST(t1.c1, t2.c3) 253 (format=json) 65535 1 Y 0 39 8 LEAST(t1.c1, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c4) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c1, t2.c4) 253 (format=json) 16777215 1 Y 0 39 8 LEAST(t1.c1, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c1, t2.c5) 253 (format=json) 1073741823 1 Y 0 39 8 LEAST(t1.c1, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2144,31 +2144,31 @@ def LEAST(t1.c1, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c1, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c1, t2.c12) 253 30 1 Y 0 39 8 +def LEAST(t1.c1, t2.c12) 253 (format=json) 30 1 Y 0 39 8 LEAST(t1.c1, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c0) 252 1020 1 Y 0 39 8 +def LEAST(t1.c2, t2.c0) 252 (format=json) 1020 1 Y 0 39 8 LEAST(t1.c2, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c1) 252 1020 1 Y 0 39 8 +def LEAST(t1.c2, t2.c1) 252 (format=json) 1020 1 Y 0 39 8 LEAST(t1.c2, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c2) 252 1020 1 Y 0 39 8 +def LEAST(t1.c2, t2.c2) 252 (format=json) 1020 1 Y 0 39 8 LEAST(t1.c2, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c3) 250 262140 1 Y 0 39 8 +def LEAST(t1.c2, t2.c3) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c2, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c4) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c2, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c2, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c2, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c2, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2196,31 +2196,31 @@ def LEAST(t1.c2, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c2, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c2, t2.c12) 252 1020 1 Y 0 39 8 +def LEAST(t1.c2, t2.c12) 252 (format=json) 1020 1 Y 0 39 8 LEAST(t1.c2, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c0) 250 262140 1 Y 0 39 8 +def LEAST(t1.c3, t2.c0) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c3, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c1) 250 262140 1 Y 0 39 8 +def LEAST(t1.c3, t2.c1) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c3, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c2) 250 262140 1 Y 0 39 8 +def LEAST(t1.c3, t2.c2) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c3, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c3) 250 262140 1 Y 0 39 8 +def LEAST(t1.c3, t2.c3) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c3, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c4) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c3, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c3, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c3, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c3, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2248,31 +2248,31 @@ def LEAST(t1.c3, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c3, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c3, t2.c12) 250 262140 1 Y 0 39 8 +def LEAST(t1.c3, t2.c12) 250 (format=json) 262140 1 Y 0 39 8 LEAST(t1.c3, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c0) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c0) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c1) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c1) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c2) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c2) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c3) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c3) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c4) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c4) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c4, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c4, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2300,31 +2300,31 @@ def LEAST(t1.c4, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c4, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c4, t2.c12) 251 67108860 1 Y 0 39 8 +def LEAST(t1.c4, t2.c12) 251 (format=json) 67108860 1 Y 0 39 8 LEAST(t1.c4, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c0) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c0) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c0) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c1) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c1) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c1) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c2) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c2) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c2) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c3) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c3) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c3) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c4) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c4) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c4) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c5) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c5) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c5) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -2352,7 +2352,7 @@ def LEAST(t1.c5, t2.c11) 12 26 26 Y 128 6 63 LEAST(t1.c5, t2.c11) 0000-00-00 00:00:00.000000 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def LEAST(t1.c5, t2.c12) 251 4294967292 1 Y 0 39 8 +def LEAST(t1.c5, t2.c12) 251 (format=json) 4294967292 1 Y 0 39 8 LEAST(t1.c5, t2.c12) 1 Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr diff --git a/plugin/type_json/CMakeLists.txt b/plugin/type_json/CMakeLists.txt new file mode 100644 index 0000000000000..d10311a49ff69 --- /dev/null +++ b/plugin/type_json/CMakeLists.txt @@ -0,0 +1,3 @@ +MYSQL_ADD_PLUGIN(type_json + plugin.cc sql_type_json.cc + MANDATORY RECOMPILE_FOR_EMBEDDED) diff --git a/plugin/type_json/plugin.cc b/plugin/type_json/plugin.cc new file mode 100644 index 0000000000000..2573637e1ddd8 --- /dev/null +++ b/plugin/type_json/plugin.cc @@ -0,0 +1,31 @@ +#define MYSQL_SERVER +#include "mariadb.h" +#include "sql_class.h" +#include "sql_type_json.h" +#include +#include + +static struct st_mariadb_data_type plugin_descriptor_json= +{ + MariaDB_DATA_TYPE_INTERFACE_VERSION, + &type_handler_json +}; + +maria_declare_plugin(type_json) +{ + MariaDB_DATA_TYPE_PLUGIN, // the plugin type (see include/mysql/plugin.h) + &plugin_descriptor_json, // pointer to type-specific plugin descriptor + "json", // plugin name + "MariaDB Corporation", // plugin author + "Data type json", // the plugin description + PLUGIN_LICENSE_GPL, // the plugin license (see include/mysql/plugin.h) + 0, // Pointer to plugin initialization function + 0, // Pointer to plugin deinitialization function + 0x0100, // Numeric version 0xAABB means AA.BB version + NULL, // Status variables + NULL, // System variables + "1.0", // String version representation + MariaDB_PLUGIN_MATURITY_GAMMA // Maturity(see include/mysql/plugin.h) +} +maria_declare_plugin_end; + diff --git a/plugin/type_json/sql_type_json.cc b/plugin/type_json/sql_type_json.cc new file mode 100644 index 0000000000000..a77f7c743eea8 --- /dev/null +++ b/plugin/type_json/sql_type_json.cc @@ -0,0 +1,129 @@ +#define MYSQL_SERVER +#include "mariadb.h" +#include "sql_type_json.h" +#include "sql_class.h" +#include "sql_lex.h" + +Type_handler_json type_handler_json; +Type_collection_json type_collection_json; + +const Type_collection *Type_handler_json::type_collection() const +{ + return &type_collection_json; +} + +bool Type_handler_json::Column_definition_prepare_stage1( + THD *thd, MEM_ROOT *root, Column_definition *def, + column_definition_type_t type, + const Column_derived_attributes *derived_attr) const +{ + def->charset= &my_charset_utf8mb4_bin; + if (Type_handler_long_blob::Column_definition_prepare_stage1( + thd, root, def, type, derived_attr)) + return true; + return false; +} + +Field *Type_handler_json::make_table_field(MEM_ROOT *root, + const LEX_CSTRING *name, + const Record_addr &addr, + const Type_all_attributes &attr, + TABLE_SHARE *share) const +{ + return new (root) Field_json(addr.ptr(), addr.null_ptr(), addr.null_bit(), + Field::NONE, name, share, attr.collation); +} + +Field *Type_handler_json::make_table_field_from_def( + TABLE_SHARE *share, MEM_ROOT *root, const LEX_CSTRING *name, + const Record_addr &rec, const Bit_addr &bit, + const Column_definition_attributes *attr, uint32 flags) const +{ + return new (root) Field_json(rec.ptr(), rec.null_ptr(), rec.null_bit(), + attr->unireg_check, name, share, attr->charset); +} + +Field *Type_handler_json::make_conversion_table_field( + MEM_ROOT *root, TABLE *table, uint metadata, const Field *target) const +{ + /* A JSON field uses 4 bytes for length as json file is a long blob*/ + uint pack_length= metadata & 0x00ff; + if (pack_length != 4) + return NULL; + + return new (root) Field_json(NULL, (uchar *) "", 1, Field::NONE, + &empty_clex_str, table->s, target->charset()); +} + +/********************Type collection json *******************/ + +const Type_handler * +Type_collection_json::aggregate_for_comparison(const Type_handler *a, + const Type_handler *b) const +{ + if (a->type_collection() == this) + swap_variables(const Type_handler *, a, b); + if (a == &type_handler_json || a == &type_handler_hex_hybrid || + a == &type_handler_tiny_blob || a == &type_handler_blob || + a == &type_handler_medium_blob || a == &type_handler_long_blob || + a == &type_handler_varchar || a == &type_handler_string || + a == &type_handler_null) + return b; + return NULL; +} + +const Type_handler * +Type_collection_json::aggregate_for_result(const Type_handler *a, + const Type_handler *b) const +{ + return aggregate_for_comparison(a, b); +} + +const Type_handler * +Type_collection_json::aggregate_for_min_max(const Type_handler *a, + const Type_handler *b) const +{ + return aggregate_for_comparison(a, b); +} + +const Type_handler * +Type_collection_json::aggregate_for_num_op(const Type_handler *a, + const Type_handler *b) const +{ + return NULL; +} + +/********************** Field_json *************************/ + +void Field_json::sql_type(String &res) const +{ + res.set_ascii(STRING_WITH_LEN("json")); +} + +int Field_json::report_wrong_value(const ErrConv &val) +{ + get_thd()->push_warning_truncated_value_for_field( + Sql_condition::WARN_LEVEL_WARN, "json", val.ptr(), + table ? table->s->db.str : nullptr, + table ? table->s->table_name.str : nullptr, + field_name.str); + reset(); + return 1; +} + +int Field_json::store(const char *from, size_t length, CHARSET_INFO *cs) +{ + if (get_thd()->count_cuted_fields != CHECK_FIELD_IGNORE) + { + json_engine_t je; + int stack_buf[JSON_DEPTH_LIMIT]; + initJsonArray(NULL, &je.stack, sizeof(int), stack_buf, 0); + + if (!json_valid(from, length, cs, &je)) + { + return report_wrong_value(ErrConvString(from, length, cs)); + } + } + + return Field_blob::store(from, length, cs); +} diff --git a/plugin/type_json/sql_type_json.h b/plugin/type_json/sql_type_json.h new file mode 100644 index 0000000000000..ca11f27c979c5 --- /dev/null +++ b/plugin/type_json/sql_type_json.h @@ -0,0 +1,109 @@ +#ifndef SQL_TYPE_JSON_PLUGIN_INCLUDED +#define SQL_TYPE_JSON_PLUGIN_INCLUDED + +#include "mariadb.h" +#include "sql_type.h" + +class Type_handler_json : public Type_handler_long_blob +{ +public: + virtual ~Type_handler_json() { } + bool Item_append_extended_type_info(Send_field_extended_metadata *to, + const Item *item) const override + { + static const LEX_CSTRING fmt= {STRING_WITH_LEN("json")}; + return to->set_format_name(fmt); + } + const Type_handler *type_handler_base() const override + { + return &type_handler_long_blob; + } + const Type_collection *type_collection() const override; + uint get_column_attributes() const override { return ATTR_CHARSET; } + bool Column_definition_prepare_stage1(THD *thd, + MEM_ROOT *mem_root, + Column_definition *def, + column_definition_type_t type, + const Column_derived_attributes + *derived_attr) const override; + Field *make_table_field(MEM_ROOT *root, const LEX_CSTRING *name, + const Record_addr &addr, const Type_all_attributes &attr, + TABLE_SHARE *share) const override; + + Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, + const LEX_CSTRING *name, const Record_addr &addr, + const Bit_addr &bit, const Column_definition_attributes *attr, + uint32 flags) const override; + Field *make_conversion_table_field(MEM_ROOT *root, + TABLE *table, uint metadata, + const Field *target) const override; + // const Type_handler *type_handler_for_comparison() const override; + // const Type_handler *type_handler_for_tmp_table(const Item *item) const + // override; + // bool Item_hybrid_func_fix_attributes(THD *thd, const LEX_CSTRING &func_name, + // Type_handler_hybrid_field_type *handler, Type_all_attributes *func, + // Item **items, uint nitems) const override; + + // virtual Item *create_typecast_item(THD *thd, Item *item, + // const Type_cast_attributes &attr) const override; + + // Item *make_constructor_item(THD *thd, List *args) const override; + + + bool can_return_int() const override { return false; } + bool can_return_decimal() const override { return false; } + bool can_return_real() const override { return false; } + bool can_return_date() const override { return false; } + bool can_return_time() const override { return false; } + +}; + +extern Type_handler_json type_handler_json; + +class Type_collection_json: public Type_collection +{ +public: + const Type_handler *aggregate_for_result(const Type_handler *a, + const Type_handler *b) + const override; + + const Type_handler *aggregate_for_min_max(const Type_handler *a, + const Type_handler *b) + const override; + + const Type_handler *aggregate_for_comparison(const Type_handler *a, + const Type_handler *b) + const override; + + const Type_handler *aggregate_for_num_op(const Type_handler *a, + const Type_handler *b) + const override; +}; + + +#include "field.h" + +class Field_json : public Field_blob +{ + int report_wrong_value(const ErrConv &val); + +public: + Field_json(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg, + TABLE_SHARE *share, const DTCollation &collation) + : Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, + field_name_arg, share, 4 /* blob_pack_length */, collation) + { + } + const Type_handler *type_handler() const override + { + return &type_handler_json; + } + using Field_blob::store; + int store(const char *to, size_t length, CHARSET_INFO *charset) override; + void sql_type(String &str) const override; + + uint size_of() const override { return sizeof(*this); } +}; + +#endif // SQL_TYPE_JSON_INCLUDED diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 269d497058c2f..12086989175a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6816,10 +6816,6 @@ field_type_lob: { $$.set(&type_handler_long_blob, $2); } | LONG_SYM opt_binary_and_compression { $$.set(&type_handler_medium_blob, $2); } - | JSON_SYM opt_compressed - { - $$.set(&type_handler_long_blob_json, &MY_CHARSET_UTF8MB4_BIN); - } ; field_type_misc: @@ -17315,6 +17311,7 @@ reserved_keyword_udt_not_param_type: | IS | ITERATE_SYM | JOIN_SYM + | JSON_SYM | KEYS | KEY_SYM | KILL_SYM