diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-03-20 22:01:03 +0400 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-03-20 22:01:03 +0400 |
commit | 9e5a1ba67e1c4dd918ab357905f1708f1b101e9e (patch) | |
tree | f05e0eb097334e2e34d2d5b5078859a95ebd118c /sql/sql_lex.cc | |
parent | d0ae2c126e699a1c2d21aa046a8ebf2dd5384f25 (diff) | |
download | mariadb-git-9e5a1ba67e1c4dd918ab357905f1708f1b101e9e.tar.gz |
SELECT N'string'
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index da67f5646fc..a5bed692293 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -463,6 +463,26 @@ int yylex(void *arg, void *yythd) lex->tok_start=lex->ptr; // Let tok_start point at next item return((int) c); + case MY_LEX_IDENT_OR_NCHAR: + if (yyPeek() != '\'') + { // Found x'hex-number' + state= MY_LEX_IDENT; + break; + } + yyGet(); // Skip ' + while ((c = yyGet()) && (c !='\'')) ; + length=(lex->ptr - lex->tok_start); // Length of hexnum+3 + if (c != '\'') + { + return(ABORT_SYM); // Illegal hex constant + } + yyGet(); // get_token makes an unget + yylval->lex_str=get_token(lex,length); + yylval->lex_str.str+=2; // Skip x' + yylval->lex_str.length-=3; // Don't count x' and last ' + lex->yytoklen-=3; + return (NCHAR_STRING); + case MY_LEX_IDENT_OR_HEX: if (yyPeek() == '\'') { // Found x'hex-number' |