summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
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