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 /mysys | |
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 'mysys')
-rw-r--r-- | mysys/charset.c | 12 | ||||
-rw-r--r-- | mysys/my_getopt.c | 8 | ||||
-rw-r--r-- | mysys/queues.c | 2 | ||||
-rw-r--r-- | mysys/thr_lock.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index 692d7867fe0..9bd8de4316a 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -606,9 +606,9 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, is no character set with given name. */ -bool resolve_charset(const char *cs_name, - CHARSET_INFO *default_cs, - CHARSET_INFO **cs) +my_bool resolve_charset(const char *cs_name, + CHARSET_INFO *default_cs, + CHARSET_INFO **cs) { *cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)); @@ -638,9 +638,9 @@ bool resolve_charset(const char *cs_name, collation with given name. */ -bool resolve_collation(const char *cl_name, - CHARSET_INFO *default_cl, - CHARSET_INFO **cl) +my_bool resolve_collation(const char *cl_name, + CHARSET_INFO *default_cl, + CHARSET_INFO **cl) { *cl= get_charset_by_name(cl_name, MYF(0)); diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 5132ac820b8..6a7ee748930 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -795,10 +795,10 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err) */ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, - bool *fix) + my_bool *fix) { longlong old= num; - bool adjusted= FALSE; + my_bool adjusted= FALSE; char buf1[255], buf2[255]; ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L); @@ -864,9 +864,9 @@ static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err) ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - bool *fix) + my_bool *fix) { - bool adjusted= FALSE; + my_bool adjusted= FALSE; ulonglong old= num; char buf1[255], buf2[255]; diff --git a/mysys/queues.c b/mysys/queues.c index 94f49ab8f9c..9c85e493141 100644 --- a/mysys/queues.c +++ b/mysys/queues.c @@ -276,7 +276,7 @@ void _downheap(register QUEUE *queue, uint idx) { uchar *element; uint elements,half_queue,offset_to_key, next_index; - bool first= TRUE; + my_bool first= TRUE; uint start_idx= idx; offset_to_key=queue->offset_to_key; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 7f7be4835a5..a66836a35f5 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -121,7 +121,7 @@ thr_lock_owner_equal(THR_LOCK_OWNER *rhs, THR_LOCK_OWNER *lhs) static uint found_errors=0; static int check_lock(struct st_lock_list *list, const char* lock_type, - const char *where, my_bool same_owner, bool no_cond) + const char *where, my_bool same_owner, my_bool no_cond) { THR_LOCK_DATA *data,**prev; uint count=0; @@ -708,7 +708,7 @@ end: static inline void free_all_read_locks(THR_LOCK *lock, - bool using_concurrent_insert) + my_bool using_concurrent_insert) { THR_LOCK_DATA *data=lock->read_wait.data; @@ -1062,7 +1062,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count) TL_WRITE_ONLY to abort any new accesses to the lock */ -void thr_abort_locks(THR_LOCK *lock, bool upgrade_lock) +void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock) { THR_LOCK_DATA *data; DBUG_ENTER("thr_abort_locks"); |