a little optimization in yylex
(case MY_LEX_USER_VARIABLE_DELIMITER for multichar strings) and my_mbcharlen include/m_ctype.h: a trivial optimization of my_mbcharlen (case !USE_MB) sql/sql_lex.cc: a little optimization in yylex (case MY_LEX_USER_VARIABLE_DELIMITER for multichar strings)
This commit is contained in:
parent
9a3a0d7d40
commit
f05d5c844f
@ -391,7 +391,11 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
|||||||
|
|
||||||
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
||||||
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
||||||
|
#ifdef USE_MB
|
||||||
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
||||||
|
#else
|
||||||
|
#define my_mbcharlen(s, a) 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
|
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
|
||||||
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
|
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
|
||||||
|
@ -695,9 +695,8 @@ int yylex(void *arg, void *yythd)
|
|||||||
lex->tok_start=lex->ptr; // Skip first `
|
lex->tok_start=lex->ptr; // Skip first `
|
||||||
while ((c=yyGet()))
|
while ((c=yyGet()))
|
||||||
{
|
{
|
||||||
#ifdef USE_MB
|
int l;
|
||||||
if (my_mbcharlen(cs, c) == 1)
|
if ((l= my_mbcharlen(cs, c)) == 1)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (c == (uchar) NAMES_SEP_CHAR)
|
if (c == (uchar) NAMES_SEP_CHAR)
|
||||||
break; /* Old .frm format can't handle this char */
|
break; /* Old .frm format can't handle this char */
|
||||||
@ -711,15 +710,12 @@ int yylex(void *arg, void *yythd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef USE_MB
|
#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;
|
lex->ptr += l-1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (double_quotes)
|
if (double_quotes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user