From b45f0cd09852a71381ae44f68f4c4b585ea0e4c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Aug 2005 17:34:34 +0400 Subject: Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs. "Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too. The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario. mysql-test/r/rpl_sp.result: Fix for BUG#12335: updated test cases/results mysql-test/t/rpl_sp.test: Fix for BUG#12335: updated test cases/results sql/item.cc: Fix for BUG#12335 (SP replication): - Added Item_name_const 'function' - Addede 'delete reuse' to call dtor on item reuse sql/item.h: Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' + code cleanup sql/item_create.cc: Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' sql/item_create.h: Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' sql/item_func.cc: Fix for BUG#12335 (SP replication) : binary log is now constrolled from within execute_function. sql/lex.h: Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' sql/log.cc: Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow one to temporary disable binlogging but collect a 'union' information about binlog write calls. sql/mysql_priv.h: Fix for BUG#12335 (SP replication) sql/sp_head.cc: Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for StoredRoutinesBinlogging for details sql/sp_head.h: Comments added sql/sp_pcontext.h: Comments added sql/sp_rcontext.h: Comments added sql/sql_class.cc: Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for StoredRoutinesBinlogging for details sql/sql_class.h: Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow one to temporary disable binlogging but collect a 'union' information about binlog write calls. sql/sql_delete.cc: Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog. sql/sql_insert.cc: Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog. sql/sql_lex.cc: Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from the tokenizer. sql/sql_lex.h: Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from the tokenizer. sql/sql_parse.cc: Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for StoredRoutinesBinlogging for details sql/sql_update.cc: Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog. sql/sql_yacc.yy: Fix for BUG#12335 (SP replication) : When creating Item_splocal, remember where it is located in the query. --- sql/sql_yacc.yy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index b446a06ded1..3727e2db5a3 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7133,10 +7133,13 @@ simple_ident: sp_pvar_t *spv; LEX *lex = Lex; sp_pcontext *spc = lex->spcont; - if (spc && (spv = spc->find_pvar(&$1))) - { /* We're compiling a stored procedure and found a variable */ - $$ = (Item*) new Item_splocal($1, spv->offset); + { + /* We're compiling a stored procedure and found a variable */ + Item_splocal *splocal; + splocal= new Item_splocal($1, spv->offset, lex->tok_start_prev - + lex->sphead->m_tmp_query); + $$ = (Item*) splocal; lex->variables_used= 1; lex->safe_to_cache_query=0; } -- cgit v1.2.1