summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorvva@eagle.mysql.r18.ru <>2004-02-14 02:26:27 +0400
committervva@eagle.mysql.r18.ru <>2004-02-14 02:26:27 +0400
commit48d4e333286d5d0f0ef26d1d8bd7dfe24c62f3f7 (patch)
treec116b71575b9f3aa209b66a7aff768d2fe647158 /sql/sql_lex.cc
parentd0b456fead3ea73a9b60d2dbc2fd903e8e62508b (diff)
downloadmariadb-git-48d4e333286d5d0f0ef26d1d8bd7dfe24c62f3f7.tar.gz
a little optimization in yylex
(case MY_LEX_USER_VARIABLE_DELIMITER for multichar strings) and my_mbcharlen
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index bd7d0a31546..023415a6794 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -694,10 +694,9 @@ int yylex(void *arg, void *yythd)
char quote_char= c; // Used char
lex->tok_start=lex->ptr; // Skip first `
while ((c=yyGet()))
- {
-#ifdef USE_MB
- if (my_mbcharlen(cs, c) == 1)
-#endif
+ {
+ int l;
+ if ((l= my_mbcharlen(cs, c)) == 1)
{
if (c == (uchar) NAMES_SEP_CHAR)
break; /* Old .frm format can't handle this char */
@@ -711,15 +710,12 @@ int yylex(void *arg, void *yythd)
}
}
#ifdef USE_MB
- else
+ else if (l > 1)
{
- int l;
- if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
- break;
lex->ptr += l-1;
}
+ else
+ break;
#endif
}
if (double_quotes)