Commit 15a5881c authored by unknown's avatar unknown

Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/p1-bug30671.3

into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/p1-bug30671.3.merge-5.1

parents a26201f8 aea5007d
...@@ -253,6 +253,14 @@ drop user guest_usage@localhost; ...@@ -253,6 +253,14 @@ drop user guest_usage@localhost;
drop user guest_select@localhost; drop user guest_select@localhost;
drop table federated.t1; drop table federated.t1;
drop server 's1'; drop server 's1';
create server 's1' foreign data wrapper 'mysql' options (port 3306);
alter server 's1' options
(host 'localhost', database '', user '',
password '', socket '', owner '', port 3306);
alter server 's1' options
(host 'localhost', database 'database1', user '',
password '', socket '', owner '', port 3306);
drop server 's1';
# End of 5.1 tests # End of 5.1 tests
use test; use test;
create procedure p1 () create procedure p1 ()
...@@ -262,7 +270,7 @@ DECLARE e INT DEFAULT 0; ...@@ -262,7 +270,7 @@ DECLARE e INT DEFAULT 0;
DECLARE i INT; DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
SET i = sleep(5); SET i = sleep(5);
WHILE v < 20000 do WHILE v < 10000 do
CREATE SERVER s CREATE SERVER s
FOREIGN DATA WRAPPER mysql FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# if federated can utilise the servers table # if federated can utilise the servers table
# should work with embedded server after mysqltest is fixed # should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/federated.inc; -- source include/federated.inc
-- source include/big_test.inc -- source include/big_test.inc
connection slave; connection slave;
...@@ -282,6 +282,18 @@ drop user guest_select@localhost; ...@@ -282,6 +282,18 @@ drop user guest_select@localhost;
drop table federated.t1; drop table federated.t1;
drop server 's1'; drop server 's1';
#
# Bug#30671 - ALTER SERVER causes the server to crash
#
create server 's1' foreign data wrapper 'mysql' options (port 3306);
alter server 's1' options
(host 'localhost', database '', user '',
password '', socket '', owner '', port 3306);
# The next statement would crash unpatched server
alter server 's1' options
(host 'localhost', database 'database1', user '',
password '', socket '', owner '', port 3306);
drop server 's1';
--echo # End of 5.1 tests --echo # End of 5.1 tests
......
...@@ -289,7 +289,7 @@ get_server_from_table_to_cache(TABLE *table) ...@@ -289,7 +289,7 @@ get_server_from_table_to_cache(TABLE *table)
{ {
/* alloc a server struct */ /* alloc a server struct */
char *ptr; char *ptr;
char *blank= (char*)""; char * const blank= (char*)"";
FOREIGN_SERVER *server= (FOREIGN_SERVER *)alloc_root(&mem, FOREIGN_SERVER *server= (FOREIGN_SERVER *)alloc_root(&mem,
sizeof(FOREIGN_SERVER)); sizeof(FOREIGN_SERVER));
DBUG_ENTER("get_server_from_table_to_cache"); DBUG_ENTER("get_server_from_table_to_cache");
...@@ -312,7 +312,7 @@ get_server_from_table_to_cache(TABLE *table) ...@@ -312,7 +312,7 @@ get_server_from_table_to_cache(TABLE *table)
server->port= server->sport ? atoi(server->sport) : 0; server->port= server->sport ? atoi(server->sport) : 0;
ptr= get_field(&mem, table->field[6]); ptr= get_field(&mem, table->field[6]);
server->socket= ptr && strlen(ptr) ? ptr : NULL; server->socket= ptr && strlen(ptr) ? ptr : blank;
ptr= get_field(&mem, table->field[7]); ptr= get_field(&mem, table->field[7]);
server->scheme= ptr ? ptr : blank; server->scheme= ptr ? ptr : blank;
ptr= get_field(&mem, table->field[8]); ptr= get_field(&mem, table->field[8]);
......
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