mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
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.
This commit is contained in:
@@ -311,6 +311,9 @@ public:
|
||||
bool write(Log_event* event_info); // binary log write
|
||||
bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event);
|
||||
|
||||
void start_union_events(THD *thd);
|
||||
void stop_union_events(THD *thd);
|
||||
|
||||
/*
|
||||
v stands for vector
|
||||
invoked as appendv(buf1,len1,buf2,len2,...,bufn,lenn,0)
|
||||
@@ -1346,7 +1349,34 @@ public:
|
||||
my_bool my_bool_value;
|
||||
long long_value;
|
||||
} sys_var_tmp;
|
||||
|
||||
|
||||
/*
|
||||
If true, thd->query is not a suitable query to write to binary log. This
|
||||
is not handled everywhere currently - we check it only in statements
|
||||
that can have SP variable references.
|
||||
*/
|
||||
bool query_str_binlog_unsuitable;
|
||||
|
||||
struct {
|
||||
/*
|
||||
If true, mysql_bin_log::write(Log_event) call will not write events to
|
||||
binlog, and maintain 2 below variables instead (use
|
||||
mysql_bin_log.start_union_events to turn this on)
|
||||
*/
|
||||
bool do_union;
|
||||
/*
|
||||
If TRUE, at least one mysql_bin_log::write(Log_event) call has been
|
||||
made after last mysql_bin_log.start_union_events() call.
|
||||
*/
|
||||
bool unioned_events;
|
||||
/*
|
||||
If TRUE, at least one mysql_bin_log::write(Log_event e), where
|
||||
e.cache_stmt == TRUE call has been made after last
|
||||
mysql_bin_log.start_union_events() call.
|
||||
*/
|
||||
bool unioned_events_trans;
|
||||
} binlog_evt_union;
|
||||
|
||||
THD();
|
||||
~THD();
|
||||
|
||||
@@ -1968,7 +1998,12 @@ class multi_delete :public select_result_interceptor
|
||||
ha_rows deleted, found;
|
||||
uint num_of_tables;
|
||||
int error;
|
||||
bool do_delete, transactional_tables, normal_tables, delete_while_scanning;
|
||||
bool do_delete;
|
||||
/* True if at least one table we delete from is transactional */
|
||||
bool transactional_tables;
|
||||
/* True if at least one table we delete from is not transactional */
|
||||
bool normal_tables;
|
||||
bool delete_while_scanning;
|
||||
|
||||
public:
|
||||
multi_delete(TABLE_LIST *dt, uint num_of_tables);
|
||||
@@ -1995,7 +2030,10 @@ class multi_update :public select_result_interceptor
|
||||
uint table_count;
|
||||
Copy_field *copy_field;
|
||||
enum enum_duplicates handle_duplicates;
|
||||
bool do_update, trans_safe, transactional_tables, ignore;
|
||||
bool do_update, trans_safe;
|
||||
/* True if the update operation has made a change in a transactional table */
|
||||
bool transactional_tables;
|
||||
bool ignore;
|
||||
|
||||
public:
|
||||
multi_update(TABLE_LIST *ut, TABLE_LIST *leaves_list,
|
||||
|
||||
Reference in New Issue
Block a user