mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/data0/mysqldev/my/mysql-4.1.20-release
into mysql.com:/data0/mysqldev/my/mysql-4.1 sql/sql_lex.cc: Auto merged
This commit is contained in:
@ -295,18 +295,7 @@ static char *get_text(LEX *lex)
|
||||
found_escape=1;
|
||||
if (lex->ptr == lex->end_of_query)
|
||||
return 0;
|
||||
#ifdef USE_MB
|
||||
int l;
|
||||
if (use_mb(cs) &&
|
||||
(l = my_ismbchar(cs,
|
||||
(const char *)lex->ptr,
|
||||
(const char *)lex->end_of_query))) {
|
||||
lex->ptr += l;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
yySkip();
|
||||
yySkip();
|
||||
}
|
||||
else if (c == sep)
|
||||
{
|
||||
@ -335,9 +324,6 @@ static char *get_text(LEX *lex)
|
||||
{
|
||||
uchar *to;
|
||||
|
||||
/* Re-use found_escape for tracking state of escapes */
|
||||
found_escape= 0;
|
||||
|
||||
for (to=start ; str != end ; str++)
|
||||
{
|
||||
#ifdef USE_MB
|
||||
@ -351,7 +337,7 @@ static char *get_text(LEX *lex)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (!found_escape && *str == '\\' && str+1 != end)
|
||||
if (*str == '\\' && str+1 != end)
|
||||
{
|
||||
switch(*++str) {
|
||||
case 'n':
|
||||
@ -377,20 +363,14 @@ static char *get_text(LEX *lex)
|
||||
*to++= '\\'; // remember prefix for wildcard
|
||||
/* Fall through */
|
||||
default:
|
||||
found_escape= 1;
|
||||
str--;
|
||||
*to++= *str;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!found_escape && *str == sep)
|
||||
{
|
||||
found_escape= 1;
|
||||
}
|
||||
else if (*str == sep)
|
||||
*to++= *str++; // Two ' or "
|
||||
else
|
||||
{
|
||||
*to++ = *str;
|
||||
found_escape= 0;
|
||||
}
|
||||
}
|
||||
*to=0;
|
||||
lex->yytoklen=(uint) (to-start);
|
||||
|
Reference in New Issue
Block a user