Commit 5595ed9d authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-27521 SIGSEGV in spider_parse_connect_info in MDEV-27106 branch

Add NULL check to SPIDER_OPTION_STR_LIST.
parent 0599dd90
......@@ -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;
......
......@@ -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;
......
......@@ -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)= \
......
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