mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#2703
"MySQL server does not detect if garbage chara at the end of query" Allow the parser to see the garbage characters. Garbage should cause the parser to report an error. sql/sql_lex.cc: Return END_OF_INPUT when at the end of the input buffer. Allows the parser to determine if there is junk after a \0 character. sql/sql_parse.cc: Undo 1.314.1.1 04/02/11 12:32:42 guilhem@mysql.com sql/sql_prepare.cc: Undo 1.73 04/02/11 12:32:42 guilhem@mysql.com
This commit is contained in:
@@ -886,8 +886,13 @@ int yylex(void *arg, void *yythd)
|
||||
}
|
||||
/* fall true */
|
||||
case MY_LEX_EOL:
|
||||
lex->next_state=MY_LEX_END; // Mark for next loop
|
||||
return(END_OF_INPUT);
|
||||
if (lex->ptr >= lex->end_of_query)
|
||||
{
|
||||
lex->next_state=MY_LEX_END; // Mark for next loop
|
||||
return(END_OF_INPUT);
|
||||
}
|
||||
state=MY_LEX_CHAR;
|
||||
break;
|
||||
case MY_LEX_END:
|
||||
lex->next_state=MY_LEX_END;
|
||||
return(0); // We found end of input last time
|
||||
|
||||
Reference in New Issue
Block a user