mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#35509 - Federated leaks memory when connecting to
localhost/default port When creating federated table that points to unspecified host or localhost on unspecified port or port is 0, small memory leak occurs. This happens because we make a copy of unix socket path, which is never freed. With this fix we do not make a copy of unix socket path, instead share->socket points to MYSQL_UNIX_ADDR constant directly. This fix is covered by a test case for BUG34788. Affects 5.0 only. mysql-test/t/federated.test: A test case for BUG#35509. sql/ha_federated.cc: When creating federated table we call parse_url() to check if connect string is correct. parse_url() may make a copy of unix socket path if port is not specified or 0 and host is not specified or 'localhost'. This copy is never freed. As there is no need to make a copy of unix socket path, let share->socket point to MYSQL_UNIX_ADDR directly.
This commit is contained in:
@ -1742,6 +1742,11 @@ DROP TABLE t1;
|
||||
# BUG#34788 - malformed federated connection url is not handled correctly -
|
||||
# crashes server !
|
||||
#
|
||||
# also tests
|
||||
#
|
||||
# BUG#35509 - Federated leaks memory when connecting to localhost/default
|
||||
# port
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
Reference in New Issue
Block a user