diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-01-19 14:17:36 +0900 |
---|---|---|
committer | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2022-01-19 14:17:36 +0900 |
commit | 1bfeac1aef7025d8e13d92ec85c2bacf1503b794 (patch) | |
tree | 188c192bd4ed4fca7a25450c716f43d20acdd3e4 | |
parent | 959a6a723f6b6fb6d9630380c2317b8d51f9e4d8 (diff) | |
download | mariadb-git-preview-10.8-MDEV-27106-spider.tar.gz |
MDEV-27521 SIGSEGV in spider_parse_connect_info in MDEV-27106 branchpreview-10.8-MDEV-27106-spider
Add NULL check to SPIDER_OPTION_STR_LIST.
3 files changed, 16 insertions, 1 deletions
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 866d9c78b27..2b63fb3ee53 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 @@ -209,6 +209,13 @@ REMOTE_SERVER="s_2_2" REMOTE_DATABASE="auto_test_remote2" SELECT * FROM tbl_a; a b DROP TABLE tbl_a; +CREATE TABLE tbl_a ( +a INT +) ENGINE=Spider DEFAULT CHARSET=utf8 +PARTITION BY HASH (a) PARTITIONS 2; +SELECT * FROM tbl_a; +ERROR HY000: Unable to connect to foreign data source: localhost +DROP TABLE tbl_a; 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 c42a9b671c4..e3fef7cb6d6 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 @@ -194,6 +194,14 @@ PARTITION BY RANGE (a) ( SELECT * FROM tbl_a; DROP TABLE tbl_a; +eval CREATE TABLE tbl_a ( + a INT +) $MASTER_1_ENGINE $MASTER_1_CHARSET +PARTITION BY HASH (a) PARTITIONS 2; +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +SELECT * FROM tbl_a; +DROP TABLE tbl_a; + --connection child2_1 DROP DATABASE auto_test_remote; diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 1c7bbfb3f73..5c41bd562bc 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -2029,7 +2029,7 @@ int st_spider_param_string_parse::print_param_error() corresponding attribute of SPIDER_SHARE. */ #define SPIDER_OPTION_STR_LIST(title_name, option_name, param_name) \ - if (option_struct->option_name) \ + if (option_struct && option_struct->option_name) \ { \ DBUG_PRINT("info", ("spider " title_name " start overwrite")); \ share->SPIDER_PARAM_STR_CHARLEN(param_name)= \ |