mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge
This commit is contained in:
@ -107,7 +107,7 @@ void lex_init(void)
|
||||
state_map[i]=(uchar) STATE_CHAR;
|
||||
}
|
||||
state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) STATE_IDENT;
|
||||
state_map[(uchar)'\'']=state_map[(uchar)'"']=(uchar) STATE_STRING;
|
||||
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;
|
||||
@ -122,10 +122,7 @@ void lex_init(void)
|
||||
state_map[(uchar)'*']= (uchar) STATE_END_LONG_COMMENT;
|
||||
state_map[(uchar)'@']= (uchar) STATE_USER_END;
|
||||
state_map[(uchar) '`']= (uchar) STATE_USER_VARIABLE_DELIMITER;
|
||||
if (opt_sql_mode & MODE_ANSI_QUOTES)
|
||||
{
|
||||
state_map[(uchar) '"'] = STATE_USER_VARIABLE_DELIMITER;
|
||||
}
|
||||
state_map[(uchar)'"']= (uchar) STAT_STRING_OR_DELIMITER;
|
||||
|
||||
/*
|
||||
Create a second map to make it faster to find identifiers
|
||||
@ -167,7 +164,7 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
|
||||
lex->convert_set= (lex->thd= thd)->variables.convert_set;
|
||||
lex->thd_charset= lex->thd->variables.thd_charset;
|
||||
lex->yacc_yyss=lex->yacc_yyvs=0;
|
||||
lex->ignore_space=test(thd->sql_mode & MODE_IGNORE_SPACE);
|
||||
lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
|
||||
lex->slave_thd_opt=0;
|
||||
lex->sql_command=SQLCOM_END;
|
||||
lex->safe_to_cache_query= 1;
|
||||
@ -671,12 +668,13 @@ int yylex(void *arg, void *yythd)
|
||||
return(IDENT);
|
||||
|
||||
case STATE_USER_VARIABLE_DELIMITER:
|
||||
{
|
||||
char delim= c; // Used char
|
||||
lex->tok_start=lex->ptr; // Skip first `
|
||||
#ifdef USE_MB
|
||||
if (use_mb(system_charset_info))
|
||||
{
|
||||
while ((c=yyGet()) && state_map[c] != STATE_USER_VARIABLE_DELIMITER &&
|
||||
c != (uchar) NAMES_SEP_CHAR)
|
||||
while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR)
|
||||
{
|
||||
if (my_ismbhead(system_charset_info, c))
|
||||
{
|
||||
@ -716,10 +714,10 @@ int yylex(void *arg, void *yythd)
|
||||
}
|
||||
if (lex->convert_set)
|
||||
lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen);
|
||||
if (state_map[c] == STATE_USER_VARIABLE_DELIMITER)
|
||||
if (c == delim)
|
||||
yySkip(); // Skip end `
|
||||
return(IDENT);
|
||||
|
||||
}
|
||||
case STATE_SIGNED_NUMBER: // Incomplete signed number
|
||||
if (prev_state == STATE_OPERATOR_OR_IDENT)
|
||||
{
|
||||
@ -832,6 +830,13 @@ int yylex(void *arg, void *yythd)
|
||||
lex->next_state= STATE_START; // Allow signed numbers
|
||||
return(tokval);
|
||||
|
||||
case STAT_STRING_OR_DELIMITER:
|
||||
if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES)
|
||||
{
|
||||
state= STATE_USER_VARIABLE_DELIMITER;
|
||||
break;
|
||||
}
|
||||
/* " used for strings */
|
||||
case STATE_STRING: // Incomplete text string
|
||||
if (!(yylval->lex_str.str = get_text(lex)))
|
||||
{
|
||||
@ -926,6 +931,7 @@ int yylex(void *arg, void *yythd)
|
||||
switch (state_map[yyPeek()]) {
|
||||
case STATE_STRING:
|
||||
case STATE_USER_VARIABLE_DELIMITER:
|
||||
case STAT_STRING_OR_DELIMITER:
|
||||
break;
|
||||
case STATE_USER_END:
|
||||
lex->next_state=STATE_SYSTEM_VAR;
|
||||
@ -980,7 +986,7 @@ int yylex(void *arg, void *yythd)
|
||||
|
||||
void st_select_lex_node::init_query()
|
||||
{
|
||||
dependent= 0;
|
||||
no_table_names_allowed= dependent= 0;
|
||||
}
|
||||
|
||||
void st_select_lex_node::init_select()
|
||||
@ -1208,13 +1214,14 @@ List<String>* st_select_lex_node::get_use_index() { return 0; }
|
||||
List<String>* st_select_lex_node::get_ignore_index() { return 0; }
|
||||
TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
|
||||
LEX_STRING *alias,
|
||||
bool updating,
|
||||
ulong table_join_options,
|
||||
thr_lock_type flags,
|
||||
List<String> *use_index,
|
||||
List<String> *ignore_index)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
ulong st_select_lex_node::get_table_join_options() { return 0; }
|
||||
|
||||
/*
|
||||
This is used for UNION & subselect to create a new table list of all used
|
||||
@ -1371,6 +1378,11 @@ List<String>* st_select_lex::get_ignore_index()
|
||||
return ignore_index_ptr;
|
||||
}
|
||||
|
||||
ulong st_select_lex::get_table_join_options()
|
||||
{
|
||||
return table_join_options;
|
||||
}
|
||||
|
||||
/*
|
||||
There are st_select_lex::add_table_to_list &
|
||||
st_select_lex::set_lock_for_tables in sql_parse.cc
|
||||
|
Reference in New Issue
Block a user