diff options
author | unknown <guilhem@gbichot4.local> | 2008-02-18 23:29:39 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot4.local> | 2008-02-18 23:29:39 +0100 |
commit | 85213f6235aa344f7861cc2f9a151869e041cb9e (patch) | |
tree | 7bffd7a5bcb1eea8fb0183e3a4e3a40cf6a783a6 /sql/sql_plugin.cc | |
parent | df2cf8c78dc022472dd22584a140f579ad8cfe03 (diff) | |
download | mariadb-git-85213f6235aa344f7861cc2f9a151869e041cb9e.tar.gz |
Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).
client/mysqldump.c:
my_bool for C
client/mysqltest.c:
my_bool for C
extra/replace.c:
my_bool for C
include/my_getopt.h:
my_bool for C
include/my_global.h:
Prevent people from using bool in C, it causes real bugs.
include/my_sys.h:
my_bool for C
include/my_time.h:
my_bool for C
include/thr_lock.h:
my_bool for C
libmysql/libmysql.c:
my_bool for C
mysys/charset.c:
my_bool for C
mysys/my_getopt.c:
my_bool for C
mysys/queues.c:
my_bool for C
mysys/thr_lock.c:
my_bool for C
regex/reginit.c:
my_bool for C
sql/set_var.cc:
C functions use my_bool so we must use my_bool too.
sql/sql_plugin.cc:
C functions use my_bool so we must use my_bool too.
This fixes a real observed bug of Maria, because on some Mac OS X,
sizeof(bool) is 1 in C and 4 in C++, so the bool* does wrong.
Removing useless line.
storage/heap/hp_update.c:
my_bool for C
storage/myisam/mi_check.c:
my_bool for C
storage/myisam/mi_dynrec.c:
my_bool for C
storage/myisam/mi_search.c:
my_bool for C
storage/myisam/mi_update.c:
my_bool for C
storage/myisam/mi_write.c:
my_bool for C
storage/myisam/myisamdef.h:
my_bool for C
storage/myisam/myisamlog.c:
my_bool for C
storage/myisam/myisampack.c:
my_bool for C
tests/mysql_client_test.c:
my_bool for C
unittest/mysys/bitmap-t.c:
my_bool for C
vio/viosslfactories.c:
my_bool for C
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 2a86844c8c6..37bc3b730b0 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1876,7 +1876,7 @@ err: static int check_func_int(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - bool fixed; + my_bool fixed; long long tmp; struct my_option options; value->val_int(value, &tmp); @@ -1904,7 +1904,7 @@ static int check_func_int(THD *thd, struct st_mysql_sys_var *var, static int check_func_long(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - bool fixed; + my_bool fixed; long long tmp; struct my_option options; value->val_int(value, &tmp); @@ -1932,12 +1932,11 @@ static int check_func_long(THD *thd, struct st_mysql_sys_var *var, static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var, void *save, st_mysql_value *value) { - bool fixed; + my_bool fixed; long long tmp; struct my_option options; value->val_int(value, &tmp); plugin_opt_set_limits(&options, var); - *(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed); if (var->flags & PLUGIN_VAR_UNSIGNED) *(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options, |