Merge abarkov@build.mysql.com:/home/bk/mysql-4.1
into bar.mysql.r18.ru:/usr/home/bar/mysql-4.1 sql/sql_lex.h: Auto merged
This commit is contained in:
commit
1aeec73192
@ -74,6 +74,22 @@ typedef struct my_uni_idx_st
|
|||||||
} MY_UNI_IDX;
|
} MY_UNI_IDX;
|
||||||
|
|
||||||
|
|
||||||
|
enum my_lex_states
|
||||||
|
{
|
||||||
|
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT,
|
||||||
|
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START,
|
||||||
|
MY_LEX_FOUND_IDENT, MY_LEX_SIGNED_NUMBER, MY_LEX_REAL, MY_LEX_HEX_NUMBER,
|
||||||
|
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END,
|
||||||
|
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL,
|
||||||
|
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE,
|
||||||
|
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_COLON,
|
||||||
|
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP,
|
||||||
|
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
|
||||||
|
MY_LEX_IDENT_OR_KEYWORD, MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN,
|
||||||
|
MY_LEX_STRING_OR_DELIMITER
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct charset_info_st
|
typedef struct charset_info_st
|
||||||
{
|
{
|
||||||
uint number;
|
uint number;
|
||||||
@ -89,6 +105,8 @@ typedef struct charset_info_st
|
|||||||
uchar *sort_order;
|
uchar *sort_order;
|
||||||
uint16 *tab_to_uni;
|
uint16 *tab_to_uni;
|
||||||
MY_UNI_IDX *tab_from_uni;
|
MY_UNI_IDX *tab_from_uni;
|
||||||
|
uchar state_map[256];
|
||||||
|
uchar ident_map[256];
|
||||||
|
|
||||||
/* Collation routines */
|
/* Collation routines */
|
||||||
uint strxfrm_multiply;
|
uint strxfrm_multiply;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
- Initializing charset related structures
|
- Initializing charset related structures
|
||||||
- Loading dynamic charsets
|
- Loading dynamic charsets
|
||||||
- Searching for a proper CHARSET_INFO
|
- Searching for a proper CHARSET_INFO
|
||||||
using charset name, collation name or collatio ID
|
using charset name, collation name or collation ID
|
||||||
- Setting server default character set
|
- Setting server default character set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -54,6 +54,62 @@ static void set_max_sort_char(CHARSET_INFO *cs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void init_state_maps(CHARSET_INFO *cs)
|
||||||
|
{
|
||||||
|
uint i;
|
||||||
|
uchar *state_map= cs->state_map;
|
||||||
|
uchar *ident_map= cs->ident_map;
|
||||||
|
|
||||||
|
/* Fill state_map with states to get a faster parser */
|
||||||
|
for (i=0; i < 256 ; i++)
|
||||||
|
{
|
||||||
|
if (my_isalpha(cs,i))
|
||||||
|
state_map[i]=(uchar) MY_LEX_IDENT;
|
||||||
|
else if (my_isdigit(cs,i))
|
||||||
|
state_map[i]=(uchar) MY_LEX_NUMBER_IDENT;
|
||||||
|
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||||
|
else if (use_mb(cs) && my_ismbhead(cs, i))
|
||||||
|
state_map[i]=(uchar) MY_LEX_IDENT;
|
||||||
|
#endif
|
||||||
|
else if (!my_isgraph(cs,i))
|
||||||
|
state_map[i]=(uchar) MY_LEX_SKIP;
|
||||||
|
else
|
||||||
|
state_map[i]=(uchar) MY_LEX_CHAR;
|
||||||
|
}
|
||||||
|
state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) MY_LEX_IDENT;
|
||||||
|
state_map[(uchar)'\'']=(uchar) MY_LEX_STRING;
|
||||||
|
state_map[(uchar)'-']=state_map[(uchar)'+']=(uchar) MY_LEX_SIGNED_NUMBER;
|
||||||
|
state_map[(uchar)'.']=(uchar) MY_LEX_REAL_OR_POINT;
|
||||||
|
state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) MY_LEX_CMP_OP;
|
||||||
|
state_map[(uchar)'<']= (uchar) MY_LEX_LONG_CMP_OP;
|
||||||
|
state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) MY_LEX_BOOL;
|
||||||
|
state_map[(uchar)'#']=(uchar) MY_LEX_COMMENT;
|
||||||
|
state_map[(uchar)';']=(uchar) MY_LEX_COLON;
|
||||||
|
state_map[(uchar)':']=(uchar) MY_LEX_SET_VAR;
|
||||||
|
state_map[0]=(uchar) MY_LEX_EOL;
|
||||||
|
state_map[(uchar)'\\']= (uchar) MY_LEX_ESCAPE;
|
||||||
|
state_map[(uchar)'/']= (uchar) MY_LEX_LONG_COMMENT;
|
||||||
|
state_map[(uchar)'*']= (uchar) MY_LEX_END_LONG_COMMENT;
|
||||||
|
state_map[(uchar)'@']= (uchar) MY_LEX_USER_END;
|
||||||
|
state_map[(uchar) '`']= (uchar) MY_LEX_USER_VARIABLE_DELIMITER;
|
||||||
|
state_map[(uchar)'"']= (uchar) MY_LEX_STRING_OR_DELIMITER;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Create a second map to make it faster to find identifiers
|
||||||
|
*/
|
||||||
|
for (i=0; i < 256 ; i++)
|
||||||
|
{
|
||||||
|
ident_map[i]= (uchar) (state_map[i] == MY_LEX_IDENT ||
|
||||||
|
state_map[i] == MY_LEX_NUMBER_IDENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Special handling of hex and binary strings */
|
||||||
|
state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) MY_LEX_IDENT_OR_HEX;
|
||||||
|
state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) MY_LEX_IDENT_OR_BIN;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void simple_cs_init_functions(CHARSET_INFO *cs)
|
static void simple_cs_init_functions(CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -211,8 +267,11 @@ static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from)
|
|||||||
to->name= my_once_strdup(from->name,MYF(MY_WME));
|
to->name= my_once_strdup(from->name,MYF(MY_WME));
|
||||||
|
|
||||||
if (from->ctype)
|
if (from->ctype)
|
||||||
|
{
|
||||||
to->ctype= (uchar*) my_once_memdup((char*) from->ctype,
|
to->ctype= (uchar*) my_once_memdup((char*) from->ctype,
|
||||||
MY_CS_CTYPE_TABLE_SIZE, MYF(MY_WME));
|
MY_CS_CTYPE_TABLE_SIZE, MYF(MY_WME));
|
||||||
|
init_state_maps(to);
|
||||||
|
}
|
||||||
if (from->to_lower)
|
if (from->to_lower)
|
||||||
to->to_lower= (uchar*) my_once_memdup((char*) from->to_lower,
|
to->to_lower= (uchar*) my_once_memdup((char*) from->to_lower,
|
||||||
MY_CS_TO_LOWER_TABLE_SIZE, MYF(MY_WME));
|
MY_CS_TO_LOWER_TABLE_SIZE, MYF(MY_WME));
|
||||||
@ -447,7 +506,10 @@ static my_bool init_available_charsets(myf myflags)
|
|||||||
for (cs=all_charsets; cs < all_charsets+255 ; cs++)
|
for (cs=all_charsets; cs < all_charsets+255 ; cs++)
|
||||||
{
|
{
|
||||||
if (*cs)
|
if (*cs)
|
||||||
|
{
|
||||||
set_max_sort_char(*cs);
|
set_max_sort_char(*cs);
|
||||||
|
init_state_maps(*cs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
|
strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
|
||||||
|
299
sql/sql_lex.cc
299
sql/sql_lex.cc
@ -75,8 +75,6 @@ inline int lex_casecmp(const char *s, const char *t, uint len)
|
|||||||
|
|
||||||
#include "lex_hash.h"
|
#include "lex_hash.h"
|
||||||
|
|
||||||
static uchar state_map[256], ident_map[256];
|
|
||||||
|
|
||||||
|
|
||||||
void lex_init(void)
|
void lex_init(void)
|
||||||
{
|
{
|
||||||
@ -89,53 +87,6 @@ void lex_init(void)
|
|||||||
|
|
||||||
VOID(pthread_key_create(&THR_LEX,NULL));
|
VOID(pthread_key_create(&THR_LEX,NULL));
|
||||||
|
|
||||||
/* Fill state_map with states to get a faster parser */
|
|
||||||
for (i=0; i < sizeof(state_map) ; i++)
|
|
||||||
{
|
|
||||||
if (my_isalpha(system_charset_info,i))
|
|
||||||
state_map[i]=(uchar) STATE_IDENT;
|
|
||||||
else if (my_isdigit(system_charset_info,i))
|
|
||||||
state_map[i]=(uchar) STATE_NUMBER_IDENT;
|
|
||||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
|
||||||
else if (use_mb(system_charset_info) && my_ismbhead(system_charset_info, i))
|
|
||||||
state_map[i]=(uchar) STATE_IDENT;
|
|
||||||
#endif
|
|
||||||
else if (!my_isgraph(system_charset_info,i))
|
|
||||||
state_map[i]=(uchar) STATE_SKIP;
|
|
||||||
else
|
|
||||||
state_map[i]=(uchar) STATE_CHAR;
|
|
||||||
}
|
|
||||||
state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) STATE_IDENT;
|
|
||||||
state_map[(uchar)'\'']=(uchar) STATE_STRING;
|
|
||||||
state_map[(uchar)'-']=state_map[(uchar)'+']=(uchar) STATE_SIGNED_NUMBER;
|
|
||||||
state_map[(uchar)'.']=(uchar) STATE_REAL_OR_POINT;
|
|
||||||
state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) STATE_CMP_OP;
|
|
||||||
state_map[(uchar)'<']= (uchar) STATE_LONG_CMP_OP;
|
|
||||||
state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) STATE_BOOL;
|
|
||||||
state_map[(uchar)'#']=(uchar) STATE_COMMENT;
|
|
||||||
state_map[(uchar)';']=(uchar) STATE_COLON;
|
|
||||||
state_map[(uchar)':']=(uchar) STATE_SET_VAR;
|
|
||||||
state_map[0]=(uchar) STATE_EOL;
|
|
||||||
state_map[(uchar)'\\']= (uchar) STATE_ESCAPE;
|
|
||||||
state_map[(uchar)'/']= (uchar) STATE_LONG_COMMENT;
|
|
||||||
state_map[(uchar)'*']= (uchar) STATE_END_LONG_COMMENT;
|
|
||||||
state_map[(uchar)'@']= (uchar) STATE_USER_END;
|
|
||||||
state_map[(uchar) '`']= (uchar) STATE_USER_VARIABLE_DELIMITER;
|
|
||||||
state_map[(uchar)'"']= (uchar) STAT_STRING_OR_DELIMITER;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Create a second map to make it faster to find identifiers
|
|
||||||
*/
|
|
||||||
for (i=0; i < sizeof(ident_map) ; i++)
|
|
||||||
{
|
|
||||||
ident_map[i]= (uchar) (state_map[i] == STATE_IDENT ||
|
|
||||||
state_map[i] == STATE_NUMBER_IDENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Special handling of hex and binary strings */
|
|
||||||
state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) STATE_IDENT_OR_HEX;
|
|
||||||
state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) STATE_IDENT_OR_BIN;
|
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +107,7 @@ void lex_free(void)
|
|||||||
LEX *lex_start(THD *thd, uchar *buf,uint length)
|
LEX *lex_start(THD *thd, uchar *buf,uint length)
|
||||||
{
|
{
|
||||||
LEX *lex= &thd->lex;
|
LEX *lex= &thd->lex;
|
||||||
lex->next_state=STATE_START;
|
lex->next_state=MY_LEX_START;
|
||||||
lex->end_of_query=(lex->ptr=buf)+length;
|
lex->end_of_query=(lex->ptr=buf)+length;
|
||||||
lex->yylineno = 1;
|
lex->yylineno = 1;
|
||||||
lex->select_lex.create_refs=lex->in_comment=0;
|
lex->select_lex.create_refs=lex->in_comment=0;
|
||||||
@ -458,8 +409,8 @@ inline static uint int_token(const char *str,uint length)
|
|||||||
|
|
||||||
|
|
||||||
// yylex remember the following states from the following yylex()
|
// yylex remember the following states from the following yylex()
|
||||||
// STATE_EOQ ; found end of query
|
// MY_LEX_EOQ ; found end of query
|
||||||
// STATE_OPERATOR_OR_IDENT ; last state was an ident, text or number
|
// MY_LEX_OPERATOR_OR_IDENT ; last state was an ident, text or number
|
||||||
// (which can't be followed by a signed number)
|
// (which can't be followed by a signed number)
|
||||||
|
|
||||||
int yylex(void *arg, void *yythd)
|
int yylex(void *arg, void *yythd)
|
||||||
@ -467,76 +418,79 @@ int yylex(void *arg, void *yythd)
|
|||||||
reg1 uchar c;
|
reg1 uchar c;
|
||||||
int tokval;
|
int tokval;
|
||||||
uint length;
|
uint length;
|
||||||
enum lex_states state,prev_state;
|
enum my_lex_states state,prev_state;
|
||||||
LEX *lex= &(((THD *)yythd)->lex);
|
LEX *lex= &(((THD *)yythd)->lex);
|
||||||
YYSTYPE *yylval=(YYSTYPE*) arg;
|
YYSTYPE *yylval=(YYSTYPE*) arg;
|
||||||
|
CHARSET_INFO *cs= ((THD *) yythd)->variables.thd_charset;
|
||||||
|
uchar *state_map= cs->state_map;
|
||||||
|
uchar *ident_map= cs->ident_map;
|
||||||
|
|
||||||
lex->yylval=yylval; // The global state
|
lex->yylval=yylval; // The global state
|
||||||
lex->tok_start=lex->tok_end=lex->ptr;
|
lex->tok_start=lex->tok_end=lex->ptr;
|
||||||
prev_state=state=lex->next_state;
|
prev_state=state=lex->next_state;
|
||||||
lex->next_state=STATE_OPERATOR_OR_IDENT;
|
lex->next_state=MY_LEX_OPERATOR_OR_IDENT;
|
||||||
LINT_INIT(c);
|
LINT_INIT(c);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case STATE_OPERATOR_OR_IDENT: // Next is operator or keyword
|
case MY_LEX_OPERATOR_OR_IDENT: // Next is operator or keyword
|
||||||
case STATE_START: // Start of token
|
case MY_LEX_START: // Start of token
|
||||||
// Skip startspace
|
// Skip startspace
|
||||||
for (c=yyGet() ; (state_map[c] == STATE_SKIP) ; c= yyGet())
|
for (c=yyGet() ; (state_map[c] == MY_LEX_SKIP) ; c= yyGet())
|
||||||
{
|
{
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
lex->yylineno++;
|
lex->yylineno++;
|
||||||
}
|
}
|
||||||
lex->tok_start=lex->ptr-1; // Start of real token
|
lex->tok_start=lex->ptr-1; // Start of real token
|
||||||
state= (enum lex_states) state_map[c];
|
state= (enum my_lex_states) state_map[c];
|
||||||
break;
|
break;
|
||||||
case STATE_ESCAPE:
|
case MY_LEX_ESCAPE:
|
||||||
if (yyGet() == 'N')
|
if (yyGet() == 'N')
|
||||||
{ // Allow \N as shortcut for NULL
|
{ // Allow \N as shortcut for NULL
|
||||||
yylval->lex_str.str=(char*) "\\N";
|
yylval->lex_str.str=(char*) "\\N";
|
||||||
yylval->lex_str.length=2;
|
yylval->lex_str.length=2;
|
||||||
return NULL_SYM;
|
return NULL_SYM;
|
||||||
}
|
}
|
||||||
case STATE_CHAR: // Unknown or single char token
|
case MY_LEX_CHAR: // Unknown or single char token
|
||||||
case STATE_SKIP: // This should not happen
|
case MY_LEX_SKIP: // This should not happen
|
||||||
yylval->lex_str.str=(char*) (lex->ptr=lex->tok_start);// Set to first chr
|
yylval->lex_str.str=(char*) (lex->ptr=lex->tok_start);// Set to first chr
|
||||||
yylval->lex_str.length=1;
|
yylval->lex_str.length=1;
|
||||||
c=yyGet();
|
c=yyGet();
|
||||||
if (c != ')')
|
if (c != ')')
|
||||||
lex->next_state= STATE_START; // Allow signed numbers
|
lex->next_state= MY_LEX_START; // Allow signed numbers
|
||||||
if (c == ',')
|
if (c == ',')
|
||||||
lex->tok_start=lex->ptr; // Let tok_start point at next item
|
lex->tok_start=lex->ptr; // Let tok_start point at next item
|
||||||
return((int) c);
|
return((int) c);
|
||||||
|
|
||||||
case STATE_IDENT_OR_HEX:
|
case MY_LEX_IDENT_OR_HEX:
|
||||||
if (yyPeek() == '\'')
|
if (yyPeek() == '\'')
|
||||||
{ // Found x'hex-number'
|
{ // Found x'hex-number'
|
||||||
state= STATE_HEX_NUMBER;
|
state= MY_LEX_HEX_NUMBER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
case STATE_IDENT_OR_BIN: // TODO: Add binary string handling
|
case MY_LEX_IDENT_OR_BIN: // TODO: Add binary string handling
|
||||||
case STATE_IDENT:
|
case MY_LEX_IDENT:
|
||||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||||
if (use_mb(system_charset_info))
|
if (use_mb(cs))
|
||||||
{
|
{
|
||||||
if (my_ismbhead(system_charset_info, yyGetLast()))
|
if (my_ismbhead(cs, yyGetLast()))
|
||||||
{
|
{
|
||||||
int l = my_ismbchar(system_charset_info,
|
int l = my_ismbchar(cs,
|
||||||
(const char *)lex->ptr-1,
|
(const char *)lex->ptr-1,
|
||||||
(const char *)lex->end_of_query);
|
(const char *)lex->end_of_query);
|
||||||
if (l == 0) {
|
if (l == 0) {
|
||||||
state = STATE_CHAR;
|
state = MY_LEX_CHAR;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lex->ptr += l - 1;
|
lex->ptr += l - 1;
|
||||||
}
|
}
|
||||||
while (ident_map[c=yyGet()])
|
while (ident_map[c=yyGet()])
|
||||||
{
|
{
|
||||||
if (my_ismbhead(system_charset_info, c))
|
if (my_ismbhead(cs, c))
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
if ((l = my_ismbchar(system_charset_info,
|
if ((l = my_ismbchar(cs,
|
||||||
(const char *)lex->ptr-1,
|
(const char *)lex->ptr-1,
|
||||||
(const char *)lex->end_of_query)) == 0)
|
(const char *)lex->end_of_query)) == 0)
|
||||||
break;
|
break;
|
||||||
@ -550,16 +504,16 @@ int yylex(void *arg, void *yythd)
|
|||||||
length= (uint) (lex->ptr - lex->tok_start)-1;
|
length= (uint) (lex->ptr - lex->tok_start)-1;
|
||||||
if (lex->ignore_space)
|
if (lex->ignore_space)
|
||||||
{
|
{
|
||||||
for (; state_map[c] == STATE_SKIP ; c= yyGet());
|
for (; state_map[c] == MY_LEX_SKIP ; c= yyGet());
|
||||||
}
|
}
|
||||||
if (c == '.' && ident_map[yyPeek()])
|
if (c == '.' && ident_map[yyPeek()])
|
||||||
lex->next_state=STATE_IDENT_SEP;
|
lex->next_state=MY_LEX_IDENT_SEP;
|
||||||
else
|
else
|
||||||
{ // '(' must follow directly if function
|
{ // '(' must follow directly if function
|
||||||
yyUnget();
|
yyUnget();
|
||||||
if ((tokval = find_keyword(lex,length,c == '(')))
|
if ((tokval = find_keyword(lex,length,c == '(')))
|
||||||
{
|
{
|
||||||
lex->next_state= STATE_START; // Allow signed numbers
|
lex->next_state= MY_LEX_START; // Allow signed numbers
|
||||||
return(tokval); // Was keyword
|
return(tokval); // Was keyword
|
||||||
}
|
}
|
||||||
yySkip(); // next state does a unget
|
yySkip(); // next state does a unget
|
||||||
@ -582,30 +536,30 @@ int yylex(void *arg, void *yythd)
|
|||||||
else
|
else
|
||||||
return(IDENT);
|
return(IDENT);
|
||||||
|
|
||||||
case STATE_IDENT_SEP: // Found ident and now '.'
|
case MY_LEX_IDENT_SEP: // Found ident and now '.'
|
||||||
lex->next_state=STATE_IDENT_START;// Next is an ident (not a keyword)
|
lex->next_state=MY_LEX_IDENT_START;// Next is an ident (not a keyword)
|
||||||
yylval->lex_str.str=(char*) lex->ptr;
|
yylval->lex_str.str=(char*) lex->ptr;
|
||||||
yylval->lex_str.length=1;
|
yylval->lex_str.length=1;
|
||||||
c=yyGet(); // should be '.'
|
c=yyGet(); // should be '.'
|
||||||
return((int) c);
|
return((int) c);
|
||||||
|
|
||||||
case STATE_NUMBER_IDENT: // number or ident which num-start
|
case MY_LEX_NUMBER_IDENT: // number or ident which num-start
|
||||||
while (my_isdigit(system_charset_info,(c = yyGet()))) ;
|
while (my_isdigit(cs,(c = yyGet()))) ;
|
||||||
if (!ident_map[c])
|
if (!ident_map[c])
|
||||||
{ // Can't be identifier
|
{ // Can't be identifier
|
||||||
state=STATE_INT_OR_REAL;
|
state=MY_LEX_INT_OR_REAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (c == 'e' || c == 'E')
|
if (c == 'e' || c == 'E')
|
||||||
{
|
{
|
||||||
// The following test is written this way to allow numbers of type 1e1
|
// The following test is written this way to allow numbers of type 1e1
|
||||||
if (my_isdigit(system_charset_info,yyPeek()) ||
|
if (my_isdigit(cs,yyPeek()) ||
|
||||||
(c=(yyGet())) == '+' || c == '-')
|
(c=(yyGet())) == '+' || c == '-')
|
||||||
{ // Allow 1E+10
|
{ // Allow 1E+10
|
||||||
if (my_isdigit(system_charset_info,yyPeek())) // Number must have digit after sign
|
if (my_isdigit(cs,yyPeek())) // Number must have digit after sign
|
||||||
{
|
{
|
||||||
yySkip();
|
yySkip();
|
||||||
while (my_isdigit(system_charset_info,yyGet())) ;
|
while (my_isdigit(cs,yyGet())) ;
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
return(FLOAT_NUM);
|
return(FLOAT_NUM);
|
||||||
}
|
}
|
||||||
@ -615,7 +569,7 @@ int yylex(void *arg, void *yythd)
|
|||||||
else if (c == 'x' && (lex->ptr - lex->tok_start) == 2 &&
|
else if (c == 'x' && (lex->ptr - lex->tok_start) == 2 &&
|
||||||
lex->tok_start[0] == '0' )
|
lex->tok_start[0] == '0' )
|
||||||
{ // Varbinary
|
{ // Varbinary
|
||||||
while (my_isxdigit(system_charset_info,(c = yyGet()))) ;
|
while (my_isxdigit(cs,(c = yyGet()))) ;
|
||||||
if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
|
if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c])
|
||||||
{
|
{
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
@ -627,28 +581,28 @@ int yylex(void *arg, void *yythd)
|
|||||||
yyUnget();
|
yyUnget();
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case STATE_IDENT_START: // Incomplete ident
|
case MY_LEX_IDENT_START: // Incomplete ident
|
||||||
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
#if defined(USE_MB) && defined(USE_MB_IDENT)
|
||||||
if (use_mb(system_charset_info))
|
if (use_mb(cs))
|
||||||
{
|
{
|
||||||
if (my_ismbhead(system_charset_info, yyGetLast()))
|
if (my_ismbhead(cs, yyGetLast()))
|
||||||
{
|
{
|
||||||
int l = my_ismbchar(system_charset_info,
|
int l = my_ismbchar(cs,
|
||||||
(const char *)lex->ptr-1,
|
(const char *)lex->ptr-1,
|
||||||
(const char *)lex->end_of_query);
|
(const char *)lex->end_of_query);
|
||||||
if (l == 0)
|
if (l == 0)
|
||||||
{
|
{
|
||||||
state = STATE_CHAR;
|
state = MY_LEX_CHAR;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
lex->ptr += l - 1;
|
lex->ptr += l - 1;
|
||||||
}
|
}
|
||||||
while (ident_map[c=yyGet()])
|
while (ident_map[c=yyGet()])
|
||||||
{
|
{
|
||||||
if (my_ismbhead(system_charset_info, c))
|
if (my_ismbhead(cs, c))
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
if ((l = my_ismbchar(system_charset_info,
|
if ((l = my_ismbchar(cs,
|
||||||
(const char *)lex->ptr-1,
|
(const char *)lex->ptr-1,
|
||||||
(const char *)lex->end_of_query)) == 0)
|
(const char *)lex->end_of_query)) == 0)
|
||||||
break;
|
break;
|
||||||
@ -661,28 +615,28 @@ int yylex(void *arg, void *yythd)
|
|||||||
while (ident_map[c = yyGet()]) ;
|
while (ident_map[c = yyGet()]) ;
|
||||||
|
|
||||||
if (c == '.' && ident_map[yyPeek()])
|
if (c == '.' && ident_map[yyPeek()])
|
||||||
lex->next_state=STATE_IDENT_SEP;// Next is '.'
|
lex->next_state=MY_LEX_IDENT_SEP;// Next is '.'
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case STATE_FOUND_IDENT: // Complete ident
|
case MY_LEX_FOUND_IDENT: // Complete ident
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
if (lex->convert_set)
|
if (lex->convert_set)
|
||||||
lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
|
lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
|
||||||
return(IDENT);
|
return(IDENT);
|
||||||
|
|
||||||
case STATE_USER_VARIABLE_DELIMITER:
|
case MY_LEX_USER_VARIABLE_DELIMITER:
|
||||||
{
|
{
|
||||||
char delim= c; // Used char
|
char delim= c; // Used char
|
||||||
lex->tok_start=lex->ptr; // Skip first `
|
lex->tok_start=lex->ptr; // Skip first `
|
||||||
#ifdef USE_MB
|
#ifdef USE_MB
|
||||||
if (use_mb(system_charset_info))
|
if (use_mb(cs))
|
||||||
{
|
{
|
||||||
while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
|
while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
|
||||||
{
|
{
|
||||||
if (my_ismbhead(system_charset_info, c))
|
if (my_ismbhead(cs, c))
|
||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
if ((l = my_ismbchar(system_charset_info,
|
if ((l = my_ismbchar(cs,
|
||||||
(const char *)lex->ptr-1,
|
(const char *)lex->ptr-1,
|
||||||
(const char *)lex->end_of_query)) == 0)
|
(const char *)lex->end_of_query)) == 0)
|
||||||
break;
|
break;
|
||||||
@ -721,67 +675,67 @@ int yylex(void *arg, void *yythd)
|
|||||||
yySkip(); // Skip end `
|
yySkip(); // Skip end `
|
||||||
return(IDENT);
|
return(IDENT);
|
||||||
}
|
}
|
||||||
case STATE_SIGNED_NUMBER: // Incomplete signed number
|
case MY_LEX_SIGNED_NUMBER: // Incomplete signed number
|
||||||
if (prev_state == STATE_OPERATOR_OR_IDENT)
|
if (prev_state == MY_LEX_OPERATOR_OR_IDENT)
|
||||||
{
|
{
|
||||||
if (c == '-' && yyPeek() == '-' &&
|
if (c == '-' && yyPeek() == '-' &&
|
||||||
(my_isspace(system_charset_info,yyPeek2()) ||
|
(my_isspace(cs,yyPeek2()) ||
|
||||||
my_iscntrl(system_charset_info,yyPeek2())))
|
my_iscntrl(cs,yyPeek2())))
|
||||||
state=STATE_COMMENT;
|
state=MY_LEX_COMMENT;
|
||||||
else
|
else
|
||||||
state= STATE_CHAR; // Must be operator
|
state= MY_LEX_CHAR; // Must be operator
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!my_isdigit(system_charset_info,c=yyGet()) || yyPeek() == 'x')
|
if (!my_isdigit(cs,c=yyGet()) || yyPeek() == 'x')
|
||||||
{
|
{
|
||||||
if (c != '.')
|
if (c != '.')
|
||||||
{
|
{
|
||||||
if (c == '-' && my_isspace(system_charset_info,yyPeek()))
|
if (c == '-' && my_isspace(cs,yyPeek()))
|
||||||
state=STATE_COMMENT;
|
state=MY_LEX_COMMENT;
|
||||||
else
|
else
|
||||||
state = STATE_CHAR; // Return sign as single char
|
state = MY_LEX_CHAR; // Return sign as single char
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yyUnget(); // Fix for next loop
|
yyUnget(); // Fix for next loop
|
||||||
}
|
}
|
||||||
while (my_isdigit(system_charset_info,c=yyGet())) ; // Incomplete real or int number
|
while (my_isdigit(cs,c=yyGet())) ; // Incomplete real or int number
|
||||||
if ((c == 'e' || c == 'E') &&
|
if ((c == 'e' || c == 'E') &&
|
||||||
(yyPeek() == '+' || yyPeek() == '-' || my_isdigit(system_charset_info,yyPeek())))
|
(yyPeek() == '+' || yyPeek() == '-' || my_isdigit(cs,yyPeek())))
|
||||||
{ // Real number
|
{ // Real number
|
||||||
yyUnget();
|
yyUnget();
|
||||||
c= '.'; // Fool next test
|
c= '.'; // Fool next test
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case STATE_INT_OR_REAL: // Compleat int or incompleat real
|
case MY_LEX_INT_OR_REAL: // Compleat int or incompleat real
|
||||||
if (c != '.')
|
if (c != '.')
|
||||||
{ // Found complete integer number.
|
{ // Found complete integer number.
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
return int_token(yylval->lex_str.str,yylval->lex_str.length);
|
return int_token(yylval->lex_str.str,yylval->lex_str.length);
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case STATE_REAL: // Incomplete real number
|
case MY_LEX_REAL: // Incomplete real number
|
||||||
while (my_isdigit(system_charset_info,c = yyGet())) ;
|
while (my_isdigit(cs,c = yyGet())) ;
|
||||||
|
|
||||||
if (c == 'e' || c == 'E')
|
if (c == 'e' || c == 'E')
|
||||||
{
|
{
|
||||||
c = yyGet();
|
c = yyGet();
|
||||||
if (c == '-' || c == '+')
|
if (c == '-' || c == '+')
|
||||||
c = yyGet(); // Skip sign
|
c = yyGet(); // Skip sign
|
||||||
if (!my_isdigit(system_charset_info,c))
|
if (!my_isdigit(cs,c))
|
||||||
{ // No digit after sign
|
{ // No digit after sign
|
||||||
state= STATE_CHAR;
|
state= MY_LEX_CHAR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (my_isdigit(system_charset_info,yyGet())) ;
|
while (my_isdigit(cs,yyGet())) ;
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
return(FLOAT_NUM);
|
return(FLOAT_NUM);
|
||||||
}
|
}
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
return(REAL_NUM);
|
return(REAL_NUM);
|
||||||
|
|
||||||
case STATE_HEX_NUMBER: // Found x'hexstring'
|
case MY_LEX_HEX_NUMBER: // Found x'hexstring'
|
||||||
yyGet(); // Skip '
|
yyGet(); // Skip '
|
||||||
while (my_isxdigit(system_charset_info,(c = yyGet()))) ;
|
while (my_isxdigit(cs,(c = yyGet()))) ;
|
||||||
length=(lex->ptr - lex->tok_start); // Length of hexnum+3
|
length=(lex->ptr - lex->tok_start); // Length of hexnum+3
|
||||||
if (!(length & 1) || c != '\'')
|
if (!(length & 1) || c != '\'')
|
||||||
{
|
{
|
||||||
@ -794,56 +748,56 @@ int yylex(void *arg, void *yythd)
|
|||||||
lex->yytoklen-=3;
|
lex->yytoklen-=3;
|
||||||
return (HEX_NUM);
|
return (HEX_NUM);
|
||||||
|
|
||||||
case STATE_CMP_OP: // Incomplete comparison operator
|
case MY_LEX_CMP_OP: // Incomplete comparison operator
|
||||||
if (state_map[yyPeek()] == STATE_CMP_OP ||
|
if (state_map[yyPeek()] == MY_LEX_CMP_OP ||
|
||||||
state_map[yyPeek()] == STATE_LONG_CMP_OP)
|
state_map[yyPeek()] == MY_LEX_LONG_CMP_OP)
|
||||||
yySkip();
|
yySkip();
|
||||||
if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
|
if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
|
||||||
{
|
{
|
||||||
lex->next_state= STATE_START; // Allow signed numbers
|
lex->next_state= MY_LEX_START; // Allow signed numbers
|
||||||
return(tokval);
|
return(tokval);
|
||||||
}
|
}
|
||||||
state = STATE_CHAR; // Something fishy found
|
state = MY_LEX_CHAR; // Something fishy found
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_LONG_CMP_OP: // Incomplete comparison operator
|
case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator
|
||||||
if (state_map[yyPeek()] == STATE_CMP_OP ||
|
if (state_map[yyPeek()] == MY_LEX_CMP_OP ||
|
||||||
state_map[yyPeek()] == STATE_LONG_CMP_OP)
|
state_map[yyPeek()] == MY_LEX_LONG_CMP_OP)
|
||||||
{
|
{
|
||||||
yySkip();
|
yySkip();
|
||||||
if (state_map[yyPeek()] == STATE_CMP_OP)
|
if (state_map[yyPeek()] == MY_LEX_CMP_OP)
|
||||||
yySkip();
|
yySkip();
|
||||||
}
|
}
|
||||||
if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
|
if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0)))
|
||||||
{
|
{
|
||||||
lex->next_state= STATE_START; // Found long op
|
lex->next_state= MY_LEX_START; // Found long op
|
||||||
return(tokval);
|
return(tokval);
|
||||||
}
|
}
|
||||||
state = STATE_CHAR; // Something fishy found
|
state = MY_LEX_CHAR; // Something fishy found
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_BOOL:
|
case MY_LEX_BOOL:
|
||||||
if (c != yyPeek())
|
if (c != yyPeek())
|
||||||
{
|
{
|
||||||
state=STATE_CHAR;
|
state=MY_LEX_CHAR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yySkip();
|
yySkip();
|
||||||
tokval = find_keyword(lex,2,0); // Is a bool operator
|
tokval = find_keyword(lex,2,0); // Is a bool operator
|
||||||
lex->next_state= STATE_START; // Allow signed numbers
|
lex->next_state= MY_LEX_START; // Allow signed numbers
|
||||||
return(tokval);
|
return(tokval);
|
||||||
|
|
||||||
case STAT_STRING_OR_DELIMITER:
|
case MY_LEX_STRING_OR_DELIMITER:
|
||||||
if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES)
|
if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES)
|
||||||
{
|
{
|
||||||
state= STATE_USER_VARIABLE_DELIMITER;
|
state= MY_LEX_USER_VARIABLE_DELIMITER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* " used for strings */
|
/* " used for strings */
|
||||||
case STATE_STRING: // Incomplete text string
|
case MY_LEX_STRING: // Incomplete text string
|
||||||
if (!(yylval->lex_str.str = get_text(lex)))
|
if (!(yylval->lex_str.str = get_text(lex)))
|
||||||
{
|
{
|
||||||
state= STATE_CHAR; // Read char by char
|
state= MY_LEX_CHAR; // Read char by char
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yylval->lex_str.length=lex->yytoklen;
|
yylval->lex_str.length=lex->yytoklen;
|
||||||
@ -851,16 +805,16 @@ int yylex(void *arg, void *yythd)
|
|||||||
lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
|
lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
|
||||||
return(TEXT_STRING);
|
return(TEXT_STRING);
|
||||||
|
|
||||||
case STATE_COMMENT: // Comment
|
case MY_LEX_COMMENT: // Comment
|
||||||
lex->select_lex.options|= OPTION_FOUND_COMMENT;
|
lex->select_lex.options|= OPTION_FOUND_COMMENT;
|
||||||
while ((c = yyGet()) != '\n' && c) ;
|
while ((c = yyGet()) != '\n' && c) ;
|
||||||
yyUnget(); // Safety against eof
|
yyUnget(); // Safety against eof
|
||||||
state = STATE_START; // Try again
|
state = MY_LEX_START; // Try again
|
||||||
break;
|
break;
|
||||||
case STATE_LONG_COMMENT: /* Long C comment? */
|
case MY_LEX_LONG_COMMENT: /* Long C comment? */
|
||||||
if (yyPeek() != '*')
|
if (yyPeek() != '*')
|
||||||
{
|
{
|
||||||
state=STATE_CHAR; // Probable division
|
state=MY_LEX_CHAR; // Probable division
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yySkip(); // Skip '*'
|
yySkip(); // Skip '*'
|
||||||
@ -869,8 +823,8 @@ int yylex(void *arg, void *yythd)
|
|||||||
{
|
{
|
||||||
ulong version=MYSQL_VERSION_ID;
|
ulong version=MYSQL_VERSION_ID;
|
||||||
yySkip();
|
yySkip();
|
||||||
state=STATE_START;
|
state=MY_LEX_START;
|
||||||
if (my_isdigit(system_charset_info,yyPeek()))
|
if (my_isdigit(cs,yyPeek()))
|
||||||
{ // Version number
|
{ // Version number
|
||||||
version=strtol((char*) lex->ptr,(char**) &lex->ptr,10);
|
version=strtol((char*) lex->ptr,(char**) &lex->ptr,10);
|
||||||
}
|
}
|
||||||
@ -888,88 +842,87 @@ int yylex(void *arg, void *yythd)
|
|||||||
}
|
}
|
||||||
if (lex->ptr != lex->end_of_query)
|
if (lex->ptr != lex->end_of_query)
|
||||||
yySkip(); // remove last '/'
|
yySkip(); // remove last '/'
|
||||||
state = STATE_START; // Try again
|
state = MY_LEX_START; // Try again
|
||||||
break;
|
break;
|
||||||
case STATE_END_LONG_COMMENT:
|
case MY_LEX_END_LONG_COMMENT:
|
||||||
if (lex->in_comment && yyPeek() == '/')
|
if (lex->in_comment && yyPeek() == '/')
|
||||||
{
|
{
|
||||||
yySkip();
|
yySkip();
|
||||||
lex->in_comment=0;
|
lex->in_comment=0;
|
||||||
state=STATE_START;
|
state=MY_LEX_START;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
state=STATE_CHAR; // Return '*'
|
state=MY_LEX_CHAR; // Return '*'
|
||||||
break;
|
break;
|
||||||
case STATE_SET_VAR: // Check if ':='
|
case MY_LEX_SET_VAR: // Check if ':='
|
||||||
if (yyPeek() != '=')
|
if (yyPeek() != '=')
|
||||||
{
|
{
|
||||||
state=STATE_CHAR; // Return ':'
|
state=MY_LEX_CHAR; // Return ':'
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yySkip();
|
yySkip();
|
||||||
return (SET_VAR);
|
return (SET_VAR);
|
||||||
case STATE_COLON: // optional line terminator
|
case MY_LEX_COLON: // optional line terminator
|
||||||
if (yyPeek())
|
if (yyPeek())
|
||||||
{
|
{
|
||||||
if (((THD *)yythd)->client_capabilities & CLIENT_MULTI_QUERIES)
|
if (((THD *)yythd)->client_capabilities & CLIENT_MULTI_QUERIES)
|
||||||
{
|
{
|
||||||
lex->found_colon=(char*)lex->ptr;
|
lex->found_colon=(char*)lex->ptr;
|
||||||
((THD *)yythd)->server_status |= SERVER_MORE_RESULTS_EXISTS;
|
((THD *)yythd)->server_status |= SERVER_MORE_RESULTS_EXISTS;
|
||||||
lex->next_state=STATE_END;
|
lex->next_state=MY_LEX_END;
|
||||||
return(END_OF_INPUT);
|
return(END_OF_INPUT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
state=STATE_CHAR; // Return ';'
|
state=MY_LEX_CHAR; // Return ';'
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* fall true */
|
/* fall true */
|
||||||
case STATE_EOL:
|
case MY_LEX_EOL:
|
||||||
lex->next_state=STATE_END; // Mark for next loop
|
lex->next_state=MY_LEX_END; // Mark for next loop
|
||||||
return(END_OF_INPUT);
|
return(END_OF_INPUT);
|
||||||
case STATE_END:
|
case MY_LEX_END:
|
||||||
lex->next_state=STATE_END;
|
lex->next_state=MY_LEX_END;
|
||||||
return(0); // We found end of input last time
|
return(0); // We found end of input last time
|
||||||
|
|
||||||
/* Actually real shouldn't start with . but allow them anyhow */
|
/* Actually real shouldn't start with . but allow them anyhow */
|
||||||
case STATE_REAL_OR_POINT:
|
case MY_LEX_REAL_OR_POINT:
|
||||||
if (my_isdigit(system_charset_info,yyPeek()))
|
if (my_isdigit(cs,yyPeek()))
|
||||||
state = STATE_REAL; // Real
|
state = MY_LEX_REAL; // Real
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
state = STATE_CHAR; // return '.'
|
state = MY_LEX_CHAR; // return '.'
|
||||||
lex->next_state=STATE_IDENT_START;// Next is an ident (not a keyword)
|
lex->next_state=MY_LEX_IDENT_START;// Next is an ident (not a keyword)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATE_USER_END: // end '@' of user@hostname
|
case MY_LEX_USER_END: // end '@' of user@hostname
|
||||||
switch (state_map[yyPeek()]) {
|
switch (state_map[yyPeek()]) {
|
||||||
case STATE_STRING:
|
case MY_LEX_STRING:
|
||||||
case STATE_USER_VARIABLE_DELIMITER:
|
case MY_LEX_USER_VARIABLE_DELIMITER:
|
||||||
case STAT_STRING_OR_DELIMITER:
|
case MY_LEX_STRING_OR_DELIMITER:
|
||||||
break;
|
break;
|
||||||
case STATE_USER_END:
|
case MY_LEX_USER_END:
|
||||||
lex->next_state=STATE_SYSTEM_VAR;
|
lex->next_state=MY_LEX_SYSTEM_VAR;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
lex->next_state=STATE_HOSTNAME;
|
lex->next_state=MY_LEX_HOSTNAME;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yylval->lex_str.str=(char*) lex->ptr;
|
yylval->lex_str.str=(char*) lex->ptr;
|
||||||
yylval->lex_str.length=1;
|
yylval->lex_str.length=1;
|
||||||
return((int) '@');
|
return((int) '@');
|
||||||
case STATE_HOSTNAME: // end '@' of user@hostname
|
case MY_LEX_HOSTNAME: // end '@' of user@hostname
|
||||||
for (c=yyGet() ;
|
for (c=yyGet() ;
|
||||||
my_isalnum(system_charset_info,c) || c == '.' || c == '_' ||
|
my_isalnum(cs,c) || c == '.' || c == '_' || c == '$';
|
||||||
c == '$';
|
|
||||||
c= yyGet()) ;
|
c= yyGet()) ;
|
||||||
yylval->lex_str=get_token(lex,yyLength());
|
yylval->lex_str=get_token(lex,yyLength());
|
||||||
return(LEX_HOSTNAME);
|
return(LEX_HOSTNAME);
|
||||||
case STATE_SYSTEM_VAR:
|
case MY_LEX_SYSTEM_VAR:
|
||||||
yylval->lex_str.str=(char*) lex->ptr;
|
yylval->lex_str.str=(char*) lex->ptr;
|
||||||
yylval->lex_str.length=1;
|
yylval->lex_str.length=1;
|
||||||
lex->next_state=STATE_IDENT_OR_KEYWORD;
|
lex->next_state=MY_LEX_IDENT_OR_KEYWORD;
|
||||||
yySkip(); // Skip '@'
|
yySkip(); // Skip '@'
|
||||||
return((int) '@');
|
return((int) '@');
|
||||||
case STATE_IDENT_OR_KEYWORD:
|
case MY_LEX_IDENT_OR_KEYWORD:
|
||||||
/*
|
/*
|
||||||
We come here when we have found two '@' in a row.
|
We come here when we have found two '@' in a row.
|
||||||
We should now be able to handle:
|
We should now be able to handle:
|
||||||
@ -978,7 +931,7 @@ int yylex(void *arg, void *yythd)
|
|||||||
|
|
||||||
while (ident_map[c=yyGet()]) ;
|
while (ident_map[c=yyGet()]) ;
|
||||||
if (c == '.')
|
if (c == '.')
|
||||||
lex->next_state=STATE_IDENT_SEP;
|
lex->next_state=MY_LEX_IDENT_SEP;
|
||||||
length= (uint) (lex->ptr - lex->tok_start)-1;
|
length= (uint) (lex->ptr - lex->tok_start)-1;
|
||||||
if ((tokval= find_keyword(lex,length,0)))
|
if ((tokval= find_keyword(lex,length,0)))
|
||||||
{
|
{
|
||||||
|
@ -77,19 +77,6 @@ enum enum_sql_command {
|
|||||||
SQLCOM_END
|
SQLCOM_END
|
||||||
};
|
};
|
||||||
|
|
||||||
enum lex_states
|
|
||||||
{
|
|
||||||
STATE_START, STATE_CHAR, STATE_IDENT, STATE_IDENT_SEP, STATE_IDENT_START,
|
|
||||||
STATE_FOUND_IDENT, STATE_SIGNED_NUMBER, STATE_REAL, STATE_HEX_NUMBER,
|
|
||||||
STATE_CMP_OP, STATE_LONG_CMP_OP, STATE_STRING, STATE_COMMENT, STATE_END,
|
|
||||||
STATE_OPERATOR_OR_IDENT, STATE_NUMBER_IDENT, STATE_INT_OR_REAL,
|
|
||||||
STATE_REAL_OR_POINT, STATE_BOOL, STATE_EOL, STATE_ESCAPE, STATE_LONG_COMMENT,
|
|
||||||
STATE_END_LONG_COMMENT, STATE_COLON, STATE_SET_VAR, STATE_USER_END,
|
|
||||||
STATE_HOSTNAME, STATE_SKIP, STATE_USER_VARIABLE_DELIMITER, STATE_SYSTEM_VAR,
|
|
||||||
STATE_IDENT_OR_KEYWORD, STATE_IDENT_OR_HEX, STATE_IDENT_OR_BIN,
|
|
||||||
STAT_STRING_OR_DELIMITER
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef List<Item> List_item;
|
typedef List<Item> List_item;
|
||||||
|
|
||||||
@ -474,7 +461,7 @@ typedef struct st_lex
|
|||||||
ulong thread_id,type;
|
ulong thread_id,type;
|
||||||
enum_sql_command sql_command;
|
enum_sql_command sql_command;
|
||||||
thr_lock_type lock_option;
|
thr_lock_type lock_option;
|
||||||
enum lex_states next_state;
|
enum my_lex_states next_state;
|
||||||
enum enum_duplicates duplicates;
|
enum enum_duplicates duplicates;
|
||||||
enum enum_tx_isolation tx_isolation;
|
enum enum_tx_isolation tx_isolation;
|
||||||
enum enum_ha_read_modes ha_read_mode;
|
enum enum_ha_read_modes ha_read_mode;
|
||||||
|
@ -3867,7 +3867,7 @@ literal:
|
|||||||
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
|
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
|
||||||
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
|
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
|
||||||
| NULL_SYM { $$ = new Item_null();
|
| NULL_SYM { $$ = new Item_null();
|
||||||
Lex->next_state=STATE_OPERATOR_OR_IDENT;}
|
Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;}
|
||||||
| HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);}
|
| HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);}
|
||||||
| DATE_SYM text_literal { $$ = $2; }
|
| DATE_SYM text_literal { $$ = $2; }
|
||||||
| TIME_SYM text_literal { $$ = $2; }
|
| TIME_SYM text_literal { $$ = $2; }
|
||||||
@ -3964,8 +3964,8 @@ ident:
|
|||||||
LEX *lex= Lex;
|
LEX *lex= Lex;
|
||||||
$$.str= lex->thd->strmake($1.str,$1.length);
|
$$.str= lex->thd->strmake($1.str,$1.length);
|
||||||
$$.length=$1.length;
|
$$.length=$1.length;
|
||||||
if (lex->next_state != STATE_END)
|
if (lex->next_state != MY_LEX_END)
|
||||||
lex->next_state=STATE_OPERATOR_OR_IDENT;
|
lex->next_state= MY_LEX_OPERATOR_OR_IDENT;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -6244,6 +6244,7 @@ CHARSET_INFO my_charset_big5 =
|
|||||||
sort_order_big5,
|
sort_order_big5,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_big5,
|
my_strnncoll_big5,
|
||||||
my_strnncollsp_big5,
|
my_strnncollsp_big5,
|
||||||
|
@ -306,6 +306,7 @@ CHARSET_INFO my_charset_bin =
|
|||||||
bin_char_array, /* sort_order */
|
bin_char_array, /* sort_order */
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_binary, /* strnncoll */
|
my_strnncoll_binary, /* strnncoll */
|
||||||
my_strnncoll_binary,
|
my_strnncoll_binary,
|
||||||
|
@ -618,6 +618,7 @@ CHARSET_INFO my_charset_czech =
|
|||||||
sort_order_czech,
|
sort_order_czech,
|
||||||
tab_8859_2_uni, /* tab_to_uni */
|
tab_8859_2_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_2, /* tab_from_uni */
|
idx_uni_8859_2, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
4, /* strxfrm_multiply */
|
4, /* strxfrm_multiply */
|
||||||
my_strnncoll_czech,
|
my_strnncoll_czech,
|
||||||
my_strnncollsp_czech,
|
my_strnncollsp_czech,
|
||||||
|
@ -8652,6 +8652,7 @@ CHARSET_INFO my_charset_euc_kr =
|
|||||||
sort_order_euc_kr,
|
sort_order_euc_kr,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,
|
my_strnncollsp_simple,
|
||||||
|
@ -2818,6 +2818,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_latin1,
|
sort_order_latin1,
|
||||||
tab_8859_1_uni, /* tab_to_uni */
|
tab_8859_1_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_1, /* tab_from_uni */
|
idx_uni_8859_1, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -2869,6 +2870,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_cp1251,
|
sort_order_cp1251,
|
||||||
tab_cp1251_uni, /* tab_to_uni */
|
tab_cp1251_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1251, /* tab_from_uni */
|
idx_uni_cp1251, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -2919,6 +2921,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_cp1257,
|
sort_order_cp1257,
|
||||||
tab_cp1257_uni, /* tab_to_uni */
|
tab_cp1257_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1257, /* tab_from_uni */
|
idx_uni_cp1257, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -2969,6 +2972,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_croat,
|
sort_order_croat,
|
||||||
tab_8859_2_uni, /* tab_to_uni */
|
tab_8859_2_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_2, /* tab_from_uni */
|
idx_uni_8859_2, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3020,6 +3024,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_danish,
|
sort_order_danish,
|
||||||
tab_8859_1_uni, /* tab_to_uni */
|
tab_8859_1_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_1, /* tab_from_uni */
|
idx_uni_8859_1, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3070,6 +3075,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_dec8,
|
sort_order_dec8,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3120,6 +3126,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_dos,
|
sort_order_dos,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3170,6 +3177,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_estonia,
|
sort_order_estonia,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3221,6 +3229,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_german1,
|
sort_order_german1,
|
||||||
tab_8859_1_uni, /* tab_to_uni */
|
tab_8859_1_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_1, /* tab_from_uni */
|
idx_uni_8859_1, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3271,6 +3280,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_greek,
|
sort_order_greek,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3321,6 +3331,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_hebrew,
|
sort_order_hebrew,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3371,6 +3382,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_hp8,
|
sort_order_hp8,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3421,6 +3433,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_hungarian,
|
sort_order_hungarian,
|
||||||
tab_8859_2_uni, /* tab_to_uni */
|
tab_8859_2_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_2, /* tab_from_uni */
|
idx_uni_8859_2, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3471,6 +3484,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_koi8_ru,
|
sort_order_koi8_ru,
|
||||||
tab_koi8_r_uni, /* tab_to_uni */
|
tab_koi8_r_uni, /* tab_to_uni */
|
||||||
idx_uni_koi8_r, /* tab_from_uni */
|
idx_uni_koi8_r, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3521,6 +3535,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_koi8_ukr,
|
sort_order_koi8_ukr,
|
||||||
tab_koi8_u_uni, /* tab_to_uni */
|
tab_koi8_u_uni, /* tab_to_uni */
|
||||||
idx_uni_koi8_u, /* tab_from_uni */
|
idx_uni_koi8_u, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3572,6 +3587,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_latin2,
|
sort_order_latin2,
|
||||||
tab_8859_2_uni, /* tab_to_uni */
|
tab_8859_2_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_2, /* tab_from_uni */
|
idx_uni_8859_2, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3622,6 +3638,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_latin5,
|
sort_order_latin5,
|
||||||
tab_8859_9_uni, /* tab_to_uni */
|
tab_8859_9_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_9, /* tab_from_uni */
|
idx_uni_8859_9, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3673,6 +3690,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_swe7,
|
sort_order_swe7,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3724,6 +3742,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_usa7,
|
sort_order_usa7,
|
||||||
tab_us_ascii_uni, /* tab_to_uni */
|
tab_us_ascii_uni, /* tab_to_uni */
|
||||||
idx_uni_us_ascii, /* tab_from_uni */
|
idx_uni_us_ascii, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3774,6 +3793,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_win1250,
|
sort_order_win1250,
|
||||||
tab_cp1250_uni, /* tab_to_uni */
|
tab_cp1250_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1250, /* tab_from_uni */
|
idx_uni_cp1250, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3824,6 +3844,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_win1251ukr,
|
sort_order_win1251ukr,
|
||||||
tab_cp1251_uni, /* tab_to_uni */
|
tab_cp1251_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1251, /* tab_from_uni */
|
idx_uni_cp1251, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3874,6 +3895,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_armscii8,
|
sort_order_armscii8,
|
||||||
tab_armscii_8_uni, /* tab_to_uni */
|
tab_armscii_8_uni, /* tab_to_uni */
|
||||||
idx_uni_armscii_8, /* tab_from_uni */
|
idx_uni_armscii_8, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3924,6 +3946,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
sort_order_win1251,
|
sort_order_win1251,
|
||||||
tab_cp1251_uni, /* tab_to_uni */
|
tab_cp1251_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1251, /* tab_from_uni */
|
idx_uni_cp1251, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,/* strnncollsp */
|
my_strnncollsp_simple,/* strnncollsp */
|
||||||
@ -3973,6 +3996,7 @@ CHARSET_INFO compiled_charsets[] = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0,
|
0,
|
||||||
NULL, /* strnncoll */
|
NULL, /* strnncoll */
|
||||||
NULL, /* strnncollsp */
|
NULL, /* strnncollsp */
|
||||||
|
@ -5702,6 +5702,7 @@ CHARSET_INFO my_charset_gb2312 =
|
|||||||
sort_order_gb2312,
|
sort_order_gb2312,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,
|
my_strnncollsp_simple,
|
||||||
|
@ -9899,6 +9899,7 @@ CHARSET_INFO my_charset_gbk =
|
|||||||
sort_order_gbk,
|
sort_order_gbk,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_gbk,
|
my_strnncoll_gbk,
|
||||||
my_strnncollsp_gbk,
|
my_strnncollsp_gbk,
|
||||||
|
@ -188,6 +188,7 @@ CHARSET_INFO my_charset_latin1 =
|
|||||||
sort_order_latin1,
|
sort_order_latin1,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
2, /* strxfrm_multiply */
|
2, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,
|
my_strnncoll_simple,
|
||||||
my_strnncollsp_simple,
|
my_strnncollsp_simple,
|
||||||
|
@ -359,6 +359,7 @@ CHARSET_INFO my_charset_latin1_de =
|
|||||||
sort_order_latin1_de,
|
sort_order_latin1_de,
|
||||||
tab_8859_1_uni, /* tab_to_uni */
|
tab_8859_1_uni, /* tab_to_uni */
|
||||||
idx_uni_8859_1, /* tab_from_uni */
|
idx_uni_8859_1, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
2, /* strxfrm_multiply */
|
2, /* strxfrm_multiply */
|
||||||
my_strnncoll_latin1_de,
|
my_strnncoll_latin1_de,
|
||||||
my_strnncollsp_latin1_de,
|
my_strnncollsp_latin1_de,
|
||||||
|
@ -4486,6 +4486,7 @@ CHARSET_INFO my_charset_sjis =
|
|||||||
sort_order_sjis,
|
sort_order_sjis,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_sjis,
|
my_strnncoll_sjis,
|
||||||
my_strnncollsp_sjis,
|
my_strnncollsp_sjis,
|
||||||
|
@ -709,6 +709,7 @@ CHARSET_INFO my_charset_tis620 =
|
|||||||
sort_order_tis620,
|
sort_order_tis620,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
4, /* strxfrm_multiply */
|
4, /* strxfrm_multiply */
|
||||||
my_strnncoll_tis620,
|
my_strnncoll_tis620,
|
||||||
my_strnncollsp_tis620,
|
my_strnncollsp_tis620,
|
||||||
|
@ -8443,6 +8443,7 @@ CHARSET_INFO my_charset_ujis =
|
|||||||
sort_order_ujis,
|
sort_order_ujis,
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
0, /* strxfrm_multiply */
|
0, /* strxfrm_multiply */
|
||||||
my_strnncoll_simple,/* strnncoll */
|
my_strnncoll_simple,/* strnncoll */
|
||||||
my_strnncollsp_simple,
|
my_strnncollsp_simple,
|
||||||
|
@ -1988,6 +1988,7 @@ CHARSET_INFO my_charset_utf8 =
|
|||||||
to_upper_utf8, /* sort_order */
|
to_upper_utf8, /* sort_order */
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_utf8, /* strnncoll */
|
my_strnncoll_utf8, /* strnncoll */
|
||||||
my_strnncollsp_utf8,
|
my_strnncollsp_utf8,
|
||||||
@ -3095,6 +3096,7 @@ CHARSET_INFO my_charset_ucs2 =
|
|||||||
to_upper_ucs2, /* sort_order */
|
to_upper_ucs2, /* sort_order */
|
||||||
NULL, /* tab_to_uni */
|
NULL, /* tab_to_uni */
|
||||||
NULL, /* tab_from_uni */
|
NULL, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
1, /* strxfrm_multiply */
|
1, /* strxfrm_multiply */
|
||||||
my_strnncoll_ucs2, /* strnncoll */
|
my_strnncoll_ucs2, /* strnncoll */
|
||||||
my_strnncoll_ucs2,
|
my_strnncoll_ucs2,
|
||||||
|
@ -653,6 +653,7 @@ CHARSET_INFO my_charset_win1250ch =
|
|||||||
sort_order_win1250ch,
|
sort_order_win1250ch,
|
||||||
tab_cp1250_uni, /* tab_to_uni */
|
tab_cp1250_uni, /* tab_to_uni */
|
||||||
idx_uni_cp1250, /* tab_from_uni */
|
idx_uni_cp1250, /* tab_from_uni */
|
||||||
|
"","",
|
||||||
2, /* strxfrm_multiply */
|
2, /* strxfrm_multiply */
|
||||||
my_strnncoll_win1250ch,
|
my_strnncoll_win1250ch,
|
||||||
my_strnncollsp_win1250ch,
|
my_strnncollsp_win1250ch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user