Skip to content

Commit 332c59a

Browse files
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.
1 parent 33c30da commit 332c59a

File tree

4 files changed

+78
-1
lines changed

4 files changed

+78
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak
3+
#
4+
for master_1
5+
for child2
6+
child2_1
7+
child2_2
8+
child2_3
9+
for child3
10+
child3_1
11+
child3_2
12+
child3_3
13+
connection master_1;
14+
CREATE DATABASE auto_test_local;
15+
USE auto_test_local;
16+
# MDEV-27923 Deprecate spider_use_handler
17+
SET spider_use_handler= 3;
18+
Warnings:
19+
Warning 1287 '@@spider_use_handler' is deprecated and will be removed in a future release
20+
SHOW VARIABLES LIKE "spider_use_handler";
21+
Variable_name Value
22+
spider_use_handler 3
23+
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='uhd "3"';
24+
Warnings:
25+
Warning 1287 The table parameter 'uhd' is deprecated and will be removed in a future release
26+
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='use_handler "3"';
27+
Warnings:
28+
Warning 1287 The table parameter 'use_handler' is deprecated and will be removed in a future release
29+
DROP DATABASE auto_test_local;
30+
for master_1
31+
for child2
32+
child2_1
33+
child2_2
34+
child2_3
35+
for child3
36+
child3_1
37+
child3_2
38+
child3_3
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--echo #
2+
--echo # MDEV-27228 Deprecate Spider plugin variables that result in excessive tweak
3+
--echo #
4+
5+
--disable_query_log
6+
--disable_result_log
7+
--source test_init.inc
8+
--enable_result_log
9+
--enable_query_log
10+
11+
--connection master_1
12+
CREATE DATABASE auto_test_local;
13+
USE auto_test_local;
14+
15+
--echo # MDEV-27923 Deprecate spider_use_handler
16+
SET spider_use_handler= 3;
17+
SHOW VARIABLES LIKE "spider_use_handler";
18+
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='uhd "3"';
19+
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='use_handler "3"';
20+
21+
DROP DATABASE auto_test_local;
22+
23+
--disable_query_log
24+
--disable_result_log
25+
--source test_deinit.inc
26+
--enable_result_log
27+
--enable_query_log

storage/spider/spd_param.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,7 @@ int spider_param_use_hs_write(
26802680
*/
26812681
static MYSQL_THDVAR_INT(
26822682
use_handler, /* name */
2683-
PLUGIN_VAR_RQCMDARG, /* opt */
2683+
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
26842684
"Use handler for reading", /* comment */
26852685
NULL, /* check */
26862686
NULL, /* update */

storage/spider/spd_table.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,16 @@ int st_spider_param_string_parse::print_param_error()
20602060
} \
20612061
break; \
20622062
}
2063+
#define SPIDER_PARAM_DEPRECATED_WARNING(title_name) \
2064+
if (!strncasecmp(tmp_ptr, title_name, title_length) && create_table) \
2065+
{ \
2066+
THD *thd= current_thd; \
2067+
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, \
2068+
ER_WARN_DEPRECATED_SYNTAX, \
2069+
"The table parameter '%s' is deprecated and will be " \
2070+
"removed in a future release", \
2071+
title_name); \
2072+
}
20632073

20642074
int spider_parse_connect_info(
20652075
SPIDER_SHARE *share,
@@ -2437,6 +2447,7 @@ int spider_parse_connect_info(
24372447
SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
24382448
SPIDER_PARAM_STR_LIST("tbl", tgt_table_names);
24392449
SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3);
2450+
SPIDER_PARAM_DEPRECATED_WARNING("uhd");
24402451
SPIDER_PARAM_LONG_LIST_WITH_MAX("uhd", use_handlers, 0, 3);
24412452
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
24422453
SPIDER_PARAM_LONG_LIST_WITH_MAX(
@@ -2520,6 +2531,7 @@ int spider_parse_connect_info(
25202531
SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
25212532
#endif
25222533
SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3);
2534+
SPIDER_PARAM_DEPRECATED_WARNING("use_handler");
25232535
SPIDER_PARAM_LONG_LIST_WITH_MAX("use_handler", use_handlers, 0, 3);
25242536
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
25252537
SPIDER_PARAM_LONG_LIST_WITH_MAX("use_hs_read", use_hs_reads, 0, 1);

0 commit comments

Comments
 (0)