Bug#19890 mysqltest: "query" command is broken

 - Allow "query" to be used as a prefix for focing a command to be sent to server
 - Add testcases
parent 8f21e375
......@@ -4757,6 +4757,14 @@ int main(int argc, char **argv)
q->require_file=require_file;
save_file[0]=0;
}
/*
To force something being sent as a query to the mysqld one can
use the prefix "query". Remove "query" from string before executing
*/
if (strncmp(q->query, "query ", 6) == 0)
{
q->query= q->first_argument;
}
run_query(&cur_con->mysql, q, flags);
query_executed= 1;
q->last_argument= q->end;
......
......@@ -441,3 +441,9 @@ select-me
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insertz error query' at line 1
drop table t1;
drop table t1;
sleep;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sleep' at line 1
sleep;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sleep' at line 1
;
ERROR 42000: Query was empty
......@@ -1125,3 +1125,18 @@ drop table t1;
drop table t1;
#
# Bug#19890 mysqltest: "query" command is broken
#
# It should be possible to use the command "query" to force mysqltest to
# send the command to the server although it's a builtin mysqltest command.
--error 1064
query sleep;
--error 1064
--query sleep
# Just an empty query command
--error 1065
query ;
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