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-24 19:26:09 +0900 |
commit | 5595ed9d9f20aeb463ac26e075c9cba41927e85e (patch) | |
tree | 06ea488d179e95c052cf3237031f7aa0bc786663 | |
parent | 0599dd90147959b0080c786ba24a98c9ac3c8989 (diff) | |
download | mariadb-git-5595ed9d9f20aeb463ac26e075c9cba41927e85e.tar.gz |
MDEV-27521 SIGSEGV in spider_parse_connect_info in MDEV-27106 branch
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 301c676c9bc..b9a0b582b65 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -2015,7 +2015,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)= \ |