summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-03-02 14:14:17 +0900
committerNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-03-14 14:24:18 +0900
commit332c59a27ca798ccf56be14f8c9e4f25d60a47a5 (patch)
treebd9ec73a622507e9a5bd7f4f050249a7a05af7f2
parent33c30da165506a18591cc51cd08ec9f9ca3b13a8 (diff)
downloadmariadb-git-332c59a27ca798ccf56be14f8c9e4f25d60a47a5.tar.gz
MDEV-27923 Deprecate spider_use_handler
Deprecate the plugin variable spider_use_handler and the corresponding table parameters "uhd" and "use_handler". Passing a Handler statement to data nodes, without converting it to SQL sometimes, might improve the performance, while this introduces some complication to the implementation. In the first place, only a few people use Handler statements and the performance gain seems not to be very significant. Further, setting spider_use_handler > 0 disables the GROUP BY handler. So, we decided to deprecate the variable.
-rw-r--r--storage/spider/mysql-test/spider/r/variable_deprecation.result38
-rw-r--r--storage/spider/mysql-test/spider/t/variable_deprecation.test27
-rw-r--r--storage/spider/spd_param.cc2
-rw-r--r--storage/spider/spd_table.cc12
4 files changed, 78 insertions, 1 deletions
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/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 b23877ca92a..7d8639a1386 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -2680,7 +2680,7 @@ int spider_param_use_hs_write(
*/
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 */
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 04333d973a3..497bad63102 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -2060,6 +2060,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); \
+ }
int spider_parse_connect_info(
SPIDER_SHARE *share,
@@ -2437,6 +2447,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
SPIDER_PARAM_STR_LIST("tbl", tgt_table_names);
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);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
SPIDER_PARAM_LONG_LIST_WITH_MAX(
@@ -2520,6 +2531,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
#endif
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);
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
SPIDER_PARAM_LONG_LIST_WITH_MAX("use_hs_read", use_hs_reads, 0, 1);