summaryrefslogtreecommitdiff
path: root/mysql-test/t/federated.test
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/june.mysql.com>2008-03-20 19:07:17 +0400
committerunknown <svoj@mysql.com/june.mysql.com>2008-03-20 19:07:17 +0400
commit8030bdfc16a647c15e0de5e07b5f53d263ef5ca2 (patch)
tree0ea585c816f892e7d7167a1ef6f609196a3a0bb3 /mysql-test/t/federated.test
parent7343db297a1f1ab08812c9b4471306535551ddec (diff)
downloadmariadb-git-8030bdfc16a647c15e0de5e07b5f53d263ef5ca2.tar.gz
BUG#34788 - malformed federated connection url is not handled
correctly - crashes server ! Creating federated table with connect string containing empty (zero-length) host name and port is evaluated as 0 (port is incorrect, omitted or 0) crashes server. This happens because federated calls strcmp() with NULL pointer. Fixed by avoiding strcmp() call if hostname is set to NULL. mysql-test/r/federated.result: A test case for BUG#34788. mysql-test/t/federated.test: A test case for BUG#34788. sql/ha_federated.cc: Fixed that parse_url() may call strcmp() with NULL pointer.
Diffstat (limited to 'mysql-test/t/federated.test')
-rw-r--r--mysql-test/t/federated.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 934db5cd68b..f33dfa3a1b8 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1738,4 +1738,11 @@ DROP TABLE t1;
connection slave;
DROP TABLE t1;
+#
+# BUG#34788 - malformed federated connection url is not handled correctly -
+# crashes server !
+#
+CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
+DROP TABLE t1;
+
source include/federated_cleanup.inc;