diff options
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 39f69b2656d..0dc71550b73 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2011, Oracle and/or its affiliates. + Copyright (c) 2005, 2012, Oracle and/or its affiliates. Copyright (c) 2010, 2011, Monty Program Ab This program is free software; you can redistribute it and/or modify @@ -1520,6 +1520,10 @@ int plugin_init(int *argc, char **argv, int flags) goto err; } + /* prepare debug_sync service */ + DBUG_ASSERT(strcmp(list_of_services[5].name, "debug_sync_service") == 0); + list_of_services[5].service= *(void**)&debug_sync_C_callback_ptr; + mysql_mutex_lock(&LOCK_plugin); initialized= 1; @@ -2381,11 +2385,11 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, { if (value->val_int(value, &tmp) < 0) goto err; - if (tmp > 1) + if (tmp != 0 && tmp != 1) goto err; result= (int) tmp; } - *(my_bool *) save= -result; + *(my_bool *) save= result ? 1 : 0; return 0; err: return 1; @@ -2575,7 +2579,7 @@ err: static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; + *(my_bool *) tgt= *(my_bool *) save ? 1 : 0; } |