Commit b03b6c86 authored by unknown's avatar unknown

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


client/mysqltest.c:
  To force something being sent as a query to the mysqld one can
  use the prefix "query". Remove "query" from string before executing.
mysql-test/r/mysqltest.result:
  Add test case for "query" command
mysql-test/t/mysqltest.test:
  Add test case for "query" command
parent d2f447a9
...@@ -4757,6 +4757,14 @@ int main(int argc, char **argv) ...@@ -4757,6 +4757,14 @@ int main(int argc, char **argv)
q->require_file=require_file; q->require_file=require_file;
save_file[0]=0; 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); run_query(&cur_con->mysql, q, flags);
query_executed= 1; query_executed= 1;
q->last_argument= q->end; q->last_argument= q->end;
......
...@@ -441,3 +441,9 @@ select-me ...@@ -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 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;
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; ...@@ -1125,3 +1125,18 @@ drop table t1;
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