summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-04-01 12:04:26 +0300
committerMichael Widenius <monty@askmonty.org>2010-04-01 12:04:26 +0300
commit1aafea91e5e11c355b978c85544059224ec473cf (patch)
treea6fe26c7dc5503bdb62ef60d3e7d5f4ca2b816bb /sql/set_var.cc
parentfee40e27738122d5c7d7916a1cfa8cd2b5a20186 (diff)
parentcebec393cf0a5558a2800fb193ba098bda4eabe1 (diff)
downloadmariadb-git-1aafea91e5e11c355b978c85544059224ec473cf.tar.gz
Merge with 5.1
Fixed valgrind warnings found from running main.connect under valgrind sql/sp_head.cc: Ensure that vcol_info is reset sql/sql_acl.cc: Fixed usage of wrong memroot for password sql/sql_yacc.yy: Ensure that vcol_info is reset
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index e34fe7d5e7a..545b086865f 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1266,16 +1266,16 @@ uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type,
void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type)
{
- slave_exec_mode_options= 0;
- bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
+ slave_exec_mode_options= (ULL(1) << SLAVE_EXEC_MODE_STRICT);
}
bool sys_var_set_slave_mode::check(THD *thd, set_var *var)
{
bool rc= sys_var_set::check(thd, var);
if (!rc &&
- bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 &&
- bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
+ test_all_bits(var->save_result.ulong_value,
+ ((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
+ (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
rc= true;
my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), "");
@@ -1297,15 +1297,16 @@ void fix_slave_exec_mode(enum_var_type type)
DBUG_ENTER("fix_slave_exec_mode");
compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT
> SLAVE_EXEC_MODE_LAST_BIT - 1);
- if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
- bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
+ if (test_all_bits(slave_exec_mode_options,
+ ((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
+ (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
sql_print_error("Ambiguous slave modes combination."
" STRICT will be used");
- bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
+ slave_exec_mode_options&= ~(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT);
}
- if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
- bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
+ if (!(slave_exec_mode_options & (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT)))
+ slave_exec_mode_options|= (ULL(1)<< SLAVE_EXEC_MODE_STRICT);
DBUG_VOID_RETURN;
}