/package/oracle-mysql/0005-bison_3_breaks_mysql_server_build.patch
Patch | 1421 lines | 1380 code | 41 blank | 0 comment | 0 complexity | fa271adb96185f54e2f1e960ed777e7e MD5 | raw file
- fix the yacc code in mysql
- Signed-off-by: Marcelo Gutierrez (UTN/FRH) <kuyurix@gmail.com>
- ---
- diff -uNr mysql-5.1.73.orig/sql/sql_lex.cc mysql-5.1.73/sql/sql_lex.cc
- --- mysql-5.1.73.orig/sql/sql_lex.cc 2013-11-04 18:52:27.000000000 +0000
- +++ mysql-5.1.73/sql/sql_lex.cc 2014-02-12 14:12:04.244111625 +0000
- @@ -775,14 +775,13 @@
- (which can't be followed by a signed number)
- */
-
- -int MYSQLlex(void *arg, void *yythd)
- +int MYSQLlex(void *arg, THD *thd)
- {
- reg1 uchar c= 0;
- bool comment_closed;
- int tokval, result_state;
- uint length;
- enum my_lex_states state;
- - THD *thd= (THD *)yythd;
- Lex_input_stream *lip= & thd->m_parser_state->m_lip;
- LEX *lex= thd->lex;
- YYSTYPE *yylval=(YYSTYPE*) arg;
- diff -uNr mysql-5.1.73.orig/sql/sql_lex.h mysql-5.1.73/sql/sql_lex.h
- --- mysql-5.1.73.orig/sql/sql_lex.h 2013-11-04 18:52:27.000000000 +0000
- +++ mysql-5.1.73/sql/sql_lex.h 2014-02-12 14:17:19.424106423 +0000
- @@ -2072,7 +2072,7 @@
- extern void lex_free(void);
- extern void lex_start(THD *thd);
- extern void lex_end(LEX *lex);
- -extern int MYSQLlex(void *arg, void *yythd);
- +extern int MYSQLlex(void *arg, THD *thd);
-
- extern void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str);
-
- diff -uNr mysql-5.1.73.orig/sql/sql_parse.cc mysql-5.1.73/sql/sql_parse.cc
- --- mysql-5.1.73.orig/sql/sql_parse.cc 2013-11-04 18:52:27.000000000 +0000
- +++ mysql-5.1.73/sql/sql_parse.cc 2014-02-12 14:19:20.424104427 +0000
- @@ -8012,7 +8012,7 @@
- }
-
-
- -extern int MYSQLparse(void *thd); // from sql_yacc.cc
- +extern int MYSQLparse(THD *thd); // from sql_yacc.cc
-
-
- /**
- diff -uNr mysql-5.1.73.orig/sql/sql_yacc.yy mysql-5.1.73/sql/sql_yacc.yy
- --- mysql-5.1.73.orig/sql/sql_yacc.yy 2013-11-04 18:52:27.000000000 +0000
- +++ mysql-5.1.73/sql/sql_yacc.yy 2014-02-12 20:17:06.707750140 +0000
- @@ -23,19 +23,13 @@
- */
-
- %{
- -/* thd is passed as an argument to yyparse(), and subsequently to yylex().
- -** The type will be void*, so it must be cast to (THD*) when used.
- -** Use the YYTHD macro for this.
- -*/
- -#define YYPARSE_PARAM yythd
- -#define YYLEX_PARAM yythd
- -#define YYTHD ((THD *)yythd)
- -#define YYLIP (& YYTHD->m_parser_state->m_lip)
- +
- +#define YYLIP (& thd->m_parser_state->m_lip)
-
- #define MYSQL_YACC
- #define YYINITDEPTH 100
- #define YYMAXDEPTH 3200 /* Because of 64K stack */
- -#define Lex (YYTHD->lex)
- +#define Lex (thd->lex)
- #define Select Lex->current_select
- #include "mysql_priv.h"
- #include "slave.h"
- @@ -55,7 +49,7 @@
- #pragma warning (disable : 4065)
- #endif
-
- -int yylex(void *yylval, void *yythd);
- +int yylex(void *yylval, THD *thd);
-
- const LEX_STRING null_lex_str= {0,0};
-
- @@ -64,7 +58,7 @@
- ulong val= *(F); \
- if (my_yyoverflow((B), (D), &val)) \
- { \
- - yyerror((char*) (A)); \
- + yyerror(current_thd, (char*) (A)); \
- return 2; \
- } \
- else \
- @@ -76,7 +70,7 @@
- #define MYSQL_YYABORT \
- do \
- { \
- - LEX::cleanup_lex_after_parse_error(YYTHD);\
- + LEX::cleanup_lex_after_parse_error(thd);\
- YYABORT; \
- } while (0)
-
- @@ -159,9 +153,8 @@
- to abort from the parser.
- */
-
- -void MYSQLerror(const char *s)
- +void MYSQLerror(THD *thd, const char *s)
- {
- - THD *thd= current_thd;
-
- /*
- Restore the original LEX if it was replaced when parsing
- @@ -675,7 +668,10 @@
- bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
- %}
-
- -%pure_parser /* We have threads */
- +/* We have threads */
- +%define api.pure
- +%parse-param { THD *thd }
- +%lex-param { THD *thd }
- /*
- Currently there are 169 shift/reduce conflicts.
- We should not introduce new conflicts any more.
- @@ -1516,7 +1512,6 @@
- query:
- END_OF_INPUT
- {
- - THD *thd= YYTHD;
- if (!thd->bootstrap &&
- (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT)))
- {
- @@ -1530,7 +1525,7 @@
- {
- Lex_input_stream *lip = YYLIP;
-
- - if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) &&
- + if ((thd->client_capabilities & CLIENT_MULTI_QUERIES) &&
- ! lip->stmt_prepare_mode &&
- ! lip->eof())
- {
- @@ -1626,7 +1621,6 @@
- deallocate:
- deallocate_or_drop PREPARE_SYM ident
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
- lex->prepared_stmt_name= $3;
- @@ -1641,7 +1635,6 @@
- prepare:
- PREPARE_SYM ident FROM prepare_src
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_PREPARE;
- lex->prepared_stmt_name= $2;
- @@ -1651,14 +1644,12 @@
- prepare_src:
- TEXT_STRING_sys
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->prepared_stmt_code= $1;
- lex->prepared_stmt_code_is_varref= FALSE;
- }
- | '@' ident_or_text
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->prepared_stmt_code= $2;
- lex->prepared_stmt_code_is_varref= TRUE;
- @@ -1668,7 +1659,6 @@
- execute:
- EXECUTE_SYM ident
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_EXECUTE;
- lex->prepared_stmt_name= $2;
- @@ -1826,7 +1816,6 @@
- create:
- CREATE opt_table_options TABLE_SYM opt_if_not_exists table_ident
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->sql_command= SQLCOM_CREATE_TABLE;
- if (!lex->select_lex.add_table_to_list(thd, $5, NULL,
- @@ -1844,13 +1833,13 @@
- }
- create2
- {
- - LEX *lex= YYTHD->lex;
- + LEX *lex= thd->lex;
- lex->current_select= &lex->select_lex;
- if ((lex->create_info.used_fields & HA_CREATE_USED_ENGINE) &&
- !lex->create_info.db_type)
- {
- - lex->create_info.db_type= ha_default_handlerton(YYTHD);
- - push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- + lex->create_info.db_type= ha_default_handlerton(thd);
- + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_WARN_USING_OTHER_HANDLER,
- ER(ER_WARN_USING_OTHER_HANDLER),
- ha_resolve_storage_engine_name(lex->create_info.db_type),
- @@ -1979,7 +1968,7 @@
- event_tail:
- remember_name EVENT_SYM opt_if_not_exists sp_name
- {
- - THD *thd= YYTHD;
- + THD *thd= thd;
- LEX *lex=Lex;
-
- lex->stmt_definition_begin= $1;
- @@ -2046,7 +2035,7 @@
- ev_starts:
- /* empty */
- {
- - Item *item= new (YYTHD->mem_root) Item_func_now_local();
- + Item *item= new (thd->mem_root) Item_func_now_local();
- if (item == NULL)
- MYSQL_YYABORT;
- Lex->event_parse_data->item_starts= item;
- @@ -2096,7 +2085,6 @@
-
- ev_sql_stmt:
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= YYLIP;
-
- @@ -2139,7 +2127,6 @@
- }
- ev_sql_stmt_inner
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
-
- /* return back to the original memory root ASAP */
- @@ -2198,11 +2185,10 @@
- $$= new sp_name($1, $3, true);
- if ($$ == NULL)
- MYSQL_YYABORT;
- - $$->init_qname(YYTHD);
- + $$->init_qname(thd);
- }
- | ident
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- LEX_STRING db;
- if (check_routine_name(&$1))
- @@ -2272,7 +2258,7 @@
- lex->sql_command= SQLCOM_CALL;
- lex->spname= $2;
- lex->value_list.empty();
- - sp_add_used_routine(lex, YYTHD, $2, TYPE_ENUM_PROCEDURE);
- + sp_add_used_routine(lex, thd, $2, TYPE_ENUM_PROCEDURE);
- }
- opt_sp_cparam_list {}
- ;
- @@ -2345,7 +2331,7 @@
- (enum enum_field_types)$3,
- sp_param_in);
-
- - if (lex->sphead->fill_field_definition(YYTHD, lex,
- + if (lex->sphead->fill_field_definition(thd, lex,
- (enum enum_field_types) $3,
- &spvar->field_def))
- {
- @@ -2382,7 +2368,7 @@
- (enum enum_field_types)$4,
- (sp_param_mode_t)$1);
-
- - if (lex->sphead->fill_field_definition(YYTHD, lex,
- + if (lex->sphead->fill_field_definition(thd, lex,
- (enum enum_field_types) $4,
- &spvar->field_def))
- {
- @@ -2445,13 +2431,12 @@
- {
- LEX *lex= Lex;
-
- - lex->sphead->reset_lex(YYTHD);
- + lex->sphead->reset_lex(thd);
- lex->spcont->declare_var_boundary($2);
- }
- type
- sp_opt_default
- {
- - THD *thd= YYTHD;
- LEX *lex= Lex;
- sp_pcontext *pctx= lex->spcont;
- uint num_vars= pctx->context_var_count();
- @@ -2477,7 +2462,7 @@
- spvar->type= var_type;
- spvar->dflt= dflt_value_item;
-
- - if (lex->sphead->fill_field_definition(YYTHD, lex, var_type,
- + if (lex->sphead->fill_field_definition(thd, lex, var_type,
- &spvar->field_def))
- {
- MYSQL_YYABORT;
- @@ -2501,7 +2486,7 @@
- }
-
- pctx->declare_var_boundary(0);
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- $$.vars= $2;
- $$.conds= $$.hndlrs= $$.curs= 0;
- @@ -2516,7 +2501,7 @@
- my_error(ER_SP_DUP_COND, MYF(0), $2.str);
- MYSQL_YYABORT;
- }
- - if(YYTHD->lex->spcont->push_cond(&$2, $5))
- + if(thd->lex->spcont->push_cond(&$2, $5))
- MYSQL_YYABORT;
- $$.vars= $$.hndlrs= $$.curs= 0;
- $$.conds= 1;
- @@ -2602,7 +2587,7 @@
-
- sp_cursor_stmt:
- {
- - Lex->sphead->reset_lex(YYTHD);
- + Lex->sphead->reset_lex(thd);
- }
- select
- {
- @@ -2618,7 +2603,7 @@
- }
- lex->sp_lex_in_use= TRUE;
- $$= lex;
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- }
- ;
- @@ -2662,7 +2647,7 @@
- sp_cond:
- ulong_num
- { /* mysql errno */
- - $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- + $$= (sp_cond_type_t *)thd->alloc(sizeof(sp_cond_type_t));
- if ($$ == NULL)
- MYSQL_YYABORT;
- $$->type= sp_cond_type_t::number;
- @@ -2675,7 +2660,7 @@
- my_error(ER_SP_BAD_SQLSTATE, MYF(0), $3.str);
- MYSQL_YYABORT;
- }
- - $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- + $$= (sp_cond_type_t *)thd->alloc(sizeof(sp_cond_type_t));
- if ($$ == NULL)
- MYSQL_YYABORT;
- $$->type= sp_cond_type_t::state;
- @@ -2705,21 +2690,21 @@
- }
- | SQLWARNING_SYM /* SQLSTATEs 01??? */
- {
- - $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- + $$= (sp_cond_type_t *)thd->alloc(sizeof(sp_cond_type_t));
- if ($$ == NULL)
- MYSQL_YYABORT;
- $$->type= sp_cond_type_t::warning;
- }
- | not FOUND_SYM /* SQLSTATEs 02??? */
- {
- - $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- + $$= (sp_cond_type_t *)thd->alloc(sizeof(sp_cond_type_t));
- if ($$ == NULL)
- MYSQL_YYABORT;
- $$->type= sp_cond_type_t::notfound;
- }
- | SQLEXCEPTION_SYM /* All other SQLSTATEs */
- {
- - $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
- + $$= (sp_cond_type_t *)thd->alloc(sizeof(sp_cond_type_t));
- if ($$ == NULL)
- MYSQL_YYABORT;
- $$->type= sp_cond_type_t::exception;
- @@ -2789,7 +2774,6 @@
-
- sp_proc_stmt_statement:
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= YYLIP;
-
- @@ -2798,7 +2782,6 @@
- }
- statement
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Lex_input_stream *lip= YYLIP;
- sp_head *sp= lex->sphead;
- @@ -2845,7 +2828,7 @@
-
- sp_proc_stmt_return:
- RETURN_SYM
- - { Lex->sphead->reset_lex(YYTHD); }
- + { Lex->sphead->reset_lex(thd); }
- expr
- {
- LEX *lex= Lex;
- @@ -2867,7 +2850,7 @@
- MYSQL_YYABORT;
- sp->m_flags|= sp_head::HAS_RETURN;
- }
- - if (sp->restore_lex(YYTHD))
- + if (sp->restore_lex(thd))
- MYSQL_YYABORT;
- }
- ;
- @@ -3094,7 +3077,7 @@
- ;
-
- sp_if:
- - { Lex->sphead->reset_lex(YYTHD); }
- + { Lex->sphead->reset_lex(thd); }
- expr THEN_SYM
- {
- LEX *lex= Lex;
- @@ -3108,7 +3091,7 @@
- sp->add_cont_backpatch(i) ||
- sp->add_instr(i))
- MYSQL_YYABORT;
- - if (sp->restore_lex(YYTHD))
- + if (sp->restore_lex(thd))
- MYSQL_YYABORT;
- }
- sp_proc_stmts1
- @@ -3147,7 +3130,7 @@
- {
- LEX *lex= Lex;
- case_stmt_action_case(lex);
- - lex->sphead->reset_lex(YYTHD); /* For expr $3 */
- + lex->sphead->reset_lex(thd); /* For expr $3 */
- }
- expr
- {
- @@ -3156,7 +3139,7 @@
- MYSQL_YYABORT;
-
- /* For expr $3 */
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- }
- simple_when_clause_list
- @@ -3198,7 +3181,7 @@
- simple_when_clause:
- WHEN_SYM
- {
- - Lex->sphead->reset_lex(YYTHD); /* For expr $3 */
- + Lex->sphead->reset_lex(thd); /* For expr $3 */
- }
- expr
- {
- @@ -3208,7 +3191,7 @@
- if (case_stmt_action_when(lex, $3, true))
- MYSQL_YYABORT;
- /* For expr $3 */
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- }
- THEN_SYM
- @@ -3223,7 +3206,7 @@
- searched_when_clause:
- WHEN_SYM
- {
- - Lex->sphead->reset_lex(YYTHD); /* For expr $3 */
- + Lex->sphead->reset_lex(thd); /* For expr $3 */
- }
- expr
- {
- @@ -3231,7 +3214,7 @@
- if (case_stmt_action_when(lex, $3, false))
- MYSQL_YYABORT;
- /* For expr $3 */
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- }
- THEN_SYM
- @@ -3395,7 +3378,7 @@
- MYSQL_YYABORT;
- }
- | WHILE_SYM
- - { Lex->sphead->reset_lex(YYTHD); }
- + { Lex->sphead->reset_lex(thd); }
- expr DO_SYM
- {
- LEX *lex= Lex;
- @@ -3409,7 +3392,7 @@
- sp->new_cont_backpatch(i) ||
- sp->add_instr(i))
- MYSQL_YYABORT;
- - if (sp->restore_lex(YYTHD))
- + if (sp->restore_lex(thd))
- MYSQL_YYABORT;
- }
- sp_proc_stmts1 END WHILE_SYM
- @@ -3424,7 +3407,7 @@
- lex->sphead->do_cont_backpatch();
- }
- | REPEAT_SYM sp_proc_stmts1 UNTIL_SYM
- - { Lex->sphead->reset_lex(YYTHD); }
- + { Lex->sphead->reset_lex(thd); }
- expr END REPEAT_SYM
- {
- LEX *lex= Lex;
- @@ -3436,7 +3419,7 @@
- if (i == NULL ||
- lex->sphead->add_instr(i))
- MYSQL_YYABORT;
- - if (lex->sphead->restore_lex(YYTHD))
- + if (lex->sphead->restore_lex(thd))
- MYSQL_YYABORT;
- /* We can shortcut the cont_backpatch here */
- i->m_cont_dest= ip+1;
- @@ -3859,7 +3842,6 @@
- create3 {}
- | LIKE table_ident
- {
- - THD *thd= YYTHD;
- TABLE_LIST *src_table;
- LEX *lex= thd->lex;
-
- @@ -3873,7 +3855,6 @@
- }
- | '(' LIKE table_ident ')'
- {
- - THD *thd= YYTHD;
- TABLE_LIST *src_table;
- LEX *lex= thd->lex;
-
- @@ -4342,7 +4323,6 @@
- bit_expr
- {
- Item *part_expr= $1;
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- Name_resolution_context *context= &lex->current_select->context;
- TABLE_LIST *save_list= context->table_list;
- @@ -4364,7 +4344,7 @@
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
- MYSQL_YYABORT;
- }
- - if (part_expr->fix_fields(YYTHD, (Item**)0) ||
- + if (part_expr->fix_fields(thd, (Item**)0) ||
- ((context->table_list= save_list), FALSE) ||
- (!part_expr->const_item()) ||
- (!lex->safe_to_cache_query))
- @@ -4629,7 +4609,7 @@
- | TYPE_SYM opt_equal storage_engines
- {
- Lex->create_info.db_type= $3;
- - WARN_DEPRECATED(yythd, "6.0", "TYPE=storage_engine",
- + WARN_DEPRECATED(thd, "6.0", "TYPE=storage_engine",
- "'ENGINE=storage_engine'");
- Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
- }
- @@ -4791,19 +4771,19 @@
- storage_engines:
- ident_or_text
- {
- - plugin_ref plugin= ha_resolve_by_name(YYTHD, &$1);
- + plugin_ref plugin= ha_resolve_by_name(thd, &$1);
-
- if (plugin)
- $$= plugin_data(plugin, handlerton*);
- else
- {
- - if (YYTHD->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
- + if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
- {
- my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), $1.str);
- MYSQL_YYABORT;
- }
- $$= 0;
- - push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_UNKNOWN_STORAGE_ENGINE,
- ER(ER_UNKNOWN_STORAGE_ENGINE),
- $1.str);
- @@ -4815,7 +4795,7 @@
- ident_or_text
- {
- plugin_ref plugin;
- - if ((plugin= ha_resolve_by_name(YYTHD, &$1)))
- + if ((plugin= ha_resolve_by_name(thd, &$1)))
- $$= plugin_data(plugin, handlerton*);
- else
- {
- @@ -5043,7 +5023,7 @@
- {
- char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1];
- my_snprintf(buff, sizeof(buff), "YEAR(%lu)", length);
- - push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_NOTE,
- + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_WARN_DEPRECATED_SYNTAX,
- ER(ER_WARN_DEPRECATED_SYNTAX),
- buff, "YEAR(4)");
- @@ -5057,7 +5037,7 @@
- { $$=MYSQL_TYPE_TIME; }
- | TIMESTAMP opt_field_length
- {
- - if (YYTHD->variables.sql_mode & MODE_MAXDB)
- + if (thd->variables.sql_mode & MODE_MAXDB)
- $$=MYSQL_TYPE_DATETIME;
- else
- {
- @@ -5189,7 +5169,7 @@
- real_type:
- REAL
- {
- - $$= YYTHD->variables.sql_mode & MODE_REAL_AS_FLOAT ?
- + $$= thd->variables.sql_mode & MODE_REAL_AS_FLOAT ?
- MYSQL_TYPE_FLOAT : MYSQL_TYPE_DOUBLE;
- }
- | DOUBLE_SYM
- @@ -5263,7 +5243,7 @@
- | DEFAULT now_or_signed_literal { Lex->default_value=$2; }
- | ON UPDATE_SYM NOW_SYM optional_braces
- {
- - Item *item= new (YYTHD->mem_root) Item_func_now_local();
- + Item *item= new (thd->mem_root) Item_func_now_local();
- if (item == NULL)
- MYSQL_YYABORT;
- Lex->on_update_value= item;
- @@ -5312,7 +5292,7 @@
- now_or_signed_literal:
- NOW_SYM optional_braces
- {
- - $$= new (YYTHD->mem_root) Item_func_now_local();
- + $$= new (thd->mem_root) Item_func_now_local();
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -5673,7 +5653,6 @@
- alter:
- ALTER opt_ignore TABLE_SYM table_ident
- {
- - THD *thd= YYTHD;
- LEX *lex= thd->lex;
- lex->name.str= 0;
- lex->name.length= 0;
- @@ -5799,7 +5778,7 @@
- Event_parse_data.
- */
-
- - if (!(Lex->event_parse_data= Event_parse_data::new_instance(YYTHD)))
- + if (!(Lex->event_parse_data= Event_parse_data::new_instance(thd)))
- MYSQL_YYABORT;
- Lex->event_parse_data->identifier= $4;
-
- @@ -6192,7 +6171,6 @@
- {
- if (!$4)
- {
- - THD *thd= YYTHD;
- $4= thd->variables.collation_database;
- }
- $5= $5 ? $5 : $4;
- @@ -6556,7 +6534,7 @@
- assign_to_keycache:
- table_ident cache_keys_spec
- {
- - if (!Select->add_table_to_list(YYTHD, $1, NULL, 0, TL_READ,
- + if (!Select->add_table_to_list(thd, $1, NULL, 0, TL_READ,
- Select->pop_index_hints()))
- MYSQL_YYABORT;
- }
- @@ -6585,7 +6563,7 @@
- preload_keys:
- table_ident cache_keys_spec opt_ignore_leaves
- {
- - if (!Select->add_table_to_list(YYTHD, $1, NULL, $3, TL_READ,
- + if (!Select->add_table_to_list(thd, $1, NULL, $3, TL_READ,
- Select->pop_index_hints()))
- MYSQL_YYABORT;
- }
- @@ -6593,7 +6571,7 @@
-
- cache_keys_spec:
- {
- - Lex->select_lex.alloc_index_hints(YYTHD);
- + Lex->select_lex.alloc_index_hints(thd);
- Select->set_index_hint_type(INDEX_HINT_USE,
- global_system_variables.old_mode ?
- INDEX_HINT_MASK_JOIN :
- @@ -6813,7 +6791,6 @@
- | select_item
- | '*'
- {
- - THD *thd= YYTHD;
- Item *item= new (thd->mem_root)
- Item_field(&thd->lex->current_select->context,
- NULL, NULL, "*");
- @@ -6828,7 +6805,6 @@
- select_item:
- remember_name select_item2 remember_end select_alias
- {
- - THD *thd= YYTHD;
- DBUG_ASSERT($1 < $3);
-
- if (add_item_to_list(thd, $2))
- @@ -6929,7 +6905,7 @@
- else
- {
- /* X OR Y */
- - $$ = new (YYTHD->mem_root) Item_cond_or($1, $3);
- + $$ = new (thd->mem_root) Item_cond_or($1, $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -6937,7 +6913,7 @@
- | expr XOR expr %prec XOR
- {
- /* XOR is a proprietary extension */
- - $$ = new (YYTHD->mem_root) Item_cond_xor($1, $3);
- + $$ = new (thd->mem_root) Item_cond_xor($1, $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -6979,50 +6955,50 @@
- else
- {
- /* X AND Y */
- - $$ = new (YYTHD->mem_root) Item_cond_and($1, $3);
- + $$ = new (thd->mem_root) Item_cond_and($1, $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- }
- | NOT_SYM expr %prec NOT_SYM
- {
- - $$= negate_expression(YYTHD, $2);
- + $$= negate_expression(thd, $2);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS TRUE_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_istrue($1);
- + $$= new (thd->mem_root) Item_func_istrue($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS not TRUE_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnottrue($1);
- + $$= new (thd->mem_root) Item_func_isnottrue($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS FALSE_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isfalse($1);
- + $$= new (thd->mem_root) Item_func_isfalse($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS not FALSE_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnotfalse($1);
- + $$= new (thd->mem_root) Item_func_isnotfalse($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS UNKNOWN_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnull($1);
- + $$= new (thd->mem_root) Item_func_isnull($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS not UNKNOWN_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnotnull($1);
- + $$= new (thd->mem_root) Item_func_isnotnull($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7032,19 +7008,19 @@
- bool_pri:
- bool_pri IS NULL_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnull($1);
- + $$= new (thd->mem_root) Item_func_isnull($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri IS not NULL_SYM %prec IS
- {
- - $$= new (YYTHD->mem_root) Item_func_isnotnull($1);
- + $$= new (thd->mem_root) Item_func_isnotnull($1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bool_pri EQUAL_SYM predicate %prec EQUAL_SYM
- {
- - $$= new (YYTHD->mem_root) Item_func_equal($1,$3);
- + $$= new (thd->mem_root) Item_func_equal($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7066,13 +7042,12 @@
- predicate:
- bit_expr IN_SYM '(' subselect ')'
- {
- - $$= new (YYTHD->mem_root) Item_in_subselect($1, $4);
- + $$= new (thd->mem_root) Item_in_subselect($1, $4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr not IN_SYM '(' subselect ')'
- {
- - THD *thd= YYTHD;
- Item *item= new (thd->mem_root) Item_in_subselect($1, $5);
- if (item == NULL)
- MYSQL_YYABORT;
- @@ -7082,7 +7057,7 @@
- }
- | bit_expr IN_SYM '(' expr ')'
- {
- - $$= handle_sql2003_note184_exception(YYTHD, $1, true, $4);
- + $$= handle_sql2003_note184_exception(thd, $1, true, $4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7090,13 +7065,13 @@
- {
- $6->push_front($4);
- $6->push_front($1);
- - $$= new (YYTHD->mem_root) Item_func_in(*$6);
- + $$= new (thd->mem_root) Item_func_in(*$6);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr not IN_SYM '(' expr ')'
- {
- - $$= handle_sql2003_note184_exception(YYTHD, $1, false, $5);
- + $$= handle_sql2003_note184_exception(thd, $1, false, $5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7104,7 +7079,7 @@
- {
- $7->push_front($5);
- $7->push_front($1);
- - Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*$7);
- + Item_func_in *item = new (thd->mem_root) Item_func_in(*$7);
- if (item == NULL)
- MYSQL_YYABORT;
- item->negate();
- @@ -7112,14 +7087,14 @@
- }
- | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate
- {
- - $$= new (YYTHD->mem_root) Item_func_between($1,$3,$5);
- + $$= new (thd->mem_root) Item_func_between($1,$3,$5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate
- {
- Item_func_between *item;
- - item= new (YYTHD->mem_root) Item_func_between($1,$4,$6);
- + item= new (thd->mem_root) Item_func_between($1,$4,$6);
- if (item == NULL)
- MYSQL_YYABORT;
- item->negate();
- @@ -7127,42 +7102,42 @@
- }
- | bit_expr SOUNDS_SYM LIKE bit_expr
- {
- - Item *item1= new (YYTHD->mem_root) Item_func_soundex($1);
- - Item *item4= new (YYTHD->mem_root) Item_func_soundex($4);
- + Item *item1= new (thd->mem_root) Item_func_soundex($1);
- + Item *item4= new (thd->mem_root) Item_func_soundex($4);
- if ((item1 == NULL) || (item4 == NULL))
- MYSQL_YYABORT;
- - $$= new (YYTHD->mem_root) Item_func_eq(item1, item4);
- + $$= new (thd->mem_root) Item_func_eq(item1, item4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr LIKE simple_expr opt_escape
- {
- - $$= new (YYTHD->mem_root) Item_func_like($1,$3,$4,Lex->escape_used);
- + $$= new (thd->mem_root) Item_func_like($1,$3,$4,Lex->escape_used);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr not LIKE simple_expr opt_escape
- {
- - Item *item= new (YYTHD->mem_root) Item_func_like($1,$4,$5,
- + Item *item= new (thd->mem_root) Item_func_like($1,$4,$5,
- Lex->escape_used);
- if (item == NULL)
- MYSQL_YYABORT;
- - $$= new (YYTHD->mem_root) Item_func_not(item);
- + $$= new (thd->mem_root) Item_func_not(item);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr REGEXP bit_expr
- {
- - $$= new (YYTHD->mem_root) Item_func_regex($1,$3);
- + $$= new (thd->mem_root) Item_func_regex($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr not REGEXP bit_expr
- {
- - Item *item= new (YYTHD->mem_root) Item_func_regex($1,$4);
- + Item *item= new (thd->mem_root) Item_func_regex($1,$4);
- if (item == NULL)
- MYSQL_YYABORT;
- - $$= negate_expression(YYTHD, item);
- + $$= negate_expression(thd, item);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7172,85 +7147,85 @@
- bit_expr:
- bit_expr '|' bit_expr %prec '|'
- {
- - $$= new (YYTHD->mem_root) Item_func_bit_or($1,$3);
- + $$= new (thd->mem_root) Item_func_bit_or($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '&' bit_expr %prec '&'
- {
- - $$= new (YYTHD->mem_root) Item_func_bit_and($1,$3);
- + $$= new (thd->mem_root) Item_func_bit_and($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
- {
- - $$= new (YYTHD->mem_root) Item_func_shift_left($1,$3);
- + $$= new (thd->mem_root) Item_func_shift_left($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
- {
- - $$= new (YYTHD->mem_root) Item_func_shift_right($1,$3);
- + $$= new (thd->mem_root) Item_func_shift_right($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '+' bit_expr %prec '+'
- {
- - $$= new (YYTHD->mem_root) Item_func_plus($1,$3);
- + $$= new (thd->mem_root) Item_func_plus($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '-' bit_expr %prec '-'
- {
- - $$= new (YYTHD->mem_root) Item_func_minus($1,$3);
- + $$= new (thd->mem_root) Item_func_minus($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '+' INTERVAL_SYM expr interval %prec '+'
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($1,$4,$5,0);
- + $$= new (thd->mem_root) Item_date_add_interval($1,$4,$5,0);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '-' INTERVAL_SYM expr interval %prec '-'
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($1,$4,$5,1);
- + $$= new (thd->mem_root) Item_date_add_interval($1,$4,$5,1);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '*' bit_expr %prec '*'
- {
- - $$= new (YYTHD->mem_root) Item_func_mul($1,$3);
- + $$= new (thd->mem_root) Item_func_mul($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '/' bit_expr %prec '/'
- {
- - $$= new (YYTHD->mem_root) Item_func_div($1,$3);
- + $$= new (thd->mem_root) Item_func_div($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '%' bit_expr %prec '%'
- {
- - $$= new (YYTHD->mem_root) Item_func_mod($1,$3);
- + $$= new (thd->mem_root) Item_func_mod($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr DIV_SYM bit_expr %prec DIV_SYM
- {
- - $$= new (YYTHD->mem_root) Item_func_int_div($1,$3);
- + $$= new (thd->mem_root) Item_func_int_div($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr MOD_SYM bit_expr %prec MOD_SYM
- {
- - $$= new (YYTHD->mem_root) Item_func_mod($1,$3);
- + $$= new (thd->mem_root) Item_func_mod($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | bit_expr '^' bit_expr
- {
- - $$= new (YYTHD->mem_root) Item_func_bit_xor($1,$3);
- + $$= new (thd->mem_root) Item_func_bit_xor($1,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7299,7 +7274,6 @@
- | function_call_conflict
- | simple_expr COLLATE_SYM ident_or_text %prec NEG
- {
- - THD *thd= YYTHD;
- Item *i1= new (thd->mem_root) Item_string($3.str,
- $3.length,
- thd->charset());
- @@ -7315,7 +7289,7 @@
- | sum_expr
- | simple_expr OR_OR_SYM simple_expr
- {
- - $$= new (YYTHD->mem_root) Item_func_concat($1, $3);
- + $$= new (thd->mem_root) Item_func_concat($1, $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7325,25 +7299,25 @@
- }
- | '-' simple_expr %prec NEG
- {
- - $$= new (YYTHD->mem_root) Item_func_neg($2);
- + $$= new (thd->mem_root) Item_func_neg($2);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | '~' simple_expr %prec NEG
- {
- - $$= new (YYTHD->mem_root) Item_func_bit_neg($2);
- + $$= new (thd->mem_root) Item_func_bit_neg($2);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | not2 simple_expr %prec NEG
- {
- - $$= negate_expression(YYTHD, $2);
- + $$= negate_expression(thd, $2);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | '(' subselect ')'
- {
- - $$= new (YYTHD->mem_root) Item_singlerow_subselect($2);
- + $$= new (thd->mem_root) Item_singlerow_subselect($2);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7352,20 +7326,20 @@
- | '(' expr ',' expr_list ')'
- {
- $4->push_front($2);
- - $$= new (YYTHD->mem_root) Item_row(*$4);
- + $$= new (thd->mem_root) Item_row(*$4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | ROW_SYM '(' expr ',' expr_list ')'
- {
- $5->push_front($3);
- - $$= new (YYTHD->mem_root) Item_row(*$5);
- + $$= new (thd->mem_root) Item_row(*$5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | EXISTS '(' subselect ')'
- {
- - $$= new (YYTHD->mem_root) Item_exists_subselect($3);
- + $$= new (thd->mem_root) Item_exists_subselect($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7374,7 +7348,7 @@
- | MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')'
- {
- $2->push_front($5);
- - Item_func_match *i1= new (YYTHD->mem_root) Item_func_match(*$2, $6);
- + Item_func_match *i1= new (thd->mem_root) Item_func_match(*$2, $6);
- if (i1 == NULL)
- MYSQL_YYABORT;
- Select->add_ftfunc_to_list(i1);
- @@ -7382,7 +7356,7 @@
- }
- | BINARY simple_expr %prec NEG
- {
- - $$= create_func_cast(YYTHD, $2, ITEM_CAST_CHAR, NULL, NULL,
- + $$= create_func_cast(thd, $2, ITEM_CAST_CHAR, NULL, NULL,
- &my_charset_bin);
- if ($$ == NULL)
- MYSQL_YYABORT;
- @@ -7390,27 +7364,27 @@
- | CAST_SYM '(' expr AS cast_type ')'
- {
- LEX *lex= Lex;
- - $$= create_func_cast(YYTHD, $3, $5, lex->length, lex->dec,
- + $$= create_func_cast(thd, $3, $5, lex->length, lex->dec,
- lex->charset);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CASE_SYM opt_expr when_list opt_else END
- {
- - $$= new (YYTHD->mem_root) Item_func_case(* $3, $2, $4 );
- + $$= new (thd->mem_root) Item_func_case(* $3, $2, $4 );
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CONVERT_SYM '(' expr ',' cast_type ')'
- {
- - $$= create_func_cast(YYTHD, $3, $5, Lex->length, Lex->dec,
- + $$= create_func_cast(thd, $3, $5, Lex->length, Lex->dec,
- Lex->charset);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CONVERT_SYM '(' expr USING charset_name ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_conv_charset($3,$5);
- + $$= new (thd->mem_root) Item_func_conv_charset($3,$5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7423,14 +7397,14 @@
- my_error(ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str);
- MYSQL_YYABORT;
- }
- - $$= new (YYTHD->mem_root) Item_default_value(Lex->current_context(),
- + $$= new (thd->mem_root) Item_default_value(Lex->current_context(),
- $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | VALUES '(' simple_ident_nospvar ')'
- {
- - $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(),
- + $$= new (thd->mem_root) Item_insert_value(Lex->current_context(),
- $3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- @@ -7438,7 +7412,7 @@
- | INTERVAL_SYM expr interval '+' expr %prec INTERVAL_SYM
- /* we cannot put interval before - */
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($5,$2,$3,0);
- + $$= new (thd->mem_root) Item_date_add_interval($5,$2,$3,0);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7453,19 +7427,19 @@
- function_call_keyword:
- CHAR_SYM '(' expr_list ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_char(*$3);
- + $$= new (thd->mem_root) Item_func_char(*$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CHAR_SYM '(' expr_list USING charset_name ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_char(*$3, $5);
- + $$= new (thd->mem_root) Item_func_char(*$3, $5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CURRENT_USER optional_braces
- {
- - $$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context());
- + $$= new (thd->mem_root) Item_func_current_user(Lex->current_context());
- if ($$ == NULL)
- MYSQL_YYABORT;
- Lex->set_stmt_unsafe();
- @@ -7473,31 +7447,30 @@
- }
- | DATE_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_date_typecast($3);
- + $$= new (thd->mem_root) Item_date_typecast($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | DAY_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_dayofmonth($3);
- + $$= new (thd->mem_root) Item_func_dayofmonth($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | HOUR_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_hour($3);
- + $$= new (thd->mem_root) Item_func_hour($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | INSERT '(' expr ',' expr ',' expr ',' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9);
- + $$= new (thd->mem_root) Item_func_insert($3,$5,$7,$9);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | INTERVAL_SYM '(' expr ',' expr ')' %prec INTERVAL_SYM
- {
- - THD *thd= YYTHD;
- List<Item> *list= new (thd->mem_root) List<Item>;
- if (list == NULL)
- MYSQL_YYABORT;
- @@ -7512,7 +7485,6 @@
- }
- | INTERVAL_SYM '(' expr ',' expr ',' expr_list ')' %prec INTERVAL_SYM
- {
- - THD *thd= YYTHD;
- $7->push_front($5);
- $7->push_front($3);
- Item_row *item= new (thd->mem_root) Item_row(*$7);
- @@ -7524,103 +7496,103 @@
- }
- | LEFT '(' expr ',' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_left($3,$5);
- + $$= new (thd->mem_root) Item_func_left($3,$5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | MINUTE_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_minute($3);
- + $$= new (thd->mem_root) Item_func_minute($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | MONTH_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_month($3);
- + $$= new (thd->mem_root) Item_func_month($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | RIGHT '(' expr ',' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_right($3,$5);
- + $$= new (thd->mem_root) Item_func_right($3,$5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | SECOND_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_second($3);
- + $$= new (thd->mem_root) Item_func_second($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TIME_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_time_typecast($3);
- + $$= new (thd->mem_root) Item_time_typecast($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TIMESTAMP '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_datetime_typecast($3);
- + $$= new (thd->mem_root) Item_datetime_typecast($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TIMESTAMP '(' expr ',' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_add_time($3, $5, 1, 0);
- + $$= new (thd->mem_root) Item_func_add_time($3, $5, 1, 0);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_trim($3);
- + $$= new (thd->mem_root) Item_func_trim($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' LEADING expr FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_ltrim($6,$4);
- + $$= new (thd->mem_root) Item_func_ltrim($6,$4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' TRAILING expr FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_rtrim($6,$4);
- + $$= new (thd->mem_root) Item_func_rtrim($6,$4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' BOTH expr FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_trim($6,$4);
- + $$= new (thd->mem_root) Item_func_trim($6,$4);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' LEADING FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_ltrim($5);
- + $$= new (thd->mem_root) Item_func_ltrim($5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' TRAILING FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_rtrim($5);
- + $$= new (thd->mem_root) Item_func_rtrim($5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' BOTH FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_trim($5);
- + $$= new (thd->mem_root) Item_func_trim($5);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | TRIM '(' expr FROM expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_trim($5,$3);
- + $$= new (thd->mem_root) Item_func_trim($5,$3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | USER '(' ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_user();
- + $$= new (thd->mem_root) Item_func_user();
- if ($$ == NULL)
- MYSQL_YYABORT;
- Lex->set_stmt_unsafe();
- @@ -7628,7 +7600,7 @@
- }
- | YEAR_SYM '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_year($3);
- + $$= new (thd->mem_root) Item_func_year($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- @@ -7649,34 +7621,34 @@
- function_call_nonkeyword:
- ADDDATE_SYM '(' expr ',' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($3, $5,
- + $$= new (thd->mem_root) Item_date_add_interval($3, $5,
- INTERVAL_DAY, 0);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 0);
- + $$= new (thd->mem_root) Item_date_add_interval($3, $6, $7, 0);
- if ($$ == NULL)
- MYSQL_YYABORT;
- }
- | CURDATE optional_braces
- {
- - $$= new (YYTHD->mem_root) Item_func_curdate_local();
- + $$= new (thd->mem_root) Item_func_curdate_local();
- if ($$ == NULL)
- MYSQL_YYABORT;
- Lex->safe_to_cache_query=0;
- }
- | CURTIME optional_braces
- {
- - $$= new (YYTHD->mem_root) Item_func_curtime_local();
- + $$= new (thd->mem_root) Item_func_curtime_local();
- if ($$ == NULL)
- MYSQL_YYABORT;
- Lex->safe_to_cache_query=0;
- }
- | CURTIME '(' expr ')'
- {
- - $$= new (YYTHD->mem_root) Item_func_curtime_local($3);
- + $$= new (thd->mem_root) Item_func_curtime_local($3);
- if ($$ == NULL)
- MYSQL_YYABORT;
- Lex->safe_to_cache_query=0;
- @@ -7684,83 +7656,83 @@
- | DATE_ADD_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')'
- %prec INTERVAL_SYM
- {
- - $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,0);
- + $$= new (thd->mem_root) Item_date_add_interval($3,$6,$7,0);
- if ($$ == NULL)
- MYSQL_YYABORT;
-