diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-04-05 18:20:41 +0900 |
---|---|---|
committer | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-04-14 23:41:16 +0900 |
commit | cc13ab0ffc49fbb287527ec3125880aff3bded05 (patch) | |
tree | 511cd6b68101c40d9f2ccde0d073dbe1b0231d53 | |
parent | 075c94fe2be72e681007ae78fe44649cf334b634 (diff) | |
download | mariadb-git-bb-10.7-nayuta.tar.gz |
MDEV-28010 Deprecate spider_crd_type and spider_crd_weightbb-10.7-nayuta
Deprecate the variables spider_crd_type and spider_crd_weight.
The value should be defined by the engine developers.
-rw-r--r-- | storage/spider/mysql-test/spider/r/variable_deprecation.result | 29 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/t/variable_deprecation.test | 17 | ||||
-rw-r--r-- | storage/spider/spd_param.cc | 4 | ||||
-rw-r--r-- | storage/spider/spd_table.cc | 4 |
4 files changed, 52 insertions, 2 deletions
diff --git a/storage/spider/mysql-test/spider/r/variable_deprecation.result b/storage/spider/mysql-test/spider/r/variable_deprecation.result index 65569e4c3ce..83d348e0e26 100644 --- a/storage/spider/mysql-test/spider/r/variable_deprecation.result +++ b/storage/spider/mysql-test/spider/r/variable_deprecation.result @@ -137,6 +137,35 @@ Warnings: Warning 1287 The table parameter 'sts_mode' is deprecated and will be removed in a future release DROP TABLE tbl_a; DROP TABLE tbl_b; +# MDEV-28010 Deprecate spider_crd_type and spider_crd_weight +SET spider_crd_type = 1; +Warnings: +Warning 1287 '@@spider_crd_type' is deprecated and will be removed in a future release +SHOW VARIABLES LIKE "spider_crd_type"; +Variable_name Value +spider_crd_type 1 +CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ctp "1"'; +Warnings: +Warning 1287 The table parameter 'ctp' is deprecated and will be removed in a future release +CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_type "1"'; +Warnings: +Warning 1287 The table parameter 'crd_type' is deprecated and will be removed in a future release +DROP TABLE tbl_a; +DROP TABLE tbl_b; +SET spider_crd_weight = 1; +Warnings: +Warning 1287 '@@spider_crd_weight' is deprecated and will be removed in a future release +SHOW VARIABLES LIKE "spider_crd_weight"; +Variable_name Value +spider_crd_weight 1 +CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='cwg "1"'; +Warnings: +Warning 1287 The table parameter 'cwg' is deprecated and will be removed in a future release +CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='crd_weight "1"'; +Warnings: +Warning 1287 The table parameter 'crd_weight' is deprecated and will be removed in a future release +DROP TABLE tbl_a; +DROP TABLE tbl_b; DROP DATABASE auto_test_local; for master_1 for child2 diff --git a/storage/spider/mysql-test/spider/t/variable_deprecation.test b/storage/spider/mysql-test/spider/t/variable_deprecation.test index f55e160e5b6..7f66587bbef 100644 --- a/storage/spider/mysql-test/spider/t/variable_deprecation.test +++ b/storage/spider/mysql-test/spider/t/variable_deprecation.test @@ -83,6 +83,23 @@ eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='sts_mode "3"'; DROP TABLE tbl_a; DROP TABLE tbl_b; +--echo # MDEV-28010 Deprecate spider_crd_type and spider_crd_weight +SET spider_crd_type = 1; +SHOW VARIABLES LIKE "spider_crd_type"; +eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='ctp "1"'; +eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='crd_type "1"'; + +DROP TABLE tbl_a; +DROP TABLE tbl_b; + +SET spider_crd_weight = 1; +SHOW VARIABLES LIKE "spider_crd_weight"; +eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='cwg "1"'; +eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='crd_weight "1"'; + +DROP TABLE tbl_a; +DROP TABLE tbl_b; + DROP DATABASE auto_test_local; --disable_query_log diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc index b970afe120b..add0d0ee426 100644 --- a/storage/spider/spd_param.cc +++ b/storage/spider/spd_param.cc @@ -1707,7 +1707,7 @@ int spider_param_crd_sync( */ static MYSQL_THDVAR_INT( crd_type, /* name */ - PLUGIN_VAR_RQCMDARG, /* opt */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */ "Type of cardinality calculation.", /* comment */ NULL, /* check */ spider_use_table_value_deprecated, /* update */ @@ -1732,7 +1732,7 @@ int spider_param_crd_type( */ static MYSQL_THDVAR_INT( crd_weight, /* name */ - PLUGIN_VAR_RQCMDARG, /* opt */ + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */ "Weight coefficient to calculate effectiveness of index from cardinality of column.", /* comment */ NULL, /* check */ spider_use_table_value_deprecated, /* update */ diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 3e50d543e93..45cd19e524c 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -2344,7 +2344,9 @@ int spider_parse_connect_info( #endif SPIDER_PARAM_LONG_LIST_WITH_MAX("cto", connect_timeouts, 0, 2147483647); + SPIDER_PARAM_DEPRECATED_WARNING("ctp"); SPIDER_PARAM_INT_WITH_MAX("ctp", crd_type, 0, 2); + SPIDER_PARAM_DEPRECATED_WARNING("cwg"); SPIDER_PARAM_DOUBLE("cwg", crd_weight, 1); SPIDER_PARAM_INT_WITH_MAX("dat", delete_all_rows_type, 0, 1); SPIDER_PARAM_INT_WITH_MAX("ddi", direct_dup_insert, 0, 1); @@ -2503,6 +2505,7 @@ int spider_parse_connect_info( #ifdef WITH_PARTITION_STORAGE_ENGINE SPIDER_PARAM_INT_WITH_MAX("crd_sync", crd_sync, 0, 2); #endif + SPIDER_PARAM_DEPRECATED_WARNING("crd_type"); SPIDER_PARAM_INT_WITH_MAX("crd_type", crd_type, 0, 2); SPIDER_PARAM_LONGLONG("priority", priority, 0); #ifndef WITHOUT_SPIDER_BG_SEARCH @@ -2520,6 +2523,7 @@ int spider_parse_connect_info( error_num = connect_string_parse.print_param_error(); goto error; case 10: + SPIDER_PARAM_DEPRECATED_WARNING("crd_weight"); SPIDER_PARAM_DOUBLE("crd_weight", crd_weight, 1); SPIDER_PARAM_LONGLONG("split_read", split_read, 0); SPIDER_PARAM_INT_WITH_MAX("quick_mode", quick_mode, 0, 3); |