summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2011-11-24 14:51:18 +0000
committerLuis Soares <luis.soares@oracle.com>2011-11-24 14:51:18 +0000
commit4b157e1556b5c7d5da11b6eb0e4ba72378ce9cfd (patch)
tree4597c571d43b70b54d380b192312ba7d418ef024 /mysql-test
parent5d81384c5a8ed557be2f14eea771475e43edaa90 (diff)
downloadmariadb-git-4b157e1556b5c7d5da11b6eb0e4ba72378ce9cfd.tar.gz
BUG#13427949: CHANGE MASTER TO USER='' (EMPTY USER) CAUSES ERRORS ON VALGRING
When passing an empty user to the connect function will cause valgrind warnings. Seems that the client code is not prepared to handle empty users. On 5.6 this can even be triggered by START SLAVE PASSWORD='...'; i.e., without setting USER='...' on the START SLAVE command (see WL#4143 for details on the new additional START SLAVE commands). To fix this, we disallow empty users when configuring the slave connection parameters (this decision might be revisited if the client code accepts empty users in the future). sql/slave.cc: We throw an error if an empty user is supplied to the connection function.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/rpl/r/rpl_connection.result11
-rw-r--r--mysql-test/suite/rpl/t/rpl_connection.test24
2 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_connection.result b/mysql-test/suite/rpl/r/rpl_connection.result
new file mode 100644
index 00000000000..02a7a36278e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_connection.result
@@ -0,0 +1,11 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression(".*Invalid .* username when attempting to connect to the master server.*");
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= '';
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1045, 1593]
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
+START SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_connection.test b/mysql-test/suite/rpl/t/rpl_connection.test
new file mode 100644
index 00000000000..1233e28dc86
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_connection.test
@@ -0,0 +1,24 @@
+--source include/not_embedded.inc
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+#
+# BUG#13427949: CHANGE MASTER TO USER='' (EMPTY USER) CAUSES ERRORS ON VALGRING
+#
+
+--connection slave
+call mtr.add_suppression(".*Invalid .* username when attempting to connect to the master server.*");
+
+
+# Assert that we disallow empty users and that no problem
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= '';
+START SLAVE;
+--let $slave_io_errno= 1045, 1593
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave.inc
+
+CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
+START SLAVE;
+
+--source include/rpl_end.inc