diff options
author | aelkin/elkin@koti.dsl.inet.fi <> | 2007-12-12 12:14:59 +0200 |
---|---|---|
committer | aelkin/elkin@koti.dsl.inet.fi <> | 2007-12-12 12:14:59 +0200 |
commit | d8d6db6f78f115900167b7ded5ed84fa6f1d806b (patch) | |
tree | 84a421ca8e0f200a6b9023670d25f4572cf6a40d /sql/set_var.h | |
parent | cf56c586b7406ec0a9d26bc4c3b39585acc7b22e (diff) | |
download | mariadb-git-d8d6db6f78f115900167b7ded5ed84fa6f1d806b.tar.gz |
Bug#31552 Replication breaks when deleting rows from out-of-sync table
without PK
Bug#31609 Not all RBR slave errors reported as errors
bug#32468 delete rows event on a table with foreign key constraint fails
The first two bugs comprise idempotency issues.
First, there was no error code reported under conditions of the bug
description although the slave sql thread halted.
Second, executions were different with and without presence of prim key in
the table.
Third, there was no way to instruct the slave whether to ignore an error
and skip to the following event or to halt.
Fourth, there are handler errors which might happen due to idempotent
applying of binlog but those were not listed among the "idempotent" error
list.
All the named issues are addressed.
Wrt to the 3rd, there is the new global system variable, changeble at run
time, which controls the slave sql thread behaviour.
The new variable allows further extensions to mimic the sql_mode
session/global variable.
To address the 4th, the new bug#32468 had to be fixed as it was staying
in the way.
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index eb2c893c89e..6f44f7889d2 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -30,7 +30,8 @@ class sys_var_pluginvar; /* opaque */ typedef struct system_variables SV; typedef struct my_locale_st MY_LOCALE; -extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib; +extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib, + slave_exec_mode_typelib; typedef int (*sys_check_func)(THD *, set_var *); typedef bool (*sys_update_func)(THD *, set_var *); @@ -771,6 +772,42 @@ public: }; +class sys_var_set :public sys_var +{ +protected: + ulong *value; + TYPELIB *enum_names; +public: + sys_var_set(sys_var_chain *chain, const char *name_arg, ulong *value_arg, + TYPELIB *typelib, sys_after_update_func func) + :sys_var(name_arg, func), value(value_arg), enum_names(typelib) + { chain_sys_var(chain); } + virtual bool check(THD *thd, set_var *var) + { + return check_set(thd, var, enum_names); + } + virtual void set_default(THD *thd, enum_var_type type) + { + *value= 0; + } + bool update(THD *thd, set_var *var); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + bool check_update_type(Item_result type) { return 0; } + SHOW_TYPE show_type() { return SHOW_CHAR; } +}; + +class sys_var_set_slave_mode :public sys_var_set +{ +public: + sys_var_set_slave_mode(sys_var_chain *chain, const char *name_arg, + ulong *value_arg, + TYPELIB *typelib, sys_after_update_func func) : + sys_var_set(chain, name_arg, value_arg, typelib, func) {} + void set_default(THD *thd, enum_var_type type); + bool check(THD *thd, set_var *var); + bool update(THD *thd, set_var *var); +}; + class sys_var_log_output :public sys_var { ulong *value; @@ -1189,6 +1226,7 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length=0); int sql_set_variables(THD *thd, List<set_var_base> *var_list); bool not_all_support_one_shot(List<set_var_base> *var_list); void fix_delay_key_write(THD *thd, enum_var_type type); +void fix_slave_exec_mode(enum_var_type type); ulong fix_sql_mode(ulong sql_mode); extern sys_var_const_str sys_charset_system; extern sys_var_str sys_init_connect; |