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.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 821755d94eb..bb75ebd12a1 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2280,8 +2280,17 @@ int Lex_input_stream::scan_ident_delimited(THD *thd,
uchar c;
DBUG_ASSERT(m_ptr == m_tok_start + 1);
- while ((c= yyGet()))
+ for ( ; ; )
{
+ if (!(c= yyGet()))
+ {
+ /*
+ End-of-query or straight 0x00 inside a delimited identifier.
+ Return the quote character, to have the parser fail on syntax error.
+ */
+ m_ptr= (char *) m_tok_start + 1;
+ return quote_char;
+ }
int var_length= my_charlen(cs, get_ptr() - 1, get_end_of_query());
if (var_length == 1)
{