summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <acurtis@pcgem.rdg.cyberkinetica.com>2004-02-12 12:01:27 +0000
committerunknown <acurtis@pcgem.rdg.cyberkinetica.com>2004-02-12 12:01:27 +0000
commit1e8dcbe01f463abac7845abe5bbeebb49251a5bd (patch)
treeec2eb864feac25b942c10d7f80650b098dbe1de1 /sql/sql_lex.cc
parentf2753fe9ac04edac1e8b968d29e77178b4e8c0a5 (diff)
downloadmariadb-git-1e8dcbe01f463abac7845abe5bbeebb49251a5bd.tar.gz
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
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 70c69bb7389..90e5b0300f6 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -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