diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-02-04 14:50:25 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-02-04 14:50:25 +0100 |
commit | 4fb2cb1a30fc188682ae4dbda2f975213e5c3adf (patch) | |
tree | 522b2dc8096cc37ace66686de36b486b73a352f5 /plugin | |
parent | c0f5fd27549c84607defa64c5b651343dd29e0ee (diff) | |
parent | 9ed8deb656d9378fc9c1c7fb12c15674b6323ab0 (diff) | |
download | mariadb-git-4fb2cb1a30fc188682ae4dbda2f975213e5c3adf.tar.gz |
Merge branch '10.7' into 10.8
Diffstat (limited to 'plugin')
6 files changed, 153 insertions, 18 deletions
diff --git a/plugin/disks/mysql-test/disks/disks.result b/plugin/disks/mysql-test/disks/disks.result index 9beab2f30d1..eb78d4073df 100644 --- a/plugin/disks/mysql-test/disks/disks.result +++ b/plugin/disks/mysql-test/disks/disks.result @@ -1,11 +1,11 @@ show create table information_schema.disks; Table Create Table DISKS CREATE TEMPORARY TABLE `DISKS` ( - `Disk` varchar(4096) NOT NULL DEFAULT '', - `Path` varchar(4096) NOT NULL DEFAULT '', - `Total` bigint(32) NOT NULL DEFAULT 0, - `Used` bigint(32) NOT NULL DEFAULT 0, - `Available` bigint(32) NOT NULL DEFAULT 0 + `Disk` varchar(4096) NOT NULL, + `Path` varchar(4096) NOT NULL, + `Total` bigint(32) NOT NULL, + `Used` bigint(32) NOT NULL, + `Available` bigint(32) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks; sum(Total) > sum(Available) sum(Total)>sum(Used) diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc index baaa3519261..a46e2d9fbf2 100644 --- a/plugin/qc_info/qc_info.cc +++ b/plugin/qc_info/qc_info.cc @@ -72,12 +72,13 @@ bool schema_table_store_record(THD *thd, TABLE *table); #define COLUMN_CLIENT_LONG_FLAG 16 #define COLUMN_CLIENT_PROTOCOL_41 17 -#define COLUMN_PROTOCOL_TYPE 18 -#define COLUMN_MORE_RESULTS_EXISTS 19 -#define COLUMN_IN_TRANS 20 -#define COLUMN_AUTOCOMMIT 21 -#define COLUMN_PKT_NR 22 -#define COLUMN_HITS 23 +#define COLUMN_CLIENT_EXTENDED_METADATA 18 +#define COLUMN_PROTOCOL_TYPE 19 +#define COLUMN_MORE_RESULTS_EXISTS 20 +#define COLUMN_IN_TRANS 21 +#define COLUMN_AUTOCOMMIT 22 +#define COLUMN_PKT_NR 23 +#define COLUMN_HITS 24 namespace Show { @@ -103,6 +104,7 @@ static ST_FIELD_INFO qc_info_fields[]= Column("LC_TIME_NAMES", Varchar(100), NOT_NULL), Column("CLIENT_LONG_FLAG", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("CLIENT_PROTOCOL_41", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), + Column("CLIENT_EXTENDED_METADATA",STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("PROTOCOL_TYPE", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("MORE_RESULTS_EXISTS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), Column("IN_TRANS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL), @@ -216,6 +218,8 @@ static int qc_info_fill_table(THD *thd, TABLE_LIST *tables, table->field[COLUMN_CLIENT_LONG_FLAG]->store(flags.client_long_flag, 0); table->field[COLUMN_CLIENT_PROTOCOL_41]->store(flags.client_protocol_41, 0); + table->field[COLUMN_CLIENT_EXTENDED_METADATA]-> + store(flags.client_extended_metadata, 0); table->field[COLUMN_PROTOCOL_TYPE]->store(flags.protocol_type, 0); table->field[COLUMN_MORE_RESULTS_EXISTS]->store(flags.more_results_exists, 0); table->field[COLUMN_IN_TRANS]->store(flags.in_trans, 0); diff --git a/plugin/query_response_time/mysql-test/query_response_time/basic.result b/plugin/query_response_time/mysql-test/query_response_time/basic.result index 5bf357375b9..8f25804e253 100644 --- a/plugin/query_response_time/mysql-test/query_response_time/basic.result +++ b/plugin/query_response_time/mysql-test/query_response_time/basic.result @@ -6,9 +6,9 @@ query_response_time_stats OFF SHOW CREATE TABLE INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; Table Create Table QUERY_RESPONSE_TIME CREATE TEMPORARY TABLE `QUERY_RESPONSE_TIME` ( - `TIME` varchar(14) NOT NULL DEFAULT '', - `COUNT` int(11) unsigned NOT NULL DEFAULT 0, - `TOTAL` varchar(14) NOT NULL DEFAULT '' + `TIME` varchar(14) NOT NULL, + `COUNT` int(11) unsigned NOT NULL, + `TOTAL` varchar(14) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 SELECT PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_TYPE, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION, PLUGIN_LICENSE, PLUGIN_MATURITY FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'query_response_time%';; PLUGIN_NAME QUERY_RESPONSE_TIME diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result new file mode 100644 index 00000000000..2b6603a51c3 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.result @@ -0,0 +1,63 @@ +# +# MDEV-27018 IF and COALESCE lose "json" property +# +CREATE TABLE t1 (a INET6, b JSON, c LONGTEXT); +INSERT INTO t1 VALUES ('::', '{"b": "b"}', '{"c": "c"}'); +SELECT +COALESCE(a,b), COALESCE(a,c), +LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def COALESCE(a,b) 254 (type=inet6) 39 0 Y 32 0 8 +def COALESCE(a,c) 254 (type=inet6) 39 0 Y 32 0 8 +def LEAST(a,b) 254 (type=inet6) 39 0 Y 32 0 8 +def LEAST(a,c) 254 (type=inet6) 39 0 Y 32 0 8 +COALESCE(a,b) COALESCE(a,c) LEAST(a,b) LEAST(a,c) +CREATE TABLE t2 AS +SELECT +COALESCE(a,b), COALESCE(a,c), +LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `COALESCE(a,b)` inet6 DEFAULT NULL, + `COALESCE(a,c)` inet6 DEFAULT NULL, + `LEAST(a,b)` inet6 DEFAULT NULL, + `LEAST(a,c)` inet6 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t2; +SELECT * FROM t1 WHERE a=b; +a b c +Warnings: +Warning 1292 Incorrect inet6 value: '{"b": "b"}' +SELECT * FROM t1 WHERE a=c; +a b c +Warnings: +Warning 1292 Incorrect inet6 value: '{"c": "c"}' +SELECT a+b FROM t1; +ERROR HY000: Illegal parameter data types inet6 and longblob/json for operation '+' +SELECT a+c FROM t1; +ERROR HY000: Illegal parameter data types inet6 and longblob for operation '+' +DROP TABLE t1; +# +# MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref +# +CREATE TABLE t1 (i INET6 PRIMARY KEY); +CREATE TABLE t2 (a VARCHAR(40) CHECK (JSON_VALID(a))); +SELECT * FROM t1 JOIN t2 ON (i = a); +i a +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +INSERT INTO t2 VALUES ('{}'),('[]'); +SELECT * FROM t1 JOIN t2 ON (i = a); +i a +DROP TABLE t1, t2; +CREATE TABLE t1 (i INET6 PRIMARY KEY); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +i +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +i +Warnings: +Warning 1292 Incorrect inet6 value: '{"c": "b"}' +DROP TABLE t1; diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test new file mode 100644 index 00000000000..74a91ff9a05 --- /dev/null +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_json.test @@ -0,0 +1,68 @@ +--echo # +--echo # MDEV-27018 IF and COALESCE lose "json" property +--echo # + +# +# Testing that JSON data types inherit properties +# from their non-JSON counterparts when mixed to INET6. +# +# E.g. JSON acts exactly like LONGTEXT when mixed to INET6: +# +# - COALESCE(inet6,json) returns inet6 (type aggregation for result) +# - LEAST(inet6,json) returns inet6 (type aggregation for min/max) +# - inet6=json is compared as inet6 (type aggregation for comparison) +# - inet6+json returns an error (type aggregation for numeric op) +# +# Mixing INET6 and JSON is actually meaningless: +# Non of valid JSON values are valid INET6. +# +# Some queries below intentionally use LIMIT 0 to avoid errors. +# + +CREATE TABLE t1 (a INET6, b JSON, c LONGTEXT); +INSERT INTO t1 VALUES ('::', '{"b": "b"}', '{"c": "c"}'); + +--disable_ps_protocol +--enable_metadata +SELECT + COALESCE(a,b), COALESCE(a,c), + LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +--disable_metadata +--enable_ps_protocol + +CREATE TABLE t2 AS +SELECT + COALESCE(a,b), COALESCE(a,c), + LEAST(a,b), LEAST(a,c) +FROM t1 LIMIT 0; +SHOW CREATE TABLE t2; +DROP TABLE t2; + +SELECT * FROM t1 WHERE a=b; +SELECT * FROM t1 WHERE a=c; + +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +SELECT a+b FROM t1; +--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION +SELECT a+c FROM t1; + +DROP TABLE t1; + +--echo # +--echo # MDEV-27668 Assertion `item->type_handler()->is_traditional_scalar_type() || item->type_handler() == type_handler()' failed in Field_inet6::can_optimize_keypart_ref +--echo # + +CREATE TABLE t1 (i INET6 PRIMARY KEY); +CREATE TABLE t2 (a VARCHAR(40) CHECK (JSON_VALID(a))); +SELECT * FROM t1 JOIN t2 ON (i = a); +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +INSERT INTO t2 VALUES ('{}'),('[]'); +SELECT * FROM t1 JOIN t2 ON (i = a); +DROP TABLE t1, t2; + +CREATE TABLE t1 (i INET6 PRIMARY KEY); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +INSERT INTO t1 VALUES ('::'),('ffff::ffff'); +SELECT * FROM t1 WHERE i<JSON_OBJECT('c','b'); +DROP TABLE t1; diff --git a/plugin/user_variables/mysql-test/user_variables/basic.result b/plugin/user_variables/mysql-test/user_variables/basic.result index 3acfb525ba5..a47c9301c21 100644 --- a/plugin/user_variables/mysql-test/user_variables/basic.result +++ b/plugin/user_variables/mysql-test/user_variables/basic.result @@ -11,10 +11,10 @@ PLUGIN_MATURITY Stable SHOW CREATE TABLE INFORMATION_SCHEMA.USER_VARIABLES; Table Create Table user_variables CREATE TEMPORARY TABLE `user_variables` ( - `VARIABLE_NAME` varchar(64) NOT NULL DEFAULT '', - `VARIABLE_VALUE` varchar(2048) DEFAULT NULL, - `VARIABLE_TYPE` varchar(64) NOT NULL DEFAULT '', - `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL + `VARIABLE_NAME` varchar(64) NOT NULL, + `VARIABLE_VALUE` varchar(2048), + `VARIABLE_TYPE` varchar(64) NOT NULL, + `CHARACTER_SET_NAME` varchar(32) ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 FLUSH USER_VARIABLES; SELECT COUNT(*) FROM INFORMATION_SCHEMA.USER_VARIABLES; |