1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Detect comment with command using extra delimiter

mysql-test/include/have_lowercase0.inc:
  Remove extra ; at end of command(causing it to be skipped)
mysql-test/r/mysqltest.result:
  Update test results
mysql-test/t/mysqltest.test:
  Add test to detect "comment with command" with extra ; delimiter
  Fix extra ; delimiter
This commit is contained in:
unknown
2005-09-06 12:33:36 +02:00
parent c29a8d4e5b
commit 8bb920586e
4 changed files with 22 additions and 3 deletions

View File

@ -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;
}