mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
Detect comment with command using extra delimiter
This commit is contained in:
parent
4c2ddda8b9
commit
9c1c075da1
4 changed files with 22 additions and 3 deletions
|
|
@ -3901,6 +3901,22 @@ void get_query_type(struct st_query* q)
|
|||
q->type != Q_DISABLE_PARSING)
|
||||
q->type= Q_COMMENT;
|
||||
}
|
||||
else if (q->type == Q_COMMENT_WITH_COMMAND &&
|
||||
q->query[q->first_word_len-1] == ';')
|
||||
{
|
||||
/*
|
||||
Detect comment with command using extra delimiter
|
||||
Ex --disable_query_log;
|
||||
^ Extra delimiter causing the command
|
||||
to be skipped
|
||||
*/
|
||||
save= q->query[q->first_word_len-1];
|
||||
q->query[q->first_word_len-1]= 0;
|
||||
type= find_type(q->query, &command_typelib, 1+2);
|
||||
q->query[q->first_word_len-1]= save;
|
||||
if (type > 0)
|
||||
die("Extra delimiter \";\" found");
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
--require r/lowercase0.require
|
||||
--disable_query_log;
|
||||
--disable_query_log
|
||||
show variables like "lower_case_%";
|
||||
--enable_query_log;
|
||||
--enable_query_log
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ mysqltest: At line 1: End of line junk detected: "6"
|
|||
mysqltest: At line 1: End of line junk detected: "6"
|
||||
mysqltest: At line 1: Missing delimiter
|
||||
mysqltest: At line 1: Extra delimiter ";" found
|
||||
mysqltest: At line 1: Extra delimiter ";" found
|
||||
MySQL
|
||||
"MySQL"
|
||||
MySQL: The world''s most popular open source database
|
||||
|
|
|
|||
|
|
@ -369,6 +369,8 @@ select 3 from t1 ;
|
|||
#
|
||||
--error 1
|
||||
--exec echo "--sleep 4;" | $MYSQL_TEST 2>&1
|
||||
--error 1
|
||||
--exec echo "--disable_query_log;" | $MYSQL_TEST 2>&1
|
||||
|
||||
|
||||
# Allow trailing # comment
|
||||
|
|
@ -592,7 +594,7 @@ while ($num)
|
|||
--source var/tmp/sourced1.sql
|
||||
dec $num;
|
||||
}
|
||||
--enable_abort_on_error;
|
||||
--enable_abort_on_error
|
||||
--enable_query_log
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue