|
|
7a5573f |
Fix plugin boolean variables to receive the value "1", not "-1", when they
|
|
|
7a5573f |
are set to 1. Aside from being bizarre, the existing behavior is unportable:
|
|
|
7a5573f |
machines where char is unsigned print "255" instead. Filed upstream at
|
|
|
7a5573f |
http://bugs.mysql.com/bug.php?id=59905
|
|
|
7a5573f |
|
|
|
7a5573f |
|
|
|
7a5573f |
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
|
|
|
7a5573f |
--- 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
|
|
|
7a5573f |
+++ 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
|
|
|
7a5573f |
@@ -45,7 +45,7 @@ set session rpl_semi_sync_master_enabled
|
|
|
7a5573f |
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
|
|
|
7a5573f |
select @@global.rpl_semi_sync_master_enabled;
|
|
|
7a5573f |
@@global.rpl_semi_sync_master_enabled
|
|
|
7a5573f |
--1
|
|
|
7a5573f |
+1
|
|
|
7a5573f |
select @@session.rpl_semi_sync_master_enabled;
|
|
|
7a5573f |
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable
|
|
|
7a5573f |
show global variables like 'rpl_semi_sync_master_enabled';
|
|
|
7a5573f |
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
|
|
|
7a5573f |
--- 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
|
|
|
7a5573f |
+++ 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
|
|
|
7a5573f |
@@ -45,7 +45,7 @@ set session rpl_semi_sync_slave_enabled=
|
|
|
7a5573f |
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
|
|
|
7a5573f |
select @@global.rpl_semi_sync_slave_enabled;
|
|
|
7a5573f |
@@global.rpl_semi_sync_slave_enabled
|
|
|
7a5573f |
--1
|
|
|
7a5573f |
+1
|
|
|
7a5573f |
select @@session.rpl_semi_sync_slave_enabled;
|
|
|
7a5573f |
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable
|
|
|
7a5573f |
show global variables like 'rpl_semi_sync_slave_enabled';
|
|
|
7a5573f |
diff -up mysql-5.5.28/sql/sql_plugin.cc.p10 mysql-5.5.28/sql/sql_plugin.cc
|
|
|
7a5573f |
--- mysql-5.5.28/sql/sql_plugin.cc.p10 2012-08-29 10:50:46.000000000 +0200
|
|
|
7a5573f |
+++ mysql-5.5.28/sql/sql_plugin.cc 2012-12-06 14:20:53.078755855 +0100
|
|
|
7a5573f |
@@ -2094,7 +2094,7 @@ static int check_func_bool(THD *thd, str
|
|
|
7a5573f |
goto err;
|
|
|
7a5573f |
result= (int) tmp;
|
|
|
7a5573f |
}
|
|
|
7a5573f |
- *(my_bool *) save= -result;
|
|
|
7a5573f |
+ *(my_bool *) save= result ? true : false;
|
|
|
7a5573f |
return 0;
|
|
|
7a5573f |
err:
|
|
|
7a5573f |
return 1;
|