summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-02-10 19:33:02 +0400
committerunknown <vva@eagle.mysql.r18.ru>2004-02-10 19:33:02 +0400
commit859aedb4466bb8aa6ad821dfd9b34dd6e0daa142 (patch)
tree9d69896a0bf201d847c6ca72a893e3c06683173d /sql
parentdc792940232f3265e21905cb939853f4db5ebd16 (diff)
parente4f3eb79be9dc5da27097f73e9477d9318373105 (diff)
downloadmariadb-git-859aedb4466bb8aa6ad821dfd9b34dd6e0daa142.tar.gz
Merge vvagin@bk-internal.mysql.com:/home/bk/mysql-4.1
into eagle.mysql.r18.ru:/home/vva/work/BUG_2592/mysql-4.1 sql/sql_lex.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_lex.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 65357328927..2484ff0e30f 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -667,13 +667,24 @@ int yylex(void *arg, void *yythd)
case MY_LEX_USER_VARIABLE_DELIMITER:
{
- char delim= c; // Used char
+ uint double_quotes= 0;
+ char quote_char= c; // Used char
lex->tok_start=lex->ptr; // Skip first `
#ifdef USE_MB
if (use_mb(cs))
{
- while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
+ while ((c= yyGet()))
{
+ if (c == quote_char)
+ {
+ if (yyPeek() != quote_char)
+ break;
+ c= yyGet();
+ double_quotes++;
+ continue;
+ }
+ if (c == (uchar) NAMES_SEP_CHAR)
+ break;
if (my_mbcharlen(cs, c) > 1)
{
int l;
@@ -684,13 +695,10 @@ int yylex(void *arg, void *yythd)
lex->ptr += l-1;
}
}
- yylval->lex_str=get_token(lex,yyLength());
}
else
#endif
{
- uint double_quotes= 0;
- char quote_char= c;
while ((c=yyGet()))
{
if (c == quote_char)
@@ -704,13 +712,13 @@ int yylex(void *arg, void *yythd)
if (c == (uchar) NAMES_SEP_CHAR)
break;
}
- if (double_quotes)
- yylval->lex_str=get_quoted_token(lex,yyLength() - double_quotes,
- quote_char);
- else
- yylval->lex_str=get_token(lex,yyLength());
}
- if (c == delim)
+ if (double_quotes)
+ yylval->lex_str=get_quoted_token(lex,yyLength() - double_quotes,
+ quote_char);
+ else
+ yylval->lex_str=get_token(lex,yyLength());
+ if (c == quote_char)
yySkip(); // Skip end `
lex->next_state= MY_LEX_START;
return(IDENT_QUOTED);