summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_lex.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index ee0e09acbf9..2462f0fea17 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1074,7 +1074,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
state= (enum my_lex_states) state_map[c];
break;
case MY_LEX_ESCAPE:
- if (lip->yyGet() == 'N')
+ if (!lip->eof() && lip->yyGet() == 'N')
{ // Allow \N as shortcut for NULL
yylval->lex_str.str=(char*) "\\N";
yylval->lex_str.length=2;