From 8030bdfc16a647c15e0de5e07b5f53d263ef5ca2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Mar 2008 19:07:17 +0400 Subject: 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. --- mysql-test/t/federated.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t/federated.test') 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; -- cgit v1.2.1