diff options
author | Luis Soares <luis.soares@sun.com> | 2010-01-15 17:52:46 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-01-15 17:52:46 +0000 |
commit | 2afa7085e90a257d92f97c8c064cb26c6f95cfae (patch) | |
tree | 4e680d68b35762adf3eb7e8f66e5abfc728a1d03 /sql/log_event.h | |
parent | 54b2371e92a723ee9d44c282b3b1c5b7baf50f89 (diff) | |
download | mariadb-git-2afa7085e90a257d92f97c8c064cb26c6f95cfae.tar.gz |
BUG#49562: SBR out of sync when using numeric data types + user
variable
The User_var_log_event was not serializing the unsigned
flag. This would cause the slave to always assume signed values.
We fix this by extending the User_var_log_event to also contain
information on the unsigned_flag, meaning that it gets into the
binlog as well, therefore the slave will get this information as
well. Events without information on unsigned flag (old events)
are treated as they were before (always signed: unsigned_flag=
FALSE).
The information on the unsigned_flag, is shipped in an extra byte
appended to the end of the User_var_log_event and added by this
patch. This extra byte holds values for general purpose
User_var_log_event flags which are now packed in the binlog as
well. One of these flags contains information about whether the
value is signed or unsigned (currently this extra byte is only
used to hold data on the unsigned flag, in the future we can use
it to pack extra flags if there is the need to).
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index cba0264f4ae..9b91d826da7 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2483,6 +2483,10 @@ private: class User_var_log_event: public Log_event { public: + enum { + UNDEF_F= 0, + UNSIGNED_F= 1 + }; char *name; uint name_len; char *val; @@ -2490,12 +2494,14 @@ public: Item_result type; uint charset_number; bool is_null; + uchar flags; #ifndef MYSQL_CLIENT 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) + uint charset_number_arg, uchar flags_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), + flags(flags_arg) { is_null= !val; } void pack_info(Protocol* protocol); #else |