Commit e8085d1b authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-9346 - The federatedx and spider engine make mysqld crash when they are

            configured withtout username

Federated/spider/connect engines or replication threads connecting to other host
with empty user name may crash mysqld.

This is addition to original patch, which adds a test case and amends a macro.
parent 9b73e886
......@@ -2157,6 +2157,12 @@ DROP TABLE federated.t1;
End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
#
# MDEV-9346 - The federatedx and spider engine make mysqld crash when
# they are configured withtout username
#
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
......
......@@ -2000,4 +2000,13 @@ SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
--echo #
--echo # MDEV-9346 - The federatedx and spider engine make mysqld crash when
--echo # they are configured withtout username
--echo #
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
--error ER_CANT_CREATE_FEDERATED_TABLE
eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
source include/federated_cleanup.inc;
......@@ -37,7 +37,7 @@
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
CLIENT_CONNECT_ATTRS)
#define read_user_name(A) {strmov(A,"");}
#define read_user_name(A) A[0]= 0
#undef _CUSTOMCONFIG_
#define mysql_server_init(a,b,c) mysql_client_plugin_init()
......
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