1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Bug#14275000

Fixes for BUG11761686 left a flaw that managed to slip away from testing.
Only effective filtering branch was actually tested with a regression test
added to rpl_filter_tables_not_exist.
The reason of the failure is destuction of too early mem-root-allocated memory 
at the end of the deferred User-var's do_apply_event().

Fixed with bypassing free_root() in the deferred execution branch.
Deallocation of created in do_apply_event() items is done by the base code
through THD::cleanup_after_query() -> free_items() that the parent Query
can't miss.
This commit is contained in:
Andrei Elkin
2012-07-05 14:37:48 +03:00
parent 176d6b1dca
commit dbd63d008f
2 changed files with 22 additions and 5 deletions

View File

@ -2483,11 +2483,13 @@ public:
uint charset_number;
bool is_null;
#ifndef MYSQL_CLIENT
bool deferred;
User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg,
char *val_arg, ulong val_len_arg, Item_result type_arg,
uint charset_number_arg)
:Log_event(), name(name_arg), name_len(name_len_arg), val(val_arg),
val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg)
val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),
deferred(false)
{ is_null= !val; }
void pack_info(Protocol* protocol);
#else
@ -2500,6 +2502,13 @@ public:
Log_event_type get_type_code() { return USER_VAR_EVENT;}
#ifndef MYSQL_CLIENT
bool write(IO_CACHE* file);
/*
Getter and setter for deferred User-event.
Returns true if the event is not applied directly
and which case the applier adjusts execution path.
*/
bool is_deferred() { return deferred; }
void set_deferred() { deferred= val; }
#endif
bool is_valid() const { return 1; }