summaryrefslogtreecommitdiffstats
path: root/mysql-plugin-bool.patch
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-plugin-bool.patch')
-rw-r--r--mysql-plugin-bool.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-plugin-bool.patch b/mysql-plugin-bool.patch
new file mode 100644
index 0000000..abea580
--- /dev/null
+++ b/mysql-plugin-bool.patch
@@ -0,0 +1,42 @@
+Fix plugin boolean variables to receive the value "1", not "-1", when they
+are set to 1. Aside from being bizarre, the existing behavior is unportable:
+machines where char is unsigned print "255" instead. Filed upstream at
+http://bugs.mysql.com/bug.php?id=59905
+
+
+diff -up mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result.p10 mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
+--- mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result.p10 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2012-12-06 14:20:53.078755855 +0100
+@@ -45,7 +45,7 @@ set session rpl_semi_sync_master_enabled
+ ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
+ select @@global.rpl_semi_sync_master_enabled;
+ @@global.rpl_semi_sync_master_enabled
+--1
++1
+ select @@session.rpl_semi_sync_master_enabled;
+ ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable
+ show global variables like 'rpl_semi_sync_master_enabled';
+diff -up mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result.p10 mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
+--- mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result.p10 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2012-12-06 14:20:53.078755855 +0100
+@@ -45,7 +45,7 @@ set session rpl_semi_sync_slave_enabled=
+ ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
+ select @@global.rpl_semi_sync_slave_enabled;
+ @@global.rpl_semi_sync_slave_enabled
+--1
++1
+ select @@session.rpl_semi_sync_slave_enabled;
+ ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable
+ show global variables like 'rpl_semi_sync_slave_enabled';
+diff -up mysql-5.5.28/sql/sql_plugin.cc.p10 mysql-5.5.28/sql/sql_plugin.cc
+--- mysql-5.5.28/sql/sql_plugin.cc.p10 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/sql_plugin.cc 2012-12-06 14:20:53.078755855 +0100
+@@ -2094,7 +2094,7 @@ static int check_func_bool(THD *thd, str
+ goto err;
+ result= (int) tmp;
+ }
+- *(my_bool *) save= -result;
++ *(my_bool *) save= result ? true : false;
+ return 0;
+ err:
+ return 1;