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