Commit 332c59a2 authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

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.
parent 33c30da1
#
# 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
--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
......@@ -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 */
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment