Commit 2989cbe0 authored by malff/marcsql@weblab.(none)'s avatar malff/marcsql@weblab.(none)

Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  weblab.(none):/home/marcsql/TREE/mysql-5.1-cleanup
parents 9bf39c6f f5dc545c
......@@ -16,7 +16,7 @@
/* sql_yacc.yy */
%{
/* thd is passed as an arg to yyparse(), and subsequently to yylex().
/* thd is passed as an argument to yyparse(), and subsequently to yylex().
** The type will be void*, so it must be cast to (THD*) when used.
** Use the YYTHD macro for this.
*/
......@@ -43,9 +43,21 @@
int yylex(void *yylval, void *yythd);
const LEX_STRING null_lex_str={0,0};
const LEX_STRING null_lex_str= {0,0};
#define yyoverflow(A,B,C,D,E,F) {ulong val= *(F); if (my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }}
#define yyoverflow(A,B,C,D,E,F) \
{ \
ulong val= *(F); \
if (my_yyoverflow((B), (D), &val)) \
{ \
yyerror((char*) (A)); \
return 2; \
} \
else \
{ \
*(F)= (YYSIZE_T)val; \
} \
}
#define MYSQL_YYABORT \
do \
......@@ -1282,6 +1294,25 @@ END_OF_INPUT
THEN_SYM WHEN_SYM DIV_SYM MOD_SYM OR2_SYM AND_AND_SYM
%%
/*
Indentation of grammar rules:
rule: <-- starts at col 1
rule1a rule1b rule1c <-- starts at col 11
{ <-- starts at col 11
code <-- starts at col 13, indentation is 2 spaces
}
| rule2a rule2b
{
code
}
; <-- on a line by itself, starts at col 9
Also, please do not use any <TAB>, but spaces.
Having a uniform indentation in this file helps
code reviews, patches, merges, and make maintenance easier.
Thanks.
*/
query:
END_OF_INPUT
......@@ -1298,7 +1329,8 @@ query:
thd->lex->sql_command= SQLCOM_EMPTY_QUERY;
}
}
| verb_clause END_OF_INPUT {};
| verb_clause END_OF_INPUT {}
;
verb_clause:
statement
......@@ -1367,14 +1399,14 @@ deallocate:
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
lex->prepared_stmt_name= $3;
};
}
;
deallocate_or_drop:
DEALLOCATE_SYM |
DROP
DEALLOCATE_SYM
| DROP
;
prepare:
PREPARE_SYM ident FROM prepare_src
{
......@@ -1382,7 +1414,8 @@ prepare:
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_PREPARE;
lex->prepared_stmt_name= $2;
};
}
;
prepare_src:
TEXT_STRING_sys
......@@ -1398,7 +1431,8 @@ prepare_src:
LEX *lex= thd->lex;
lex->prepared_stmt_code= $2;
lex->prepared_stmt_code_is_varref= TRUE;
};
}
;
execute:
EXECUTE_SYM ident
......@@ -1422,7 +1456,8 @@ execute_var_list:
| execute_var_ident
;
execute_var_ident: '@' ident_or_text
execute_var_ident:
'@' ident_or_text
{
LEX *lex=Lex;
LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&$2, sizeof(LEX_STRING));
......@@ -1447,7 +1482,8 @@ help:
LEX *lex= Lex;
lex->sql_command= SQLCOM_HELP;
lex->help_arg= $3.str;
};
}
;
/* change master */
......@@ -1464,30 +1500,27 @@ change:
master_defs:
master_def
| master_defs ',' master_def;
| master_defs ',' master_def
;
master_def:
MASTER_HOST_SYM EQ TEXT_STRING_sys
{
Lex->mi.host = $3.str;
}
|
MASTER_USER_SYM EQ TEXT_STRING_sys
| MASTER_USER_SYM EQ TEXT_STRING_sys
{
Lex->mi.user = $3.str;
}
|
MASTER_PASSWORD_SYM EQ TEXT_STRING_sys
| MASTER_PASSWORD_SYM EQ TEXT_STRING_sys
{
Lex->mi.password = $3.str;
}
|
MASTER_PORT_SYM EQ ulong_num
| MASTER_PORT_SYM EQ ulong_num
{
Lex->mi.port = $3;
}
|
MASTER_CONNECT_RETRY_SYM EQ ulong_num
| MASTER_CONNECT_RETRY_SYM EQ ulong_num
{
Lex->mi.connect_retry = $3;
}
......@@ -1521,8 +1554,7 @@ master_def:
Lex->mi.ssl_verify_server_cert= $3 ?
LEX_MASTER_INFO::SSL_ENABLE : LEX_MASTER_INFO::SSL_DISABLE;
}
|
master_file_def
| master_file_def
;
master_file_def:
......@@ -1659,8 +1691,13 @@ create:
Lex->sql_command= SQLCOM_CREATE_SERVER;
}
;
server_def:
SERVER_SYM ident_or_text FOREIGN DATA_SYM WRAPPER_SYM ident_or_text OPTIONS_SYM '(' server_options_list ')'
SERVER_SYM
ident_or_text
FOREIGN DATA_SYM WRAPPER_SYM
ident_or_text
OPTIONS_SYM '(' server_options_list ')'
{
Lex->server_options.server_name= $2.str;
Lex->server_options.server_name_length= $2.length;
......@@ -1678,33 +1715,27 @@ server_option:
{
Lex->server_options.username= $2.str;
}
|
HOST_SYM TEXT_STRING_sys
| HOST_SYM TEXT_STRING_sys
{
Lex->server_options.host= $2.str;
}
|
DATABASE TEXT_STRING_sys
| DATABASE TEXT_STRING_sys
{
Lex->server_options.db= $2.str;
}
|
OWNER_SYM TEXT_STRING_sys
| OWNER_SYM TEXT_STRING_sys
{
Lex->server_options.owner= $2.str;
}
|
PASSWORD TEXT_STRING_sys
| PASSWORD TEXT_STRING_sys
{
Lex->server_options.password= $2.str;
}
|
SOCKET_SYM TEXT_STRING_sys
| SOCKET_SYM TEXT_STRING_sys
{
Lex->server_options.socket= $2.str;
}
|
PORT_SYM ulong_num
| PORT_SYM ulong_num
{
Lex->server_options.port= $2;
}
......@@ -1760,7 +1791,8 @@ event_tail:
}
;
ev_schedule_time: EVERY_SYM expr interval
ev_schedule_time:
EVERY_SYM expr interval
{
Lex->event_parse_data->item_expression= $2;
Lex->event_parse_data->interval= $3;
......@@ -1773,7 +1805,8 @@ ev_schedule_time: EVERY_SYM expr interval
}
;
opt_ev_status: /* empty */ { $$= 0; }
opt_ev_status:
/* empty */ { $$= 0; }
| ENABLE_SYM
{
Lex->event_parse_data->status= Event_basic::ENABLED;
......@@ -1791,7 +1824,8 @@ opt_ev_status: /* empty */ { $$= 0; }
}
;
ev_starts: /* empty */
ev_starts:
/* empty */
{
Lex->event_parse_data->item_starts= new Item_func_now_local();
}
......@@ -1801,14 +1835,16 @@ ev_starts: /* empty */
}
;
ev_ends: /* empty */
ev_ends:
/* empty */
| ENDS_SYM expr
{
Lex->event_parse_data->item_ends= $2;
}
;
opt_ev_on_completion: /* empty */ { $$= 0; }
opt_ev_on_completion:
/* empty */ { $$= 0; }
| ev_on_completion
;
......@@ -1827,7 +1863,8 @@ ev_on_completion:
}
;
opt_ev_comment: /* empty */ { $$= 0; }
opt_ev_comment:
/* empty */ { $$= 0; }
| COMMENT_SYM TEXT_STRING_sys
{
Lex->comment= Lex->event_parse_data->comment= $2;
......@@ -1907,7 +1944,6 @@ ev_sql_stmt_inner:
| sp_proc_stmt_close
;
clear_privileges:
/* Nothing */
{
......@@ -2155,7 +2191,7 @@ sp_chistic:
| MODIFIES_SYM SQL_SYM DATA_SYM
{ Lex->sp_chistics.daccess= SP_MODIFIES_SQL_DATA; }
| sp_suid
{ }
{}
;
/* Create characteristics */
......@@ -2527,7 +2563,7 @@ sp_cursor_stmt:
sp_handler_type:
EXIT_SYM { $$= SP_HANDLER_EXIT; }
| CONTINUE_SYM { $$= SP_HANDLER_CONTINUE; }
/* | UNDO_SYM { QQ No yet } */
/*| UNDO_SYM { QQ No yet } */
;
sp_hcond_list:
......@@ -2670,7 +2706,8 @@ sp_proc_stmt:
;
sp_proc_stmt_if:
IF { Lex->sphead->new_cont_backpatch(NULL); }
IF
{ Lex->sphead->new_cont_backpatch(NULL); }
sp_if END IF
{ Lex->sphead->do_cont_backpatch(); }
;
......@@ -2865,7 +2902,7 @@ sp_proc_stmt_fetch:
sp->add_instr(i);
}
sp_fetch_list
{ }
{}
;
sp_proc_stmt_close:
......@@ -2913,8 +2950,7 @@ sp_fetch_list:
i->add_to_varlist(spv);
}
}
|
sp_fetch_list ',' ident
| sp_fetch_list ',' ident
{
LEX *lex= Lex;
sp_head *sp= lex->sphead;
......@@ -3262,7 +3298,8 @@ opt_logfile_group_name:
{
LEX *lex= Lex;
lex->alter_tablespace_info->logfile_group_name= $4.str;
};
}
;
alter_tablespace_info:
tablespace_name
......@@ -3271,13 +3308,13 @@ alter_tablespace_info:
{
Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_ADD_FILE;
}
|
tablespace_name
| tablespace_name
DROP ts_datafile
alter_tablespace_option_list
{
Lex->alter_tablespace_info->ts_alter_tablespace_type= ALTER_TABLESPACE_DROP_FILE;
};
}
;
logfile_group_info:
logfile_group_name
......@@ -3398,21 +3435,24 @@ ts_datafile:
{
LEX *lex= Lex;
lex->alter_tablespace_info->data_file_name= $2.str;
};
}
;
lg_undofile:
UNDOFILE_SYM TEXT_STRING_sys
{
LEX *lex= Lex;
lex->alter_tablespace_info->undo_file_name= $2.str;
};
}
;
lg_redofile:
REDOFILE_SYM TEXT_STRING_sys
{
LEX *lex= Lex;
lex->alter_tablespace_info->redo_file_name= $2.str;
};
}
;
tablespace_name:
ident
......@@ -3421,7 +3461,8 @@ tablespace_name:
lex->alter_tablespace_info= new st_alter_tablespace();
lex->alter_tablespace_info->tablespace_name= $1.str;
lex->sql_command= SQLCOM_ALTER_TABLESPACE;
};
}
;
logfile_group_name:
ident
......@@ -3430,7 +3471,8 @@ logfile_group_name:
lex->alter_tablespace_info= new st_alter_tablespace();
lex->alter_tablespace_info->logfile_group_name= $1.str;
lex->sql_command= SQLCOM_ALTER_TABLESPACE;
};
}
;
ts_access_mode:
READ_ONLY_SYM
......@@ -3447,49 +3489,56 @@ ts_access_mode:
{
LEX *lex= Lex;
lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
};
}
;
opt_ts_initial_size:
INITIAL_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->initial_size= $3;
};
}
;
opt_ts_autoextend_size:
AUTOEXTEND_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->autoextend_size= $3;
};
}
;
opt_ts_max_size:
MAX_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->max_size= $3;
};
}
;
opt_ts_extent_size:
EXTENT_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->extent_size= $3;
};
}
;
opt_ts_undo_buffer_size:
UNDO_BUFFER_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->undo_buffer_size= $3;
};
}
;
opt_ts_redo_buffer_size:
REDO_BUFFER_SIZE_SYM opt_equal size_number
{
LEX *lex= Lex;
lex->alter_tablespace_info->redo_buffer_size= $3;
};
}
;
opt_ts_nodegroup:
NODEGROUP_SYM opt_equal real_ulong_num
......@@ -3501,7 +3550,8 @@ opt_ts_nodegroup:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->nodegroup_id= $3;
};
}
;
opt_ts_comment:
COMMENT_SYM opt_equal TEXT_STRING_sys
......@@ -3513,7 +3563,8 @@ opt_ts_comment:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->ts_comment= $3.str;
};
}
;
opt_ts_engine:
opt_storage ENGINE_SYM opt_equal storage_engines
......@@ -3526,7 +3577,8 @@ opt_ts_engine:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->storage_engine= $4;
};
}
;
opt_ts_wait:
/* empty */
......@@ -3548,7 +3600,8 @@ ts_wait:
MYSQL_YYABORT;
}
lex->alter_tablespace_info->wait_until_completed= FALSE;
};
}
;
size_number:
real_ulong_num { $$= $1;}
......@@ -4254,50 +4307,65 @@ create_select:
opt_as:
/* empty */ {}
| AS {};
| AS {}
;
opt_create_database_options:
/* empty */ {}
| create_database_options {};
| create_database_options {}
;
create_database_options:
create_database_option {}
| create_database_options create_database_option {};
| create_database_options create_database_option {}
;
create_database_option:
default_collation {}
| default_charset {};
| default_charset {}
;
opt_table_options:
/* empty */ { $$= 0; }
| table_options { $$= $1;};
| table_options { $$= $1;}
;
table_options:
table_option { $$=$1; }
| table_option table_options { $$= $1 | $2; };
| table_option table_options { $$= $1 | $2; }
;
table_option:
TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; };
TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
;
opt_if_not_exists:
/* empty */ { $$= 0; }
| IF not EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; };
| IF not EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
;
opt_create_table_options:
/* empty */
| create_table_options;
| create_table_options
;
create_table_options_space_separated:
create_table_option
| create_table_option create_table_options_space_separated;
| create_table_option create_table_options_space_separated
;
create_table_options:
create_table_option
| create_table_option create_table_options
| create_table_option ',' create_table_options;
| create_table_option ',' create_table_options
;
create_table_option:
ENGINE_SYM opt_equal storage_engines { Lex->create_info.db_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; }
ENGINE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
| TYPE_SYM opt_equal storage_engines
{
Lex->create_info.db_type= $3;
......@@ -4305,12 +4373,36 @@ create_table_option:
"'ENGINE=storage_engine'");
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
}
| MAX_ROWS opt_equal ulonglong_num { Lex->create_info.max_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;}
| MIN_ROWS opt_equal ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
| AVG_ROW_LENGTH opt_equal ulong_num { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
| PASSWORD opt_equal TEXT_STRING_sys { Lex->create_info.password=$3.str; Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD; }
| COMMENT_SYM opt_equal TEXT_STRING_sys { Lex->create_info.comment=$3; Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT; }
| AUTO_INC opt_equal ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;}
| MAX_ROWS opt_equal ulonglong_num
{
Lex->create_info.max_rows= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;
}
| MIN_ROWS opt_equal ulonglong_num
{
Lex->create_info.min_rows= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;
}
| AVG_ROW_LENGTH opt_equal ulong_num
{
Lex->create_info.avg_row_length=$3;
Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;
}
| PASSWORD opt_equal TEXT_STRING_sys
{
Lex->create_info.password=$3.str;
Lex->create_info.used_fields|= HA_CREATE_USED_PASSWORD;
}
| COMMENT_SYM opt_equal TEXT_STRING_sys
{
Lex->create_info.comment=$3;
Lex->create_info.used_fields|= HA_CREATE_USED_COMMENT;
}
| AUTO_INC opt_equal ulonglong_num
{
Lex->create_info.auto_increment_value=$3;
Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;
}
| PACK_KEYS_SYM opt_equal ulong_num
{
switch($3) {
......@@ -4332,9 +4424,21 @@ create_table_option:
~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS);
Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;
}
| CHECKSUM_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; }
| DELAY_KEY_WRITE_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; }
| ROW_FORMAT_SYM opt_equal row_types { Lex->create_info.row_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; }
| CHECKSUM_SYM opt_equal ulong_num
{
Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM;
Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM;
}
| DELAY_KEY_WRITE_SYM opt_equal ulong_num
{
Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE;
Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE;
}
| ROW_FORMAT_SYM opt_equal row_types
{
Lex->create_info.row_type= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
}
| UNION_SYM opt_equal '(' table_list ')'
{
/* Move the union list to the merge_list */
......@@ -4352,13 +4456,33 @@ create_table_option:
}
| default_charset
| default_collation
| INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR; }
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR; }
| TABLESPACE ident {Lex->create_info.tablespace= $2.str;}
| STORAGE_SYM DISK_SYM {Lex->create_info.storage_media= HA_SM_DISK;}
| STORAGE_SYM MEMORY_SYM {Lex->create_info.storage_media= HA_SM_MEMORY;}
| CONNECTION_SYM opt_equal TEXT_STRING_sys { Lex->create_info.connect_string.str= $3.str; Lex->create_info.connect_string.length= $3.length; Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION; }
| INSERT_METHOD opt_equal merge_insert_types
{
Lex->create_info.merge_insert_method= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;
}
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
{
Lex->create_info.data_file_name= $4.str;
Lex->create_info.used_fields|= HA_CREATE_USED_DATADIR;
}
| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
{
Lex->create_info.index_file_name= $4.str;
Lex->create_info.used_fields|= HA_CREATE_USED_INDEXDIR;
}
| TABLESPACE ident
{Lex->create_info.tablespace= $2.str;}
| STORAGE_SYM DISK_SYM
{Lex->create_info.storage_media= HA_SM_DISK;}
| STORAGE_SYM MEMORY_SYM
{Lex->create_info.storage_media= HA_SM_MEMORY;}
| CONNECTION_SYM opt_equal TEXT_STRING_sys
{
Lex->create_info.connect_string.str= $3.str;
Lex->create_info.connect_string.length= $3.length;
Lex->create_info.used_fields|= HA_CREATE_USED_CONNECTION;
}
| KEY_BLOCK_SIZE opt_equal ulong_num
{
Lex->create_info.used_fields|= HA_CREATE_USED_KEY_BLOCK_SIZE;
......@@ -4381,7 +4505,8 @@ default_charset:
}
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
};
}
;
default_collation:
opt_default COLLATE_SYM opt_equal collation_name_or_default
......@@ -4397,7 +4522,8 @@ default_collation:
}
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
};
}
;
storage_engines:
ident_or_text
......@@ -4442,16 +4568,19 @@ row_types:
| DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
| COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
| REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; };
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
;
merge_insert_types:
NO_SYM { $$= MERGE_INSERT_DISABLED; }
| FIRST_SYM { $$= MERGE_INSERT_TO_FIRST; }
| LAST_SYM { $$= MERGE_INSERT_TO_LAST; };
| LAST_SYM { $$= MERGE_INSERT_TO_LAST; }
;
opt_select_from:
opt_limit_clause {}
| select_from select_lock_type;
| select_from select_lock_type
;
udf_func_type:
/* empty */ { $$ = UDFTYPE_FUNCTION; }
......@@ -4461,12 +4590,13 @@ udf_type:
STRING_SYM {$$ = (int) STRING_RESULT; }
| REAL {$$ = (int) REAL_RESULT; }
| DECIMAL_SYM {$$ = (int) DECIMAL_RESULT; }
| INT_SYM {$$ = (int) INT_RESULT; };
| INT_SYM {$$ = (int) INT_RESULT; }
;
field_list:
field_list_item
| field_list ',' field_list_item;
| field_list ',' field_list_item
;
field_list_item:
column_def
......@@ -4556,7 +4686,8 @@ field_spec:
field_ident
{
LEX *lex=Lex;
lex->length=lex->dec=0; lex->type=0;
lex->length=lex->dec=0;
lex->type=0;
lex->default_value= lex->on_update_value= 0;
lex->comment=null_lex_str;
lex->charset=NULL;
......@@ -4571,47 +4702,90 @@ field_spec:
lex->change,&lex->interval_list,lex->charset,
lex->uint_geom_type))
MYSQL_YYABORT;
};
}
;
type:
int_type opt_len field_options { $$=$1; }
| real_type opt_precision field_options { $$=$1; }
| FLOAT_SYM float_options field_options { $$=MYSQL_TYPE_FLOAT; }
| BIT_SYM { Lex->length= (char*) "1";
$$=MYSQL_TYPE_BIT; }
| BIT_SYM '(' NUM ')' { Lex->length= $3.str;
$$=MYSQL_TYPE_BIT; }
| BOOL_SYM { Lex->length=(char*) "1";
$$=MYSQL_TYPE_TINY; }
| BOOLEAN_SYM { Lex->length=(char*) "1";
$$=MYSQL_TYPE_TINY; }
| char '(' NUM ')' opt_binary { Lex->length=$3.str;
$$=MYSQL_TYPE_STRING; }
| char opt_binary { Lex->length=(char*) "1";
$$=MYSQL_TYPE_STRING; }
| nchar '(' NUM ')' opt_bin_mod { Lex->length=$3.str;
| BIT_SYM
{
Lex->length= (char*) "1";
$$=MYSQL_TYPE_BIT;
}
| BIT_SYM '(' NUM ')'
{
Lex->length= $3.str;
$$=MYSQL_TYPE_BIT;
}
| BOOL_SYM
{
Lex->length=(char*) "1";
$$=MYSQL_TYPE_TINY;
}
| BOOLEAN_SYM
{
Lex->length=(char*) "1";
$$=MYSQL_TYPE_TINY;
}
| char '(' NUM ')' opt_binary
{
Lex->length=$3.str;
$$=MYSQL_TYPE_STRING;
}
| char opt_binary
{
Lex->length=(char*) "1";
$$=MYSQL_TYPE_STRING;
}
| nchar '(' NUM ')' opt_bin_mod
{
Lex->length=$3.str;
$$=MYSQL_TYPE_STRING;
Lex->charset=national_charset_info; }
| nchar opt_bin_mod { Lex->length=(char*) "1";
Lex->charset=national_charset_info;
}
| nchar opt_bin_mod
{
Lex->length=(char*) "1";
$$=MYSQL_TYPE_STRING;
Lex->charset=national_charset_info; }
| BINARY '(' NUM ')' { Lex->length=$3.str;
Lex->charset=national_charset_info;
}
| BINARY '(' NUM ')'
{
Lex->length=$3.str;
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_STRING; }
| BINARY { Lex->length= (char*) "1";
$$=MYSQL_TYPE_STRING;
}
| BINARY
{
Lex->length= (char*) "1";
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_STRING; }
| varchar '(' NUM ')' opt_binary { Lex->length=$3.str;
$$= MYSQL_TYPE_VARCHAR; }
| nvarchar '(' NUM ')' opt_bin_mod { Lex->length=$3.str;
$$=MYSQL_TYPE_STRING;
}
| varchar '(' NUM ')' opt_binary
{
Lex->length=$3.str;
$$= MYSQL_TYPE_VARCHAR;
Lex->charset=national_charset_info; }
| VARBINARY '(' NUM ')' { Lex->length=$3.str;
}
| nvarchar '(' NUM ')' opt_bin_mod
{
Lex->length=$3.str;
$$= MYSQL_TYPE_VARCHAR;
Lex->charset=national_charset_info;
}
| VARBINARY '(' NUM ')'
{
Lex->length=$3.str;
Lex->charset=&my_charset_bin;
$$= MYSQL_TYPE_VARCHAR; }
| YEAR_SYM opt_len field_options { $$=MYSQL_TYPE_YEAR; }
| DATE_SYM { $$=MYSQL_TYPE_DATE; }
| TIME_SYM { $$=MYSQL_TYPE_TIME; }
$$= MYSQL_TYPE_VARCHAR;
}
| YEAR_SYM opt_len field_options
{ $$=MYSQL_TYPE_YEAR; }
| DATE_SYM
{ $$=MYSQL_TYPE_DATE; }
| TIME_SYM
{ $$=MYSQL_TYPE_TIME; }
| TIMESTAMP opt_len
{
if (YYTHD->variables.sql_mode & MODE_MAXDB)
......@@ -4625,11 +4799,18 @@ type:
$$=MYSQL_TYPE_TIMESTAMP;
}
}
| DATETIME { $$=MYSQL_TYPE_DATETIME; }
| TINYBLOB { Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_TINY_BLOB; }
| BLOB_SYM opt_len { Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_BLOB; }
| DATETIME
{ $$=MYSQL_TYPE_DATETIME; }
| TINYBLOB
{
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_TINY_BLOB;
}
| BLOB_SYM opt_len
{
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_BLOB;
}
| spatial_type
{
#ifdef HAVE_SPATIAL
......@@ -4642,28 +4823,47 @@ type:
MYSQL_YYABORT;
#endif
}
| MEDIUMBLOB { Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_MEDIUM_BLOB; }
| LONGBLOB { Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_LONG_BLOB; }
| LONG_SYM VARBINARY { Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_MEDIUM_BLOB; }
| LONG_SYM varchar opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
| TINYTEXT opt_binary { $$=MYSQL_TYPE_TINY_BLOB; }
| TEXT_SYM opt_len opt_binary { $$=MYSQL_TYPE_BLOB; }
| MEDIUMTEXT opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
| LONGTEXT opt_binary { $$=MYSQL_TYPE_LONG_BLOB; }
| MEDIUMBLOB
{
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_MEDIUM_BLOB;
}
| LONGBLOB
{
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_LONG_BLOB;
}
| LONG_SYM VARBINARY
{
Lex->charset=&my_charset_bin;
$$=MYSQL_TYPE_MEDIUM_BLOB;
}
| LONG_SYM varchar opt_binary
{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
| TINYTEXT opt_binary
{ $$=MYSQL_TYPE_TINY_BLOB; }
| TEXT_SYM opt_len opt_binary
{ $$=MYSQL_TYPE_BLOB; }
| MEDIUMTEXT opt_binary
{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
| LONGTEXT opt_binary
{ $$=MYSQL_TYPE_LONG_BLOB; }
| DECIMAL_SYM float_options field_options
{ $$=MYSQL_TYPE_NEWDECIMAL;}
| NUMERIC_SYM float_options field_options
{ $$=MYSQL_TYPE_NEWDECIMAL;}
| FIXED_SYM float_options field_options
{ $$=MYSQL_TYPE_NEWDECIMAL;}
| ENUM {Lex->interval_list.empty();} '(' string_list ')' opt_binary
| ENUM
{Lex->interval_list.empty();}
'(' string_list ')' opt_binary
{ $$=MYSQL_TYPE_ENUM; }
| SET { Lex->interval_list.empty();} '(' string_list ')' opt_binary
| SET
{ Lex->interval_list.empty();}
'(' string_list ')' opt_binary
{ $$=MYSQL_TYPE_SET; }
| LONG_SYM opt_binary { $$=MYSQL_TYPE_MEDIUM_BLOB; }
| LONG_SYM opt_binary
{ $$=MYSQL_TYPE_MEDIUM_BLOB; }
| SERIAL_SYM
{
$$=MYSQL_TYPE_LONGLONG;
......@@ -4675,7 +4875,9 @@ type:
spatial_type:
GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
| GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
| POINT_SYM { Lex->length= (char*)"21";
| POINT_SYM
{
Lex->length= (char*)"21";
$$= Field::GEOM_POINT;
}
| MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
......@@ -4712,55 +4914,74 @@ int_type:
| TINYINT { $$=MYSQL_TYPE_TINY; }
| SMALLINT { $$=MYSQL_TYPE_SHORT; }
| MEDIUMINT { $$=MYSQL_TYPE_INT24; }
| BIGINT { $$=MYSQL_TYPE_LONGLONG; };
| BIGINT { $$=MYSQL_TYPE_LONGLONG; }
;
real_type:
REAL { $$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE; }
| DOUBLE_SYM { $$=MYSQL_TYPE_DOUBLE; }
| DOUBLE_SYM PRECISION { $$=MYSQL_TYPE_DOUBLE; };
REAL
{
$$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE;
}
| DOUBLE_SYM
{ $$=MYSQL_TYPE_DOUBLE; }
| DOUBLE_SYM PRECISION
{ $$=MYSQL_TYPE_DOUBLE; }
;
float_options:
/* empty */ { Lex->dec=Lex->length= (char*)0; }
| '(' NUM ')' { Lex->length=$2.str; Lex->dec= (char*)0; }
| precision {};
/* empty */
{ Lex->dec=Lex->length= (char*)0; }
| '(' NUM ')'
{ Lex->length=$2.str; Lex->dec= (char*)0; }
| precision
{}
;
precision:
'(' NUM ',' NUM ')'
{
LEX *lex=Lex;
lex->length=$2.str; lex->dec=$4.str;
};
lex->length=$2.str;
lex->dec=$4.str;
}
;
field_options:
/* empty */ {}
| field_opt_list {};
| field_opt_list {}
;
field_opt_list:
field_opt_list field_option {}
| field_option {};
| field_option {}
;
field_option:
SIGNED_SYM {}
| UNSIGNED { Lex->type|= UNSIGNED_FLAG;}
| ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; };
| ZEROFILL { Lex->type|= UNSIGNED_FLAG | ZEROFILL_FLAG; }
;
opt_len:
/* empty */ { Lex->length=(char*) 0; } /* use default length */
| '(' NUM ')' { Lex->length= $2.str; };
/* empty */ { Lex->length=(char*) 0; /* use default length */ }
| '(' NUM ')' { Lex->length= $2.str; }
;
opt_precision:
/* empty */ {}
| precision {};
| precision {}
;
opt_attribute:
/* empty */ {}
| opt_attribute_list {};
| opt_attribute_list {}
;
opt_attribute_list:
opt_attribute_list attribute {}
| attribute;
| attribute
;
attribute:
NULL_SYM { Lex->type&= ~ NOT_NULL_FLAG; }
......@@ -4810,8 +5031,10 @@ attribute:
;
now_or_signed_literal:
NOW_SYM optional_braces { $$= new Item_func_now_local(); }
| signed_literal { $$=$1; }
NOW_SYM optional_braces
{ $$= new Item_func_now_local(); }
| signed_literal
{ $$=$1; }
;
charset:
......@@ -4833,7 +5056,8 @@ charset_name:
charset_name_or_default:
charset_name { $$=$1; }
| DEFAULT { $$=NULL; } ;
| DEFAULT { $$=NULL; }
;
opt_load_data_charset:
/* Empty */ { $$= NULL; }
......@@ -4855,7 +5079,8 @@ old_or_new_charset_name:
old_or_new_charset_name_or_default:
old_or_new_charset_name { $$=$1; }
| DEFAULT { $$=NULL; } ;
| DEFAULT { $$=NULL; }
;
collation_name:
ident_or_text
......@@ -4865,7 +5090,8 @@ collation_name:
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
MYSQL_YYABORT;
}
};
}
;
opt_collate:
/* empty */ { $$=NULL; }
......@@ -4874,11 +5100,13 @@ opt_collate:
collation_name_or_default:
collation_name { $$=$1; }
| DEFAULT { $$=NULL; } ;
| DEFAULT { $$=NULL; }
;
opt_default:
/* empty */ {}
| DEFAULT {};
| DEFAULT {}
;
opt_binary:
/* empty */ { Lex->charset=NULL; }
......@@ -4894,11 +5122,13 @@ opt_binary:
}
}
| charset charset_name opt_bin_mod { Lex->charset=$2; }
| BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; };
| BINARY opt_bin_charset { Lex->type|= BINCMP_FLAG; }
;
opt_bin_mod:
/* empty */ { }
| BINARY { Lex->type|= BINCMP_FLAG; };
| BINARY { Lex->type|= BINCMP_FLAG; }
;
opt_bin_charset:
/* empty */ { Lex->charset= NULL; }
......@@ -4912,7 +5142,8 @@ opt_bin_charset:
MYSQL_YYABORT;
}
}
| charset charset_name { Lex->charset=$2; } ;
| charset charset_name { Lex->charset=$2; }
;
opt_primary:
/* empty */
......@@ -4929,38 +5160,44 @@ references:
opt_ref_list
{
$$=$2;
};
}
;
opt_ref_list:
/* empty */ opt_on_delete {}
| '(' ref_list ')' opt_on_delete {};
| '(' ref_list ')' opt_on_delete {}
;
ref_list:
ref_list ',' ident { Lex->ref_list.push_back(new Key_part_spec($3.str)); }
| ident { Lex->ref_list.push_back(new Key_part_spec($1.str)); };
| ident { Lex->ref_list.push_back(new Key_part_spec($1.str)); }
;
opt_on_delete:
/* empty */ {}
| opt_on_delete_list {};
| opt_on_delete_list {}
;
opt_on_delete_list:
opt_on_delete_list opt_on_delete_item {}
| opt_on_delete_item {};
| opt_on_delete_item {}
;
opt_on_delete_item:
ON DELETE_SYM delete_option { Lex->fk_delete_opt= $3; }
| ON UPDATE_SYM delete_option { Lex->fk_update_opt= $3; }
| MATCH FULL { Lex->fk_match_option= Foreign_key::FK_MATCH_FULL; }
| MATCH PARTIAL { Lex->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; }
| MATCH SIMPLE_SYM { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; };
| MATCH SIMPLE_SYM { Lex->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; }
;
delete_option:
RESTRICT { $$= (int) Foreign_key::FK_OPTION_RESTRICT; }
| CASCADE { $$= (int) Foreign_key::FK_OPTION_CASCADE; }
| SET NULL_SYM { $$= (int) Foreign_key::FK_OPTION_SET_NULL; }
| NO_SYM ACTION { $$= (int) Foreign_key::FK_OPTION_NO_ACTION; }
| SET DEFAULT { $$= (int) Foreign_key::FK_OPTION_DEFAULT; };
| SET DEFAULT { $$= (int) Foreign_key::FK_OPTION_DEFAULT; }
;
key_type:
key_or_index { $$= Key::MULTIPLE; }
......@@ -4974,15 +5211,18 @@ key_type:
sym_group_geom.name, sym_group_geom.needed_define);
MYSQL_YYABORT;
#endif
};
}
;
constraint_key_type:
PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
| UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; };
| UNIQUE_SYM opt_key_or_index { $$= Key::UNIQUE; }
;
key_or_index:
KEY_SYM {}
| INDEX_SYM {};
| INDEX_SYM {}
;
opt_key_or_index:
/* empty */ {}
......@@ -4992,7 +5232,8 @@ opt_key_or_index:
keys_or_index:
KEYS {}
| INDEX_SYM {}
| INDEXES {};
| INDEXES {}
;
opt_unique_or_fulltext:
/* empty */ { $$= Key::MULTIPLE; }
......@@ -5023,7 +5264,7 @@ init_key_options:
*/
key_alg:
/* empty */ init_key_options
init_key_options
| init_key_options key_using_alg
;
......@@ -5058,18 +5299,16 @@ key_opt:
}
;
btree_or_rtree:
BTREE_SYM { $$= HA_KEY_ALG_BTREE; }
| RTREE_SYM
{
$$= HA_KEY_ALG_RTREE;
}
| HASH_SYM { $$= HA_KEY_ALG_HASH; };
| RTREE_SYM { $$= HA_KEY_ALG_RTREE; }
| HASH_SYM { $$= HA_KEY_ALG_HASH; }
;
key_list:
key_list ',' key_part order_dir { Lex->col_list.push_back($3); }
| key_part order_dir { Lex->col_list.push_back($1); };
| key_part order_dir { Lex->col_list.push_back($1); }
;
key_part:
ident { $$=new Key_part_spec($1.str); }
......@@ -5081,15 +5320,18 @@ key_part:
my_error(ER_KEY_PART_0, MYF(0), $1.str);
}
$$=new Key_part_spec($1.str,(uint) key_part_len);
};
}
;
opt_ident:
/* empty */ { $$=(char*) 0; } /* Defaultlength */
| field_ident { $$=$1.str; };
/* empty */ { $$=(char*) 0; /* Default length */ }
| field_ident { $$=$1.str; }
;
opt_component:
/* empty */ { $$= null_lex_str; }
| '.' ident { $$= $2; };
| '.' ident { $$= $2; }
;
string_list:
text_string { Lex->interval_list.push_back($1); }
......@@ -5291,13 +5533,15 @@ alter:
}
;
ev_alter_on_schedule_completion: /* empty */ { $$= 0;}
ev_alter_on_schedule_completion:
/* empty */ { $$= 0;}
| ON SCHEDULE_SYM ev_schedule_time { $$= 1; }
| ev_on_completion { $$= 1; }
| ON SCHEDULE_SYM ev_schedule_time ev_on_completion { $$= 1; }
;
opt_ev_rename_to: /* empty */ { $$= 0;}
opt_ev_rename_to:
/* empty */ { $$= 0;}
| RENAME TO_SYM sp_name
{
/*
......@@ -5309,15 +5553,18 @@ opt_ev_rename_to: /* empty */ { $$= 0;}
}
;
opt_ev_sql_stmt: /* empty*/ { $$= 0;}
opt_ev_sql_stmt:
/* empty*/ { $$= 0;}
| DO_SYM ev_sql_stmt { $$= 1; }
;
ident_or_empty:
/* empty */ { $$.str= 0; $$.length= 0; }
| ident { $$= $1; };
| ident { $$= $1; }
;
alter_commands:
/* empty */
| DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
| IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; }
| alter_list
......@@ -5423,6 +5670,7 @@ add_partition_rule:
;
add_part_extra:
/* empty */
| '(' part_def_list ')'
{
LEX *lex= Lex;
......@@ -5455,8 +5703,7 @@ reorg_parts_rule:
{
Lex->alter_info.flags|= ALTER_TABLE_REORG;
}
|
alt_part_name_list
| alt_part_name_list
{
Lex->alter_info.flags|= ALTER_REORGANIZE_PARTITION;
}
......@@ -5498,7 +5745,8 @@ add_column:
LEX *lex=Lex;
lex->change=0;
lex->alter_info.flags|= ALTER_ADD_COLUMN;
};
}
;
alter_list_item:
add_column column_def opt_place { }
......@@ -5642,11 +5890,13 @@ alter_list_item:
{
LEX *lex=Lex;
lex->alter_info.flags|= ALTER_ORDER;
};
}
;
opt_column:
/* empty */ {}
| COLUMN_SYM {};
| COLUMN_SYM {}
;
opt_ignore:
/* empty */ { Lex->ignore= 0;}
......@@ -5662,13 +5912,15 @@ opt_restrict:
opt_place:
/* empty */ {}
| AFTER_SYM ident { store_position_for_column($2.str); }
| FIRST_SYM { store_position_for_column(first_keyword); };
| FIRST_SYM { store_position_for_column(first_keyword); }
;
opt_to:
/* empty */ {}
| TO_SYM {}
| EQ {}
| AS {};
| AS {}
;
/*
SLAVE START and SLAVE STOP are deprecated. We keep them for compatibility.
......@@ -5711,7 +5963,6 @@ slave:
}
;
start:
START_SYM TRANSACTION_SYM start_transaction_opts
{
......@@ -5760,14 +6011,13 @@ slave_until:
ER(ER_BAD_SLAVE_UNTIL_COND), MYF(0));
MYSQL_YYABORT;
}
}
;
slave_until_opts:
master_file_def
| slave_until_opts ',' master_file_def ;
| slave_until_opts ',' master_file_def
;
restore:
RESTORE_SYM table_or_tables
......@@ -5777,7 +6027,8 @@ restore:
table_list FROM TEXT_STRING_sys
{
Lex->backup_dir = $6.str;
};
}
;
backup:
BACKUP_SYM table_or_tables
......@@ -5787,7 +6038,8 @@ backup:
table_list TO_SYM TEXT_STRING_sys
{
Lex->backup_dir = $6.str;
};
}
;
checksum:
CHECKSUM_SYM table_or_tables
......@@ -5819,16 +6071,19 @@ repair:
opt_mi_repair_type:
/* empty */ { Lex->check_opt.flags = T_MEDIUM; }
| mi_repair_types {};
| mi_repair_types {}
;
mi_repair_types:
mi_repair_type {}
| mi_repair_type mi_repair_types {};
| mi_repair_type mi_repair_types {}
;
mi_repair_type:
QUICK { Lex->check_opt.flags|= T_QUICK; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
| USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; };
| USE_FRM { Lex->check_opt.sql_flags|= TT_USEFRM; }
;
analyze:
ANALYZE_SYM opt_no_write_to_binlog table_or_tables
......@@ -5869,11 +6124,13 @@ check:
opt_mi_check_type:
/* empty */ { Lex->check_opt.flags = T_MEDIUM; }
| mi_check_types {};
| mi_check_types {}
;
mi_check_types:
mi_check_type {}
| mi_check_type mi_check_types {};
| mi_check_type mi_check_types {}
;
mi_check_type:
QUICK { Lex->check_opt.flags|= T_QUICK; }
......@@ -5881,7 +6138,8 @@ mi_check_type:
| MEDIUM_SYM { Lex->check_opt.flags|= T_MEDIUM; }
| EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
| CHANGED { Lex->check_opt.flags|= T_CHECK_ONLY_CHANGED; }
| FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; };
| FOR_SYM UPGRADE_SYM { Lex->check_opt.sql_flags|= TT_FOR_UPGRADE; }
;
optimize:
OPTIMIZE opt_no_write_to_binlog table_or_tables
......@@ -5936,7 +6194,8 @@ rename_list:
table_to_table_list:
table_to_table
| table_to_table_list ',' table_to_table;
| table_to_table_list ',' table_to_table
;
table_to_table:
table_ident TO_SYM table_ident
......@@ -5948,7 +6207,8 @@ table_to_table:
!sl->add_table_to_list(lex->thd, $3,NULL,TL_OPTION_UPDATING,
TL_IGNORE))
MYSQL_YYABORT;
};
}
;
db_to_db:
ident TO_SYM ident
......@@ -5959,7 +6219,8 @@ db_to_db:
lex->db_list.push_back((LEX_STRING*)
sql_memdup(&$3, sizeof(LEX_STRING))))
MYSQL_YYABORT;
};
}
;
keycache:
CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name
......@@ -5972,7 +6233,8 @@ keycache:
keycache_list:
assign_to_keycache
| keycache_list ',' assign_to_keycache;
| keycache_list ',' assign_to_keycache
;
assign_to_keycache:
table_ident cache_keys_spec
......@@ -6000,7 +6262,8 @@ preload:
preload_list:
preload_keys
| preload_list ',' preload_keys;
| preload_list ',' preload_keys
;
preload_keys:
table_ident cache_keys_spec opt_ignore_leaves
......@@ -6049,8 +6312,8 @@ select:
/* Need select_init2 for subselects. */
select_init:
SELECT_SYM select_init2
|
'(' select_paren ')' union_opt;
| '(' select_paren ')' union_opt
;
select_paren:
SELECT_SYM select_part2
......@@ -6075,7 +6338,8 @@ select_paren:
sel->master_unit()->global_parameters=
sel->master_unit()->fake_select_lex;
}
| '(' select_paren ')';
| '(' select_paren ')'
;
select_init2:
select_part2
......@@ -6109,14 +6373,16 @@ select_part2:
{
Select->parsing_place= NO_MATTER;
}
select_into select_lock_type;
select_into select_lock_type
;
select_into:
opt_order_clause opt_limit_clause {}
| into
| select_from
| into select_from
| select_from into;
| select_from into
;
select_from:
FROM join_table_list where_clause group_clause having_clause
......@@ -6147,7 +6413,8 @@ select_options:
select_option_list:
select_option_list select_option
| select_option;
| select_option
;
select_option:
STRAIGHT_JOIN { Select->options|= SELECT_STRAIGHT_JOIN; }
......@@ -6224,8 +6491,8 @@ select_item_list:
NULL, NULL, "*")))
MYSQL_YYABORT;
(thd->lex->current_select->with_wild)++;
};
}
;
select_item:
remember_name select_item2 remember_end select_alias
......@@ -6244,26 +6511,29 @@ select_item:
{
$2->set_name($1, (uint) ($3 - $1), thd->charset());
}
};
}
;
remember_name:
{
THD *thd= YYTHD;
Lex_input_stream *lip= thd->m_lip;
$$= (char*) lip->get_cpp_tok_start();
};
}
;
remember_end:
{
THD *thd= YYTHD;
Lex_input_stream *lip= thd->m_lip;
$$= (char*) lip->get_cpp_tok_end();
};
}
;
select_item2:
table_wild { $$=$1; } /* table.* */
| expr { $$=$1; };
table_wild { $$=$1; /* table.* */ }
| expr { $$=$1; }
;
select_alias:
/* empty */ { $$=null_lex_str;}
......@@ -6275,7 +6545,8 @@ select_alias:
optional_braces:
/* empty */ {}
| '(' ')' {};
| '(' ')' {}
;
/* all possible expressions */
expr:
......@@ -6329,7 +6600,8 @@ bool_and_expr:
bool_factor:
NOT_SYM bool_factor { $$= negate_expression(YYTHD, $2); }
| bool_test ;
| bool_test
;
bool_test:
bool_pri IS TRUE_SYM
......@@ -6353,7 +6625,8 @@ bool_pri:
{ $$= (*$2)(0)->create($1,$3); }
| bool_pri comp_op all_or_any '(' subselect ')' %prec EQ
{ $$= all_any_subquery_creator($1, $2, $3, $5); }
| predicate ;
| predicate
;
predicate:
bit_expr IN_SYM '(' subselect ')'
......@@ -6397,8 +6670,10 @@ predicate:
$$= item;
}
| bit_expr SOUNDS_SYM LIKE bit_expr
{ $$= new Item_func_eq(new Item_func_soundex($1),
new Item_func_soundex($4)); }
{
$$= new Item_func_eq(new Item_func_soundex($1),
new Item_func_soundex($4));
}
| bit_expr LIKE simple_expr opt_escape
{ $$= new Item_func_like($1,$3,$4,Lex->escape_used); }
| bit_expr not LIKE simple_expr opt_escape
......@@ -6406,22 +6681,26 @@ predicate:
| bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); }
| bit_expr not REGEXP bit_expr
{ $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); }
| bit_expr ;
| bit_expr
;
bit_expr:
bit_expr '|' bit_term { $$= new Item_func_bit_or($1,$3); }
| bit_term ;
| bit_term
;
bit_term:
bit_term '&' bit_factor { $$= new Item_func_bit_and($1,$3); }
| bit_factor ;
| bit_factor
;
bit_factor:
bit_factor SHIFT_LEFT value_expr
{ $$= new Item_func_shift_left($1,$3); }
| bit_factor SHIFT_RIGHT value_expr
{ $$= new Item_func_shift_right($1,$3); }
| value_expr ;
| value_expr
;
value_expr:
value_expr '+' term { $$= new Item_func_plus($1,$3); }
......@@ -6430,7 +6709,8 @@ value_expr:
{ $$= new Item_date_add_interval($1,$3,$4,0); }
| value_expr '-' interval_expr interval
{ $$= new Item_date_add_interval($1,$3,$4,1); }
| term ;
| term
;
term:
term '*' factor { $$= new Item_func_mul($1,$3); }
......@@ -6438,18 +6718,36 @@ term:
| term '%' factor { $$= new Item_func_mod($1,$3); }
| term DIV_SYM factor { $$= new Item_func_int_div($1,$3); }
| term MOD_SYM factor { $$= new Item_func_mod($1,$3); }
| factor ;
| factor
;
factor:
factor '^' simple_expr { $$= new Item_func_bit_xor($1,$3); }
| simple_expr ;
| simple_expr
;
or:
OR_SYM
| OR2_SYM
;
and:
AND_SYM
| AND_AND_SYM
;
not:
NOT_SYM
| NOT2_SYM
;
or: OR_SYM | OR2_SYM;
and: AND_SYM | AND_AND_SYM;
not: NOT_SYM | NOT2_SYM;
not2: '!' | NOT2_SYM;
not2:
'!'
| NOT2_SYM
;
comp_op: EQ { $$ = &comp_eq_creator; }
comp_op:
EQ { $$ = &comp_eq_creator; }
| GE { $$ = &comp_ge_creator; }
| GT_SYM { $$ = &comp_gt_creator; }
| LE { $$ = &comp_le_creator; }
......@@ -6457,7 +6755,8 @@ comp_op: EQ { $$ = &comp_eq_creator; }
| NE { $$ = &comp_ne_creator; }
;
all_or_any: ALL { $$ = 1; }
all_or_any:
ALL { $$ = 1; }
| ANY_SYM { $$ = 0; }
;
......@@ -6556,8 +6855,10 @@ simple_expr:
$3);
}
| VALUES '(' simple_ident_nospvar ')'
{ $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
$3); }
{
$$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
$3);
}
| interval_expr interval '+' expr
/* we cannot put interval before - */
{ $$= new (YYTHD->mem_root) Item_date_add_interval($4,$1,$2,0); }
......@@ -7056,7 +7357,7 @@ sum_expr:
{ $$=new Item_sum_count_distinct(* $5); }
| MIN_SYM '(' in_sum_expr ')'
{ $$=new Item_sum_min($3); }
/*
/*
According to ANSI SQL, DISTINCT is allowed and has
no sense inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...)
is processed like an ordinary MIN | MAX()
......@@ -7090,7 +7391,8 @@ sum_expr:
$$=new Item_func_group_concat(Lex->current_context(), $3, $5,
sel->gorder_list, $7);
$5->empty();
};
}
;
variable:
'@'
......@@ -7134,15 +7436,16 @@ variable_aux:
opt_distinct:
/* empty */ { $$ = 0; }
|DISTINCT { $$ = 1; };
| DISTINCT { $$ = 1; }
;
opt_gconcat_separator:
/* empty */
{
$$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1);
}
| SEPARATOR_SYM text_string { $$ = $2; };
| SEPARATOR_SYM text_string { $$ = $2; }
;
opt_gorder_clause:
/* empty */
......@@ -7156,8 +7459,8 @@ opt_gorder_clause:
(SQL_LIST*) sql_memdup((char*) &select->order_list,
sizeof(st_sql_list));
select->order_list.empty();
};
}
;
in_sum_expr:
opt_all
......@@ -7173,20 +7476,32 @@ in_sum_expr:
{
Select->in_sum_expr--;
$$= $3;
};
}
;
cast_type:
BINARY opt_len { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
| CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; Lex->dec= 0; }
| NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
| SIGNED_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| SIGNED_SYM INT_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| UNSIGNED { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| UNSIGNED INT_SYM { $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DATE_SYM { $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| TIME_SYM { $$=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DATETIME { $$=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DECIMAL_SYM float_options { $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
BINARY opt_len
{ $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; Lex->dec= 0; }
| CHAR_SYM opt_len opt_binary
{ $$=ITEM_CAST_CHAR; Lex->dec= 0; }
| NCHAR_SYM opt_len
{ $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; Lex->dec=0; }
| SIGNED_SYM
{ $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| SIGNED_SYM INT_SYM
{ $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| UNSIGNED
{ $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| UNSIGNED INT_SYM
{ $$=ITEM_CAST_UNSIGNED_INT; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DATE_SYM
{ $$=ITEM_CAST_DATE; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| TIME_SYM
{ $$=ITEM_CAST_TIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DATETIME
{ $$=ITEM_CAST_DATETIME; Lex->charset= NULL; Lex->dec=Lex->length= (char*)0; }
| DECIMAL_SYM float_options
{ $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
;
opt_expr_list:
......@@ -7205,7 +7520,8 @@ expr_list2:
ident_list_arg:
ident_list { $$= $1; }
| '(' ident_list ')' { $$= $2; };
| '(' ident_list ')' { $$= $2; }
;
ident_list:
{ Select->expr_list.push_front(new List<Item>); }
......@@ -7218,11 +7534,13 @@ ident_list2:
opt_expr:
/* empty */ { $$= NULL; }
| expr { $$= $1; };
| expr { $$= $1; }
;
opt_else:
/* empty */ { $$= NULL; }
| ELSE expr { $$= $2; };
| ELSE expr { $$= $2; }
;
when_list:
WHEN_SYM expr THEN_SYM expr
......@@ -7271,7 +7589,7 @@ derived_table_list:
and subsequent optimization phases.
*/
join_table:
/* INNER JOIN variants */
/* INNER JOIN variants */
/*
Use %prec to evaluate production 'table_ref' before 'normal_join'
so that [INNER | CROSS] JOIN is properly nested as other
......@@ -7325,7 +7643,7 @@ join_table:
add_join_natural($1,$4,NULL,Select);
}
/* LEFT JOIN variants */
/* LEFT JOIN variants */
| table_ref LEFT opt_outer JOIN_SYM table_ref
ON
{
......@@ -7361,7 +7679,7 @@ join_table:
$$=$6;
}
/* RIGHT JOIN variants */
/* RIGHT JOIN variants */
| table_ref RIGHT opt_outer JOIN_SYM table_ref
ON
{
......@@ -7398,7 +7716,8 @@ join_table:
LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
MYSQL_YYABORT;
};
}
;
normal_join:
JOIN_SYM {}
......@@ -7476,8 +7795,7 @@ table_factor:
Permits parsing of "((((select ...))) as xyz)" */
$$= 0;
}
else
if (!$3)
else if (!$3)
{
/* Handle case of derived table, alias may be NULL if there
are no outer parentheses, add_table_to_list() will throw
......@@ -7486,16 +7804,15 @@ table_factor:
SELECT_LEX *sel= lex->current_select;
SELECT_LEX_UNIT *unit= sel->master_unit();
lex->current_select= sel= unit->outer_select();
if (!($$= sel->
add_table_to_list(lex->thd, new Table_ident(unit), $6, 0,
if (!($$= sel->add_table_to_list(lex->thd,
new Table_ident(unit), $6, 0,
TL_READ)))
MYSQL_YYABORT;
sel->add_joined_table($$);
lex->pop_context();
}
else
if ($4 || $6)
else if ($4 || $6)
{
/* simple nested joins cannot have aliases or unions */
my_parse_error(ER(ER_SYNTAX_ERROR));
......@@ -7586,7 +7903,8 @@ select_derived_init:
opt_outer:
/* empty */ {}
| OUTER {};
| OUTER {}
;
index_hint_clause:
/* empty */
......@@ -7638,11 +7956,10 @@ opt_key_usage_list:
;
key_usage_element:
ident { Select->add_index_hint(YYTHD, $1.str, $1.length); }
ident
{ Select->add_index_hint(YYTHD, $1.str, $1.length); }
| PRIMARY_SYM
{
Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7);
}
{ Select->add_index_hint(YYTHD, (char *)"PRIMARY", 7); }
;
key_usage_list:
......@@ -7665,7 +7982,8 @@ using_list:
String((const char *) $3.str, $3.length,
system_charset_info));
$$= $1;
};
}
;
interval:
interval_time_st {}
......@@ -7680,7 +7998,8 @@ interval:
| MINUTE_MICROSECOND_SYM { $$=INTERVAL_MINUTE_MICROSECOND; }
| MINUTE_SECOND_SYM { $$=INTERVAL_MINUTE_SECOND; }
| SECOND_MICROSECOND_SYM { $$=INTERVAL_SECOND_MICROSECOND; }
| YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; };
| YEAR_MONTH_SYM { $$=INTERVAL_YEAR_MONTH; }
;
interval_time_st:
DAY_SYM { $$=INTERVAL_DAY; }
......@@ -7704,12 +8023,14 @@ date_time_type:
table_alias:
/* empty */
| AS
| EQ;
| EQ
;
opt_table_alias:
/* empty */ { $$=0; }
| table_alias ident
{ $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); };
{ $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); }
;
opt_all:
/* empty */
......@@ -7763,20 +8084,21 @@ opt_escape:
}
;
/*
group by statement in select
*/
group_clause:
/* empty */
| GROUP_SYM BY group_list olap_opt;
| GROUP_SYM BY group_list olap_opt
;
group_list:
group_list ',' order_ident order_dir
{ if (add_group_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
| order_ident order_dir
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; };
{ if (add_group_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
;
olap_opt:
/* empty */ {}
......@@ -7835,7 +8157,8 @@ alter_order_item:
opt_order_clause:
/* empty */
| order_clause;
| order_clause
;
order_clause:
ORDER_SYM BY
......@@ -7867,19 +8190,22 @@ order_clause:
unit->add_fake_select_lex(lex->thd))
MYSQL_YYABORT;
}
} order_list;
}
order_list
;
order_list:
order_list ',' order_ident order_dir
{ if (add_order_to_list(YYTHD, $3,(bool) $4)) MYSQL_YYABORT; }
| order_ident order_dir
{ if (add_order_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; };
{ if (add_order_to_list(YYTHD, $1,(bool) $2)) MYSQL_YYABORT; }
;
order_dir:
/* empty */ { $$ = 1; }
| ASC { $$ =1; }
| DESC { $$ =0; };
| DESC { $$ =0; }
;
opt_limit_clause_init:
/* empty */
......@@ -7924,6 +8250,7 @@ limit_options:
sel->explicit_limit= 1;
}
;
limit_option:
param_marker
{
......@@ -7945,7 +8272,8 @@ delete_limit_clause:
SELECT_LEX *sel= Select;
sel->select_limit= $2;
sel->explicit_limit= 1;
};
}
;
ulong_num:
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
......@@ -8016,16 +8344,18 @@ procedure_clause:
MYSQL_YYABORT;
Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
}
'(' procedure_list ')';
'(' procedure_list ')'
;
procedure_list:
/* empty */ {}
| procedure_list2 {};
| procedure_list2 {}
;
procedure_list2:
procedure_list2 ',' procedure_item
| procedure_item;
| procedure_item
;
procedure_item:
remember_name expr remember_end
......@@ -8039,7 +8369,6 @@ procedure_item:
}
;
select_var_list_init:
{
LEX *lex=Lex;
......@@ -8143,7 +8472,8 @@ into_destination:
DO statement
*/
do: DO_SYM
do:
DO_SYM
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_DO;
......@@ -8254,7 +8584,8 @@ drop:
table_list:
table_name
| table_list ',' table_name;
| table_list ',' table_name
;
table_name:
table_ident
......@@ -8286,7 +8617,8 @@ insert:
mysql_init_select(lex);
/* for subselects */
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
} insert_lock_option
}
insert_lock_option
opt_ignore insert2
{
Select->set_lock_for_tables($3);
......@@ -8334,11 +8666,13 @@ insert_lock_option:
replace_lock_option:
opt_low_priority { $$= $1; }
| DELAYED_SYM { $$= TL_WRITE_DELAYED; };
| DELAYED_SYM { $$= TL_WRITE_DELAYED; }
;
insert2:
INTO insert_table {}
| insert_table {};
| insert_table {}
;
insert_table:
table_name
......@@ -8360,27 +8694,34 @@ insert_field_spec:
lex->many_values.push_back(lex->insert_list))
MYSQL_YYABORT;
}
ident_eq_list;
ident_eq_list
;
fields:
fields ',' insert_ident { Lex->field_list.push_back($3); }
| insert_ident { Lex->field_list.push_back($1); };
| insert_ident { Lex->field_list.push_back($1); }
;
insert_values:
VALUES values_list {}
| VALUE_SYM values_list {}
| create_select { Select->set_braces(0);} union_clause {}
| '(' create_select ')' { Select->set_braces(1);} union_opt {}
| create_select
{ Select->set_braces(0);}
union_clause {}
| '(' create_select ')'
{ Select->set_braces(1);}
union_opt {}
;
values_list:
values_list ',' no_braces
| no_braces;
| no_braces
;
ident_eq_list:
ident_eq_list ',' ident_eq_value
|
ident_eq_value;
| ident_eq_value
;
ident_eq_value:
simple_ident_nospvar equal expr_or_default
......@@ -8389,9 +8730,11 @@ ident_eq_value:
if (lex->field_list.push_back($1) ||
lex->insert_list->push_back($3))
MYSQL_YYABORT;
};
}
;
equal: EQ {}
equal:
EQ {}
| SET_VAR {}
;
......@@ -8411,11 +8754,13 @@ no_braces:
LEX *lex=Lex;
if (lex->many_values.push_back(lex->insert_list))
MYSQL_YYABORT;
};
}
;
opt_values:
/* empty */ {}
| values;
| values
;
values:
values ',' expr_or_default
......@@ -8477,18 +8822,21 @@ update:
update_list:
update_list ',' update_elem
| update_elem;
| update_elem
;
update_elem:
simple_ident_nospvar equal expr_or_default
{
if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3))
MYSQL_YYABORT;
};
}
;
insert_update_list:
insert_update_list ',' insert_update_elem
| insert_update_elem;
| insert_update_elem
;
insert_update_elem:
simple_ident_nospvar equal expr_or_default
......@@ -8497,11 +8845,13 @@ insert_update_elem:
if (lex->update_list.push_back($1) ||
lex->value_list.push_back($3))
MYSQL_YYABORT;
};
}
;
opt_low_priority:
/* empty */ { $$= TL_WRITE_DEFAULT; }
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; };
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
;
/* Delete rows from a table */
......@@ -8545,14 +8895,16 @@ single_multi:
table_wild_list:
table_wild_one {}
| table_wild_list ',' table_wild_one {};
| table_wild_list ',' table_wild_one {}
;
table_wild_one:
ident opt_wild opt_table_alias
{
if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
TL_OPTION_UPDATING |
TL_OPTION_ALIAS, Lex->lock_option))
if (!Select->add_table_to_list(YYTHD, new Table_ident($1),
$3,
TL_OPTION_UPDATING | TL_OPTION_ALIAS,
Lex->lock_option))
MYSQL_YYABORT;
}
| ident '.' ident opt_wild opt_table_alias
......@@ -8560,8 +8912,7 @@ table_wild_one:
if (!Select->add_table_to_list(YYTHD,
new Table_ident(YYTHD, $1, $3, 0),
$5,
TL_OPTION_UPDATING |
TL_OPTION_ALIAS,
TL_OPTION_UPDATING | TL_OPTION_ALIAS,
Lex->lock_option))
MYSQL_YYABORT;
}
......@@ -8569,17 +8920,19 @@ table_wild_one:
opt_wild:
/* empty */ {}
| '.' '*' {};
| '.' '*' {}
;
opt_delete_options:
/* empty */ {}
| opt_delete_option opt_delete_options {};
| opt_delete_option opt_delete_options {}
;
opt_delete_option:
QUICK { Select->options|= OPTION_QUICK; }
| LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
| IGNORE_SYM { Lex->ignore= 1; };
| IGNORE_SYM { Lex->ignore= 1; }
;
truncate:
TRUNCATE_SYM opt_table_sym table_name
......@@ -8594,11 +8947,13 @@ truncate:
opt_table_sym:
/* empty */
| TABLE_SYM;
| TABLE_SYM
;
/* Show things */
show: SHOW
show:
SHOW
{
LEX *lex=Lex;
lex->wild=0;
......@@ -8687,10 +9042,13 @@ show_param:
if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
MYSQL_YYABORT;
}
| NEW_SYM MASTER_SYM FOR_SYM SLAVE WITH MASTER_LOG_FILE_SYM EQ
TEXT_STRING_sys AND_SYM MASTER_LOG_POS_SYM EQ ulonglong_num
| NEW_SYM MASTER_SYM FOR_SYM SLAVE
WITH MASTER_LOG_FILE_SYM EQ
TEXT_STRING_sys /* $8 */
AND_SYM MASTER_LOG_POS_SYM EQ
ulonglong_num /* $12 */
AND_SYM MASTER_SERVER_ID_SYM EQ
ulong_num
ulong_num /* $16 */
{
Lex->sql_command = SQLCOM_SHOW_NEW_MASTER;
Lex->mi.log_file_name = $8.str;
......@@ -8937,41 +9295,51 @@ show_engine_param:
| MUTEX_SYM
{ Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; };
{ Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; }
;
master_or_binary:
MASTER_SYM
| BINARY;
| BINARY
;
opt_storage:
/* empty */
| STORAGE_SYM;
| STORAGE_SYM
;
opt_db:
/* empty */ { $$= 0; }
| from_or_in ident { $$= $2.str; };
| from_or_in ident { $$= $2.str; }
;
opt_full:
/* empty */ { Lex->verbose=0; }
| FULL { Lex->verbose=1; };
| FULL { Lex->verbose=1; }
;
from_or_in:
FROM
| IN_SYM;
| IN_SYM
;
binlog_in:
/* empty */ { Lex->mi.log_file_name = 0; }
| IN_SYM TEXT_STRING_sys { Lex->mi.log_file_name = $2.str; };
| IN_SYM TEXT_STRING_sys { Lex->mi.log_file_name = $2.str; }
;
binlog_from:
/* empty */ { Lex->mi.pos = 4; /* skip magic number */ }
| FROM ulonglong_num { Lex->mi.pos = $2; };
| FROM ulonglong_num { Lex->mi.pos = $2; }
;
wild_and_where:
/* empty */
| LIKE TEXT_STRING_sys
{ Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
system_charset_info); }
{
Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
system_charset_info);
}
| WHERE expr
{
Select->where= $2;
......@@ -8980,7 +9348,6 @@ wild_and_where:
}
;
/* A Oracle compatible synonym for show */
describe:
describe_command table_ident
......@@ -9007,7 +9374,8 @@ describe:
describe_command:
DESC
| DESCRIBE;
| DESCRIBE
;
opt_extended_describe:
/* empty */ {}
......@@ -9015,12 +9383,16 @@ opt_extended_describe:
| PARTITIONS_SYM { Lex->describe|= DESCRIBE_PARTITIONS; }
;
opt_describe_column:
/* empty */ {}
| text_string { Lex->wild= $1; }
| ident
{ Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); };
{
Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,
$1.length,
system_charset_info);
}
;
/* flush things */
......@@ -9039,42 +9411,60 @@ flush:
flush_options:
flush_options ',' flush_option
| flush_option;
| flush_option
;
flush_option:
table_or_tables { Lex->type|= REFRESH_TABLES; } opt_table_list {}
| TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
| QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE_FREE; }
| HOSTS_SYM { Lex->type|= REFRESH_HOSTS; }
| PRIVILEGES { Lex->type|= REFRESH_GRANT; }
| LOGS_SYM { Lex->type|= REFRESH_LOG; }
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| DES_KEY_FILE { Lex->type|= REFRESH_DES_KEY_FILE; }
| RESOURCES { Lex->type|= REFRESH_USER_RESOURCES; };
table_or_tables
{ Lex->type|= REFRESH_TABLES; }
opt_table_list {}
| TABLES WITH READ_SYM LOCK_SYM
{ Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; }
| QUERY_SYM CACHE_SYM
{ Lex->type|= REFRESH_QUERY_CACHE_FREE; }
| HOSTS_SYM
{ Lex->type|= REFRESH_HOSTS; }
| PRIVILEGES
{ Lex->type|= REFRESH_GRANT; }
| LOGS_SYM
{ Lex->type|= REFRESH_LOG; }
| STATUS_SYM
{ Lex->type|= REFRESH_STATUS; }
| SLAVE
{ Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM
{ Lex->type|= REFRESH_MASTER; }
| DES_KEY_FILE
{ Lex->type|= REFRESH_DES_KEY_FILE; }
| RESOURCES
{ Lex->type|= REFRESH_USER_RESOURCES; }
;
opt_table_list:
/* empty */ {;}
| table_list {;};
/* empty */ {}
| table_list {}
;
reset:
RESET_SYM
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_RESET; lex->type=0;
} reset_options
}
reset_options
{}
;
reset_options:
reset_options ',' reset_option
| reset_option;
| reset_option
;
reset_option:
SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;};
| QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
;
purge:
PURGE
......@@ -9082,7 +9472,8 @@ purge:
LEX *lex=Lex;
lex->type=0;
lex->sql_command = SQLCOM_PURGE;
} purge_options
}
purge_options
{}
;
......@@ -9113,7 +9504,8 @@ kill:
lex->value_list.empty();
lex->value_list.push_front($3);
lex->sql_command= SQLCOM_KILL;
};
}
;
kill_option:
/* empty */ { Lex->type= 0; }
......@@ -9123,16 +9515,19 @@ kill_option:
/* change database */
use: USE_SYM ident
use:
USE_SYM ident
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_CHANGE_DB;
lex->select_lex.db= $2.str;
};
}
;
/* import, export of files */
load: LOAD DATA_SYM
load:
LOAD DATA_SYM
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
......@@ -9147,8 +9542,7 @@ load: LOAD DATA_SYM
}
load_data
{}
|
LOAD TABLE_SYM table_ident FROM MASTER_SYM
| LOAD TABLE_SYM table_ident FROM MASTER_SYM
{
LEX *lex=Lex;
WARN_DEPRECATED(yythd, "5.2", "LOAD TABLE FROM MASTER",
......@@ -9161,7 +9555,8 @@ load: LOAD DATA_SYM
lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
if (!Select->add_table_to_list(YYTHD, $3, NULL, TL_OPTION_UPDATING))
MYSQL_YYABORT;
};
}
;
load_data:
load_data_lock opt_local INFILE TEXT_STRING_filesystem
......@@ -9197,18 +9592,19 @@ load_data:
opt_field_term opt_line_term opt_ignore_lines opt_field_or_var_spec
opt_load_data_set_spec
{}
|
FROM MASTER_SYM
| FROM MASTER_SYM
{
Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
WARN_DEPRECATED(yythd, "5.2", "LOAD DATA FROM MASTER",
"mysqldump or future "
"BACKUP/RESTORE DATABASE facility");
};
}
;
opt_local:
/* empty */ { $$=0;}
| LOCAL_SYM { $$=1;};
| LOCAL_SYM { $$=1;}
;
load_data_lock:
/* empty */ { $$= TL_WRITE_DEFAULT; }
......@@ -9224,21 +9620,24 @@ load_data_lock:
#endif
$$= TL_WRITE_CONCURRENT_INSERT;
}
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; };
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
;
opt_duplicate:
/* empty */ { Lex->duplicates=DUP_ERROR; }
| REPLACE { Lex->duplicates=DUP_REPLACE; }
| IGNORE_SYM { Lex->ignore= 1; };
| IGNORE_SYM { Lex->ignore= 1; }
;
opt_field_term:
/* empty */
| COLUMNS field_term_list;
| COLUMNS field_term_list
;
field_term_list:
field_term_list field_term
| field_term;
| field_term
;
field_term:
TERMINATED BY text_string
......@@ -9262,15 +9661,18 @@ field_term:
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->escaped= $3;
};
}
;
opt_line_term:
/* empty */
| LINES line_term_list;
| LINES line_term_list
;
line_term_list:
line_term_list line_term
| line_term;
| line_term
;
line_term:
TERMINATED BY text_string
......@@ -9282,7 +9684,8 @@ line_term:
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->line_start= $3;
};
}
;
opt_ignore_lines:
/* empty */
......@@ -9290,12 +9693,14 @@ opt_ignore_lines:
{
DBUG_ASSERT(Lex->exchange != 0);
Lex->exchange->skip_lines= atol($2.str);
};
}
;
opt_field_or_var_spec:
/* empty */ { }
| '(' fields_or_vars ')' { }
| '(' ')' { };
/* empty */ {}
| '(' fields_or_vars ')' {}
| '(' ')' {}
;
fields_or_vars:
fields_or_vars ',' field_or_var
......@@ -9311,9 +9716,9 @@ field_or_var:
;
opt_load_data_set_spec:
/* empty */ { }
| SET insert_update_list { };
/* empty */ {}
| SET insert_update_list {}
;
/* Common definitions */
......@@ -9369,7 +9774,11 @@ text_literal:
text_string:
TEXT_STRING_literal
{ $$= new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); }
{
$$= new (YYTHD->mem_root) String($1.str,
$1.length,
YYTHD->variables.collation_connection);
}
| HEX_NUM
{
Item *tmp= new Item_hex_string($1.str, $1.length);
......@@ -9424,7 +9833,6 @@ signed_literal:
}
;
literal:
text_literal { $$ = $1; }
| NUM_literal { $$ = $1; }
......@@ -9469,12 +9877,22 @@ literal:
}
| DATE_SYM text_literal { $$ = $2; }
| TIME_SYM text_literal { $$ = $2; }
| TIMESTAMP text_literal { $$ = $2; };
| TIMESTAMP text_literal { $$ = $2; }
;
NUM_literal:
NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
| LONG_NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
NUM
{
int error;
$$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length);
}
| LONG_NUM
{
int error;
$$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length);
}
| ULONGLONG_NUM
{ $$ = new Item_uint($1.str, $1.length); }
| DECIMAL_NUM
{
$$= new Item_decimal($1.str, $1.length, YYTHD->charset());
......@@ -9499,7 +9917,8 @@ NUM_literal:
insert_ident:
simple_ident_nospvar { $$=$1; }
| table_wild { $$=$1; };
| table_wild { $$=$1; }
;
table_wild:
ident '.' '*'
......@@ -9519,7 +9938,8 @@ table_wild:
;
order_ident:
expr { $$=$1; };
expr { $$=$1; }
;
simple_ident:
ident
......@@ -9625,8 +10045,7 @@ simple_ident_q:
in trigger.
*/
lex->trg_table_fields.link_in_list((uchar*) trg_fld,
(uchar**) &trg_fld->
next_trg_field);
(uchar**) &trg_fld->next_trg_field);
$$= (Item *)trg_fld;
}
......@@ -9679,8 +10098,8 @@ simple_ident_q:
(YYTHD->client_capabilities &
CLIENT_NO_SCHEMA ? NullS : $1.str),
$3.str, $5.str);
};
}
;
field_ident:
ident { $$=$1;}
......@@ -9710,7 +10129,8 @@ field_ident:
}
$$=$3;
}
| '.' ident { $$=$2;} /* For Delphi */;
| '.' ident { $$=$2;} /* For Delphi */
;
table_ident:
ident { $$=new Table_ident($1); }
......@@ -9719,7 +10139,11 @@ table_ident:
;
table_ident_nodb:
ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); }
ident
{
LEX_STRING db={(char*) any_db,3};
$$=new Table_ident(YYTHD, db,$1,0);
}
;
IDENT_sys:
......@@ -9775,7 +10199,6 @@ TEXT_STRING_literal:
}
;
TEXT_STRING_filesystem:
TEXT_STRING
{
......@@ -9818,7 +10241,8 @@ label_ident:
ident_or_text:
ident { $$=$1;}
| TEXT_STRING_sys { $$=$1;}
| LEX_HOSTNAME { $$=$1;};
| LEX_HOSTNAME { $$=$1;}
;
user:
ident_or_text
......@@ -9859,7 +10283,8 @@ user:
later
*/
bzero($$, sizeof(LEX_USER));
};
}
;
/* Keyword that we allow for identifiers (except SP labels) */
keyword:
......@@ -10188,11 +10613,13 @@ set:
opt_option:
/* empty */ {}
| OPTION {};
| OPTION {}
;
option_value_list:
option_type_value
| option_value_list ',' option_type_value;
| option_value_list ',' option_type_value
;
option_type_value:
{
......@@ -10270,7 +10697,8 @@ option_type_value:
}
lex->sphead->restore_lex(thd);
}
};
}
;
option_type:
option_type2 {}
......@@ -10300,7 +10728,8 @@ opt_var_ident_type:
ext_option_value:
sys_option_value
| option_type2 option_value;
| option_type2 option_value
;
sys_option_value:
option_type internal_variable_name equal set_expr_or_default
......@@ -10588,7 +11017,6 @@ set_expr_or_default:
| BINARY { $$=new Item_string("binary", 6, system_charset_info); }
;
/* Lock function */
lock:
......@@ -10609,11 +11037,13 @@ lock:
table_or_tables:
TABLE_SYM
| TABLES;
| TABLES
;
table_lock_list:
table_lock
| table_lock_list ',' table_lock;
| table_lock_list ',' table_lock
;
table_lock:
table_ident opt_table_alias lock_option
......@@ -10624,9 +11054,9 @@ table_lock:
;
lock_option:
READ_SYM { $$=TL_READ_NO_INSERT; }
| WRITE_SYM { $$=TL_WRITE_DEFAULT; }
| LOW_PRIORITY WRITE_SYM { $$=TL_WRITE_LOW_PRIORITY; }
READ_SYM { $$= TL_READ_NO_INSERT; }
| WRITE_SYM { $$= TL_WRITE_DEFAULT; }
| LOW_PRIORITY WRITE_SYM { $$= TL_WRITE_LOW_PRIORITY; }
| READ_SYM LOCAL_SYM { $$= TL_READ; }
;
......@@ -10646,7 +11076,6 @@ unlock:
{}
;
/*
** Handler: direct access to ISAM functions
*/
......@@ -10720,7 +11149,9 @@ handler_rkey_function:
lex->ha_rkey_mode=$1;
if (!(lex->insert_list = new List_item))
MYSQL_YYABORT;
} '(' values ')' { }
}
'(' values ')'
{}
;
handler_rkey_mode:
......@@ -10745,8 +11176,7 @@ revoke_command:
lex->sql_command= SQLCOM_REVOKE;
lex->type= 0;
}
|
grant_privileges ON FUNCTION_SYM grant_ident FROM grant_list
| grant_privileges ON FUNCTION_SYM grant_ident FROM grant_list
{
LEX *lex= Lex;
if (lex->columns.elements)
......@@ -10756,10 +11186,8 @@ revoke_command:
}
lex->sql_command= SQLCOM_REVOKE;
lex->type= TYPE_ENUM_FUNCTION;
}
|
grant_privileges ON PROCEDURE grant_ident FROM grant_list
| grant_privileges ON PROCEDURE grant_ident FROM grant_list
{
LEX *lex= Lex;
if (lex->columns.elements)
......@@ -10770,8 +11198,7 @@ revoke_command:
lex->sql_command= SQLCOM_REVOKE;
lex->type= TYPE_ENUM_PROCEDURE;
}
|
ALL opt_privileges ',' GRANT OPTION FROM grant_list
| ALL opt_privileges ',' GRANT OPTION FROM grant_list
{
Lex->sql_command = SQLCOM_REVOKE_ALL;
}
......@@ -10790,8 +11217,7 @@ grant_command:
lex->sql_command= SQLCOM_GRANT;
lex->type= 0;
}
|
grant_privileges ON FUNCTION_SYM grant_ident TO_SYM grant_list
| grant_privileges ON FUNCTION_SYM grant_ident TO_SYM grant_list
require_clause grant_options
{
LEX *lex= Lex;
......@@ -10803,8 +11229,7 @@ grant_command:
lex->sql_command= SQLCOM_GRANT;
lex->type= TYPE_ENUM_FUNCTION;
}
|
grant_privileges ON PROCEDURE grant_ident TO_SYM grant_list
| grant_privileges ON PROCEDURE grant_ident TO_SYM grant_list
require_clause grant_options
{
LEX *lex= Lex;
......@@ -10820,10 +11245,11 @@ grant_command:
opt_table:
/* Empty */
| TABLE_SYM ;
| TABLE_SYM
;
grant_privileges:
object_privilege_list { }
object_privilege_list {}
| ALL opt_privileges
{
Lex->all_privileges= 1;
......@@ -10838,13 +11264,22 @@ opt_privileges:
object_privilege_list:
object_privilege
| object_privilege_list ',' object_privilege;
| object_privilege_list ',' object_privilege
;
object_privilege:
SELECT_SYM { Lex->which_columns = SELECT_ACL;} opt_column_list {}
| INSERT { Lex->which_columns = INSERT_ACL;} opt_column_list {}
| UPDATE_SYM { Lex->which_columns = UPDATE_ACL; } opt_column_list {}
| REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list {}
SELECT_SYM
{ Lex->which_columns = SELECT_ACL;}
opt_column_list {}
| INSERT
{ Lex->which_columns = INSERT_ACL;}
opt_column_list {}
| UPDATE_SYM
{ Lex->which_columns = UPDATE_ACL; }
opt_column_list {}
| REFERENCES
{ Lex->which_columns = REFERENCES_ACL;}
opt_column_list {}
| DELETE_SYM { Lex->grant |= DELETE_ACL;}
| USAGE {}
| INDEX_SYM { Lex->grant |= INDEX_ACL;}
......@@ -10872,7 +11307,6 @@ object_privilege:
| TRIGGER_SYM { Lex->grant |= TRIGGER_ACL; }
;
opt_and:
/* empty */ {}
| AND_SYM {}
......@@ -10969,9 +11403,12 @@ grant_ident:
}
;
user_list:
user { if (Lex->users_list.push_back($1)) MYSQL_YYABORT;}
user
{
if (Lex->users_list.push_back($1))
MYSQL_YYABORT;
}
| user_list ',' user
{
if (Lex->users_list.push_back($3))
......@@ -10979,9 +11416,12 @@ user_list:
}
;
grant_list:
grant_user { if (Lex->users_list.push_back($1)) MYSQL_YYABORT;}
grant_user
{
if (Lex->users_list.push_back($1))
MYSQL_YYABORT;
}
| grant_list ',' grant_user
{
if (Lex->users_list.push_back($3))
......@@ -10989,7 +11429,6 @@ grant_list:
}
;
grant_user:
user IDENTIFIED_SYM BY TEXT_STRING
{
......@@ -11022,18 +11461,19 @@ grant_user:
{ $$= $1; $1->password= null_lex_str; }
;
opt_column_list:
/* empty */
{
LEX *lex=Lex;
lex->grant |= lex->which_columns;
}
| '(' column_list ')';
| '(' column_list ')'
;
column_list:
column_list ',' column_list_id
| column_list_id;
| column_list_id
;
column_list_id:
ident
......@@ -11056,8 +11496,8 @@ column_list_id:
}
;
require_clause: /* empty */
require_clause:
/* empty */
| REQUIRE_SYM require_list
{
Lex->ssl_type=SSL_TYPE_SPECIFIED;
......@@ -11078,7 +11518,8 @@ require_clause: /* empty */
grant_options:
/* empty */ {}
| WITH grant_option_list;
| WITH grant_option_list
;
grant_option_list:
grant_option_list grant_option {}
......@@ -11129,16 +11570,18 @@ opt_work:
;
opt_chain:
/* empty */ { $$= (YYTHD->variables.completion_type == 1); }
/* empty */
{ $$= (YYTHD->variables.completion_type == 1); }
| AND_SYM NO_SYM CHAIN_SYM { $$=0; }
| AND_SYM CHAIN_SYM { $$=1; }
;
opt_release:
/* empty */ { $$= (YYTHD->variables.completion_type == 2); }
/* empty */
{ $$= (YYTHD->variables.completion_type == 2); }
| RELEASE_SYM { $$=1; }
| NO_SYM RELEASE_SYM { $$=0; }
;
;
opt_savepoint:
/* empty */ {}
......@@ -11298,13 +11741,15 @@ subselect:
while ((item= it++))
add_item_to_list(thd, item);
}
union_clause subselect_end { $$= $3; };
union_clause subselect_end { $$= $3; }
;
subselect_init:
select_init2
{
$$= Lex->current_select->master_unit()->first_select();
};
}
;
subselect_start:
{
......@@ -11324,7 +11769,8 @@ subselect_start:
*/
if (mysql_new_select(Lex, 1))
MYSQL_YYABORT;
};
}
;
subselect_end:
{
......@@ -11340,7 +11786,8 @@ subselect_end:
*/
lex->current_select->select_n_where_fields+=
child->select_n_where_fields;
};
}
;
/**************************************************************************
......@@ -11709,7 +12156,8 @@ sp_tail:
/*************************************************************************/
xa: XA_SYM begin_or_start xid opt_join_or_resume
xa:
XA_SYM begin_or_start xid opt_join_or_resume
{
Lex->sql_command = SQLCOM_XA_START;
}
......@@ -11735,7 +12183,8 @@ xa: XA_SYM begin_or_start xid opt_join_or_resume
}
;
xid: text_string
xid:
text_string
{
MYSQL_YYABORT_UNLESS($1->length() <= MAXGTRIDSIZE);
if (!(Lex->xid=(XID *)YYTHD->alloc(sizeof(XID))))
......@@ -11758,7 +12207,8 @@ xid: text_string
}
;
begin_or_start: BEGIN_SYM {}
begin_or_start:
BEGIN_SYM {}
| START_SYM {}
;
......@@ -11774,13 +12224,15 @@ opt_one_phase:
;
opt_suspend:
/* nothing */ { Lex->xa_opt=XA_NONE; }
| SUSPEND_SYM { Lex->xa_opt=XA_SUSPEND; }
/* nothing */
{ Lex->xa_opt=XA_NONE; }
| SUSPEND_SYM
{ Lex->xa_opt=XA_SUSPEND; }
opt_migrate
;
opt_migrate:
/* nothing */ { }
/* nothing */ {}
| FOR_SYM MIGRATE_SYM { Lex->xa_opt=XA_FOR_MIGRATE; }
;
......@@ -11791,7 +12243,8 @@ install:
lex->sql_command= SQLCOM_INSTALL_PLUGIN;
lex->comment= $3;
lex->ident= $5;
};
}
;
uninstall:
UNINSTALL_SYM PLUGIN_SYM ident
......@@ -11799,4 +12252,6 @@ uninstall:
LEX *lex= Lex;
lex->sql_command= SQLCOM_UNINSTALL_PLUGIN;
lex->comment= $3;
};
}
;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment