diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-15 18:26:29 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-15 18:26:29 +0200 |
commit | 1ecf173741a83ba9c252372651871565cf482442 (patch) | |
tree | 514f34c4765e7c047b529aa863a01b401c31407f /storage/spider | |
parent | 66b5b9214b1c3490cdfa8a1b3d3240e3088178d2 (diff) | |
parent | 9f5a3e568913e0810109554608c56c93f3ec24f8 (diff) | |
download | mariadb-git-1ecf173741a83ba9c252372651871565cf482442.tar.gz |
Merge 10.8 into 10.9
Diffstat (limited to 'storage/spider')
22 files changed, 353 insertions, 124 deletions
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result index aa734573a1a..484ef1a00bd 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result @@ -36,6 +36,10 @@ SELECT 1; 3.1 auto_increment connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1, t2; @@ -190,6 +194,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 10000 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result index b793346df4b..d4b05f75660 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result +++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result @@ -34,6 +34,10 @@ SELECT 1; 1 auto_increment with partition connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1, t2; @@ -188,6 +192,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 10000 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result index 1db31ca9f95..0b0514a9346 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result @@ -413,6 +413,10 @@ connection master_1; read only connection master_1; +SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; +SET SESSION spider_read_only_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -441,10 +445,19 @@ DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only TRUNCATE t1; ERROR HY000: Table 'auto_test_local.t1' is read only +SET SESSION spider_read_only_mode = @original_spider_read_only_mode; 2.27 error mode connection master_1; +SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; +SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; +SET SESSION spider_error_read_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release +SET SESSION spider_error_write_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -466,6 +479,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist +SET SESSION spider_error_read_mode = @original_spider_error_read_mode; +SET SESSION spider_error_write_mode = @original_spider_error_write_mode; 3.0 is null diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test index 64d3b657ae8..30d22a6a16f 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test @@ -97,6 +97,8 @@ if ($USE_CHILD_GROUP2) } } --connection master_1 +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -222,6 +224,7 @@ SELECT MAX(id) FROM t1; INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test index bcd85f42b81..e9c9c194e5c 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test @@ -131,6 +131,8 @@ if ($HAVE_PARTITION) } } --connection master_1 + SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; + SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -256,6 +258,7 @@ if ($HAVE_PARTITION) INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; + SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test index 9f7ada052ed..b222f494ba1 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test @@ -1172,6 +1172,8 @@ let $MASTER_1_ENGINE_IS_SPIDER= if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; + SET SESSION spider_read_only_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1197,6 +1199,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER) DELETE FROM t1; --error 12518 TRUNCATE t1; + SET SESSION spider_read_only_mode = @original_spider_read_only_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { @@ -1210,6 +1213,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER) if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; + SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; + SET SESSION spider_error_read_mode = -1; + SET SESSION spider_error_write_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1227,6 +1234,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER) INSERT INTO t1 (id) VALUES (1); DELETE FROM t1; TRUNCATE t1; + SET SESSION spider_error_read_mode = @original_spider_error_read_mode; + SET SESSION spider_error_write_mode = @original_spider_error_write_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { diff --git a/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result b/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result index 2b63fb3ee53..c772ecf797a 100644 --- a/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result +++ b/storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result @@ -216,6 +216,12 @@ PARTITION BY HASH (a) PARTITIONS 2; SELECT * FROM tbl_a; ERROR HY000: Unable to connect to foreign data source: localhost DROP TABLE tbl_a; +# MDEV-27860 SIGSEGV in spider_parse_connect_info on CREATE TABLE +CREATE TABLE tbl_a ENGINE=SPIDER COMMENT="TABLE 'unknown_table'" +PARTITION BY LIST COLUMNS (c) ( +PARTITION p DEFAULT COMMENT="srv 'unknown_server'" ENGINE=SPIDER +); +ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: unknown_server connection child2_1; DROP DATABASE auto_test_remote; connection child2_2; diff --git a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test index e3fef7cb6d6..c2ed2473002 100644 --- a/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test +++ b/storage/spider/mysql-test/spider/feature/t/engine_defined_attributes.test @@ -202,6 +202,13 @@ PARTITION BY HASH (a) PARTITIONS 2; SELECT * FROM tbl_a; DROP TABLE tbl_a; +--echo # MDEV-27860 SIGSEGV in spider_parse_connect_info on CREATE TABLE +--error ER_FOREIGN_SERVER_DOESNT_EXIST +CREATE TABLE tbl_a ENGINE=SPIDER COMMENT="TABLE 'unknown_table'" +PARTITION BY LIST COLUMNS (c) ( + PARTITION p DEFAULT COMMENT="srv 'unknown_server'" ENGINE=SPIDER +); + --connection child2_1 DROP DATABASE auto_test_remote; diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result index 9a8a59153f0..abe543fe193 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes.result @@ -36,6 +36,10 @@ SELECT 1; 3.1 auto_increment connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1, t2; @@ -206,6 +210,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 46 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id diff --git a/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result index f8747cff5ea..6c3a1802f1d 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result +++ b/storage/spider/mysql-test/spider/handler/r/spider3_fixes_part.result @@ -34,6 +34,10 @@ SELECT 1; 1 auto_increment with partition connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1, t2; @@ -204,6 +208,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 26 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result index c171167a1b7..f11b1d9b32c 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result @@ -306,6 +306,10 @@ UNLOCK TABLES; auto_increment connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1; @@ -399,6 +403,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t1; MAX(id) 42 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id @@ -417,6 +422,10 @@ connection master_1; read only connection master_1; +SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; +SET SESSION spider_read_only_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -445,10 +454,19 @@ DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only TRUNCATE t1; ERROR HY000: Table 'auto_test_local.t1' is read only +SET SESSION spider_read_only_mode = @original_spider_read_only_mode; 2.27 error mode connection master_1; +SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; +SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; +SET SESSION spider_error_read_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release +SET SESSION spider_error_write_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -470,6 +488,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist +SET SESSION spider_error_read_mode = @original_spider_error_read_mode; +SET SESSION spider_error_write_mode = @original_spider_error_write_mode; 3.0 is null diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result index c99c02071b6..249f39520c2 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result +++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes_part.result @@ -109,6 +109,10 @@ a b c 2.26 auto_increment with partition connection master_1; +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release connection slave1_1; connection master_1; DROP TABLE IF EXISTS t1; @@ -202,6 +206,7 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t1; MAX(id) 26 +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; connection slave1_1; SELECT id FROM t1 ORDER BY id; id diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test index 64d3b657ae8..30d22a6a16f 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test @@ -97,6 +97,8 @@ if ($USE_CHILD_GROUP2) } } --connection master_1 +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -222,6 +224,7 @@ SELECT MAX(id) FROM t1; INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test index bcd85f42b81..e9c9c194e5c 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test +++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test @@ -131,6 +131,8 @@ if ($HAVE_PARTITION) } } --connection master_1 + SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; + SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -256,6 +258,7 @@ if ($HAVE_PARTITION) INSERT INTO t2 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t2; + SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test index 9f7ada052ed..5a3c1d1c893 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test @@ -1049,6 +1049,8 @@ if ($USE_CHILD_GROUP2) } } --connection master_1 +SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; +SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -1120,6 +1122,7 @@ SELECT MAX(id) FROM t1; INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; +SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; @@ -1172,6 +1175,8 @@ let $MASTER_1_ENGINE_IS_SPIDER= if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; + SET SESSION spider_read_only_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1197,6 +1202,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER) DELETE FROM t1; --error 12518 TRUNCATE t1; + SET SESSION spider_read_only_mode = @original_spider_read_only_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { @@ -1210,6 +1216,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER) if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; + SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; + SET SESSION spider_error_read_mode = -1; + SET SESSION spider_error_write_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1227,6 +1237,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER) INSERT INTO t1 (id) VALUES (1); DELETE FROM t1; TRUNCATE t1; + SET SESSION spider_error_read_mode = @original_spider_error_read_mode; + SET SESSION spider_error_write_mode = @original_spider_error_write_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test index e6c4456edcb..22ba6102405 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test +++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test @@ -485,6 +485,8 @@ if ($HAVE_PARTITION) } } --connection master_1 + SET @original_spider_auto_increment_mode = @@SESSION.spider_auto_increment_mode; + SET SESSION spider_auto_increment_mode = -1; if ($USE_REPLICATION) { save_master_pos; @@ -556,6 +558,7 @@ if ($HAVE_PARTITION) INSERT INTO t1 (id) VALUES (1000); SELECT LAST_INSERT_ID(); SELECT MAX(id) FROM t1; + SET SESSION spider_auto_increment_mode = @original_spider_auto_increment_mode; if ($USE_REPLICATION) { save_master_pos; diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result index b2a2fad5238..6ece4b6255e 100644 --- a/storage/spider/mysql-test/spider/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider_fixes.result @@ -413,6 +413,10 @@ connection master_1; read only connection master_1; +SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; +SET SESSION spider_read_only_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -441,10 +445,19 @@ DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only TRUNCATE t1; ERROR HY000: Table 'auto_test_local.t1' is read only +SET SESSION spider_read_only_mode = @original_spider_read_only_mode; 2.27 error mode connection master_1; +SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; +SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; +SET SESSION spider_error_read_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release +SET SESSION spider_error_write_mode = -1; +Warnings: +Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id int(11) NOT NULL, @@ -466,6 +479,8 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist +SET SESSION spider_error_read_mode = @original_spider_error_read_mode; +SET SESSION spider_error_write_mode = @original_spider_error_write_mode; 3.0 is null diff --git a/storage/spider/mysql-test/spider/r/variable_deprecation.result b/storage/spider/mysql-test/spider/r/variable_deprecation.result new file mode 100644 index 00000000000..354497573e9 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/variable_deprecation.result @@ -0,0 +1,38 @@ +# +# MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak +# +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +# MDEV-27923 Deprecate spider_use_handler +SET spider_use_handler= 3; +Warnings: +Warning 1287 '@@spider_use_handler' is deprecated and will be removed in a future release +SHOW VARIABLES LIKE "spider_use_handler"; +Variable_name Value +spider_use_handler 3 +CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='uhd "3"'; +Warnings: +Warning 1287 The table parameter 'uhd' is deprecated and will be removed in a future release +CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='use_handler "3"'; +Warnings: +Warning 1287 The table parameter 'use_handler' is deprecated and will be removed in a future release +DROP DATABASE auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test index 56e143060e6..47bc225d614 100644 --- a/storage/spider/mysql-test/spider/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider_fixes.test @@ -1172,6 +1172,8 @@ let $MASTER_1_ENGINE_IS_SPIDER= if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_read_only_mode = @@SESSION.spider_read_only_mode; + SET SESSION spider_read_only_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1197,6 +1199,7 @@ if ($MASTER_1_ENGINE_IS_SPIDER) DELETE FROM t1; --error 12518 TRUNCATE t1; + SET SESSION spider_read_only_mode = @original_spider_read_only_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { @@ -1210,6 +1213,10 @@ if (!$MASTER_1_ENGINE_IS_SPIDER) if ($MASTER_1_ENGINE_IS_SPIDER) { --connection master_1 + SET @original_spider_error_read_mode = @@SESSION.spider_error_read_mode; + SET @original_spider_error_write_mode = @@SESSION.spider_error_write_mode; + SET SESSION spider_error_read_mode = -1; + SET SESSION spider_error_write_mode = -1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -1227,6 +1234,8 @@ if ($MASTER_1_ENGINE_IS_SPIDER) INSERT INTO t1 (id) VALUES (1); DELETE FROM t1; TRUNCATE t1; + SET SESSION spider_error_read_mode = @original_spider_error_read_mode; + SET SESSION spider_error_write_mode = @original_spider_error_write_mode; } if (!$MASTER_1_ENGINE_IS_SPIDER) { diff --git a/storage/spider/mysql-test/spider/t/variable_deprecation.test b/storage/spider/mysql-test/spider/t/variable_deprecation.test new file mode 100644 index 00000000000..f2744b6497f --- /dev/null +++ b/storage/spider/mysql-test/spider/t/variable_deprecation.test @@ -0,0 +1,27 @@ +--echo # +--echo # MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak +--echo # + +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log + +--connection master_1 +CREATE DATABASE auto_test_local; +USE auto_test_local; + +--echo # MDEV-27923 Deprecate spider_use_handler +SET spider_use_handler= 3; +SHOW VARIABLES LIKE "spider_use_handler"; +eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='uhd "3"'; +eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='use_handler "3"'; + +DROP DATABASE auto_test_local; + +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc index 53c2370469e..9dd5a3b9113 100644 --- a/storage/spider/spd_param.cc +++ b/storage/spider/spd_param.cc @@ -138,6 +138,20 @@ static MYSQL_SYSVAR_BOOL( TRUE ); +static void spider_use_table_value_deprecated(THD *thd, st_mysql_sys_var *, + void *var_ptr, const void *save) +{ + int val= *static_cast<const int *>(save); + *static_cast<int *>(var_ptr)= val; + if (val == -1) + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, + "The option value -1 (use table value) is deprecated " + "and will be removed in a future release"); + } +} + my_bool spider_param_support_xa() { DBUG_ENTER("spider_param_support_xa"); @@ -219,8 +233,8 @@ static MYSQL_SYSVAR_INT( PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Use table charset for remote access", NULL, - NULL, - -1, + spider_use_table_value_deprecated, + 1, -1, 1, 0 @@ -422,8 +436,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Internal offset", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -447,8 +461,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Internal limit", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 9223372036854775807LL, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -472,8 +486,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of rows at a select", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 9223372036854775807LL, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -498,8 +512,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Use offset and limit parameter in SQL for split_read parameter.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -523,8 +537,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "The limit value for semi_split_read", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 9223372036854775807LL, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -549,8 +563,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Initial sql string alloc size", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1024, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -575,8 +589,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Reset sql string alloc after execute", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -601,8 +615,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Sprit read mode for multi range", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 100, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -626,8 +640,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Max columns for order by", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 32767, /* def */ -1, /* min */ 32767, /* max */ 0 /* blk */ @@ -772,8 +786,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Use different connection if semi_table_lock is enabled", /* comment */ &spider_param_semi_table_lock_connection_check, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -821,8 +835,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Lock for select with update", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -910,8 +924,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Bulk insert size", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 16000, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -939,8 +953,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "The mode of bulk updating and deleting", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -964,8 +978,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Bulk update size", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 16000, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -989,8 +1003,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Buffer size", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 16000, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1015,8 +1029,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Execute optimize to remote server", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -1041,8 +1055,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Execute optimize to remote server with local", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -1190,8 +1204,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Wait timeout of connecting to remote server", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 6, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1217,8 +1231,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Wait timeout of receiving data from remote server", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 600, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1244,8 +1258,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Wait timeout of sending data to remote server", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 600, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1275,8 +1289,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "The retrieval result from a remote server is acquired by acquisition one by one", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 3, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -1300,8 +1314,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of records in a page when acquisition one by one", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1024, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1325,8 +1339,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "The limitation of memory size in a page when acquisition one by one", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 10485760, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1351,8 +1365,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Use low memory mode when SQL(SELECT) internally issued to a remote server is executed and get a result list", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -1378,8 +1392,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "The mode of using columns at select clause", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -1406,8 +1420,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of background search", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -1432,8 +1446,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of first read records when background search is used", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1458,8 +1472,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of second read records when background search is used", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 100, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1484,8 +1498,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of first read records", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1510,8 +1524,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Number of second read records", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -1536,8 +1550,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Interval of cardinality confirmation.(second)", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 51, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1564,8 +1578,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of cardinality confirmation.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -1593,8 +1607,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Cardinality synchronization in partitioned table.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1621,8 +1635,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Type of cardinality calculation.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1646,8 +1660,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Weight coefficient to calculate effectiveness of index from cardinality of column.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1673,8 +1687,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of cardinality confirmation at background.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1699,8 +1713,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Interval of table state confirmation.(second)", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 10, /* def */ -1, /* min */ 2147483647, /* max */ 0 /* blk */ @@ -1726,8 +1740,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of table state confirmation.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1755,8 +1769,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Table state synchronization in partitioned table.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1783,8 +1797,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of table state confirmation at background.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 2, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -1833,8 +1847,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of auto increment.", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -1926,8 +1940,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Execute \"REPLACE\" and \"INSERT IGNORE\" on remote server and avoid duplicate check on local server", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2255,8 +2269,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Mode of BKA for Spider", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 2, /* max */ 0 /* blk */ @@ -2330,11 +2344,11 @@ longlong spider_param_udf_ct_bulk_insert_rows( */ static MYSQL_THDVAR_INT( use_handler, /* name */ - PLUGIN_VAR_RQCMDARG, /* opt */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */ "Use handler for reading", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -2359,8 +2373,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Read error mode if error", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2385,8 +2399,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Write error mode if error", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2411,8 +2425,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Skip generating internal default condition", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2439,8 +2453,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Skip parallel search by specific conditions", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 3, /* max */ 0 /* blk */ @@ -2465,8 +2479,8 @@ static MYSQL_THDVAR_LONGLONG( PLUGIN_VAR_RQCMDARG, /* opt */ "Send 'ORDER BY' and 'LIMIT' to remote server directly", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 9223372036854775807LL, /* def */ -1, /* min */ 9223372036854775807LL, /* max */ 0 /* blk */ @@ -2491,8 +2505,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Read only", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2709,8 +2723,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Read casually if it is possible", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 63, /* max */ 0 /* blk */ @@ -2752,8 +2766,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "The type of delete_all_rows", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2778,8 +2792,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "The type of temporary table name for bka", /* comment */ NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 0, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ @@ -2830,8 +2844,8 @@ static MYSQL_SYSVAR_INT( PLUGIN_VAR_RQCMDARG, "Store last sts result into system table", NULL, - NULL, - -1, + spider_use_table_value_deprecated, + 1, -1, 1, 0 @@ -2857,8 +2871,8 @@ static MYSQL_SYSVAR_INT( PLUGIN_VAR_RQCMDARG, "Store last crd result into system table", NULL, - NULL, - -1, + spider_use_table_value_deprecated, + 1, -1, 1, 0 @@ -2884,8 +2898,8 @@ static MYSQL_SYSVAR_INT( PLUGIN_VAR_RQCMDARG, "Load sts from system table at startup", NULL, - NULL, - -1, + spider_use_table_value_deprecated, + 1, -1, 1, 0 @@ -2911,8 +2925,8 @@ static MYSQL_SYSVAR_INT( PLUGIN_VAR_RQCMDARG, "Load crd from system table at startup", NULL, - NULL, - -1, + spider_use_table_value_deprecated, + 1, -1, 1, 0 @@ -3079,8 +3093,8 @@ static MYSQL_THDVAR_INT( PLUGIN_VAR_RQCMDARG, /* opt */ "Use columns in select clause strictly for group by clause", NULL, /* check */ - NULL, /* update */ - -1, /* def */ + spider_use_table_value_deprecated, /* update */ + 1, /* def */ -1, /* min */ 1, /* max */ 0 /* blk */ diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 571131411d7..332691efade 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -1973,6 +1973,16 @@ int st_spider_param_string_parse::print_param_error() } \ break; \ } +#define SPIDER_PARAM_DEPRECATED_WARNING(title_name) \ + if (!strncasecmp(tmp_ptr, title_name, title_length) && create_table) \ + { \ + THD *thd= current_thd; \ + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, \ + ER_WARN_DEPRECATED_SYNTAX, \ + "The table parameter '%s' is deprecated and will be " \ + "removed in a future release", \ + title_name); \ + } /* Set a given engine-defined option, which holds a string list, to the @@ -2334,7 +2344,8 @@ int spider_parse_connect_info( SPIDER_PARAM_LONGLONG("srd", second_read, 0); SPIDER_PARAM_DOUBLE("srt", scan_rate, 0); SPIDER_PARAM_STR_LIST_CHECK("srv", server_names, - option_struct->remote_server); + option_struct && + option_struct->remote_server); SPIDER_PARAM_DOUBLE("ssr", semi_split_read, 0); SPIDER_PARAM_LONGLONG("ssl", semi_split_read_limit, 0); #ifdef WITH_PARTITION_STORAGE_ENGINE @@ -2345,8 +2356,10 @@ int spider_parse_connect_info( SPIDER_PARAM_LONGLONG("srs", static_records_for_status, 0); SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1); SPIDER_PARAM_STR_LIST_CHECK("tbl", tgt_table_names, - option_struct->remote_table); + option_struct && + option_struct->remote_table); SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3); + SPIDER_PARAM_DEPRECATED_WARNING("uhd"); SPIDER_PARAM_LONG_LIST_WITH_MAX("uhd", use_handlers, 0, 3); SPIDER_PARAM_INT_WITH_MAX("upu", use_pushdown_udf, 0, 1); SPIDER_PARAM_INT_WITH_MAX("utc", use_table_charset, 0, 1); @@ -2360,13 +2373,15 @@ int spider_parse_connect_info( goto error; case 5: SPIDER_PARAM_STR_LIST_CHECK("table", tgt_table_names, - option_struct->remote_table); + option_struct && + option_struct->remote_table); error_num = connect_string_parse.print_param_error(); goto error; case 6: SPIDER_PARAM_STR_LIST("driver", tgt_drivers); SPIDER_PARAM_STR_LIST_CHECK("server", server_names, - option_struct->remote_server); + option_struct && + option_struct->remote_server); SPIDER_PARAM_STR_LIST("socket", tgt_sockets); SPIDER_PARAM_HINT("idx", key_hint, 3, (int) table_share->keys, spider_db_append_key_hint); @@ -2384,7 +2399,8 @@ int spider_parse_connect_info( goto error; case 8: SPIDER_PARAM_STR_LIST_CHECK("database", tgt_dbs, - option_struct->remote_database); + option_struct && + option_struct->remote_database); SPIDER_PARAM_STR_LIST("password", tgt_passwords); SPIDER_PARAM_INT_WITH_MAX("sts_mode", sts_mode, 1, 2); #ifdef WITH_PARTITION_STORAGE_ENGINE @@ -2423,6 +2439,7 @@ int spider_parse_connect_info( SPIDER_PARAM_INT_WITH_MAX("crd_bg_mode", crd_bg_mode, 0, 2); SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2); SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3); + SPIDER_PARAM_DEPRECATED_WARNING("use_handler"); SPIDER_PARAM_LONG_LIST_WITH_MAX("use_handler", use_handlers, 0, 3); SPIDER_PARAM_INT_WITH_MAX("casual_read", casual_read, 0, 63); SPIDER_PARAM_INT("buffer_size", buffer_size, 0); |