Commit 9ab9c73a authored by Bjorn Munch's avatar Bjorn Munch

Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'

Undid amendment allowing pending reap after switching connections
Moved check for pending reap earlier; failed if running with ps-protocol
parent 570ee4c5
......@@ -4622,7 +4622,6 @@ void select_connection_name(const char *name)
if (!con)
die("connection '%s' not found in connection pool", name);
con->pending= FALSE;
set_current_connection(con);
DBUG_VOID_RETURN;
......@@ -6517,9 +6516,6 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
if (flags & QUERY_SEND_FLAG)
{
if (cn->pending)
die ("Cannot run query on connection between send and reap");
/*
Send the query
*/
......@@ -7111,6 +7107,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
init_dynamic_string(&ds_warnings, NULL, 0, 256);
if (cn->pending && (flags & QUERY_SEND_FLAG))
die ("Cannot run query on connection between send and reap");
/*
Evaluate query if this is an eval command
*/
......
......@@ -542,13 +542,6 @@ f1
Abcd
mysqltest: At line 2: Cannot run query on connection between send and reap
select * from t1;;
select * from t1;;
select 1;
1
1
select 2;
2
2
drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
......
......@@ -78,6 +78,7 @@ COMMIT;
--echo 'CONNECTION con2'
CONNECTION con2;
reap;
UNLOCK tables;
DROP TABLE t1;
......
......@@ -127,6 +127,7 @@ connection con0;
SET SESSION low_priority_updates = OFF;
--echo ** Connection con1 **
connection con1;
reap;
SET SESSION low_priority_updates = OFF;
--echo ** Connection default**
connection default;
......
......@@ -1654,18 +1654,6 @@ EOF
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.in;
# 7. Test that stmt after send without reap IS allowed
# if we have switched connections
connect (test_con1,localhost,root,,);
--send select * from t1;
connection default;
select 1;
connection test_con1;
select 2;
disconnect test_con1;
connection default;
drop table t1;
# ----------------------------------------------------------------------------
......
......@@ -187,6 +187,7 @@ SELECT * FROM t1;
--echo # Switch to connection con2
connection con2;
reap;
SELECT * FROM t1;
connection default;
......
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