Commit b03b6c86 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;
+6 −0
Original line number Diff line number Diff line
@@ -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
+15 −0
Original line number Diff line number Diff line
@@ -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 ;