From d83f6470243057fdd542bed0410dcabe09766713 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 4 Dec 2008 02:36:55 +0200 Subject: [PATCH] Fixed warnings and errors discovered by pushbuild2 mysys/my_init.c: Fixed link error when compiling without thread support sql/item_create.cc: Fixed compiler warning sql/mysqld.cc: Fixed compile error on windows sql/protocol.cc: Fixed compiler warning sql/sql_class.cc: Fixed compiler warning sql/sql_class.h: Fixed compiler warning storage/myisam/mi_open.c: Fixed compiler warning storage/myisammrg/ha_myisammrg.cc: Fixed compiler warning (shadow variable) --- mysys/my_init.c | 2 ++ sql/item_create.cc | 2 +- sql/mysqld.cc | 2 +- sql/protocol.cc | 5 +++-- sql/sql_class.cc | 2 +- sql/sql_class.h | 2 +- storage/myisam/mi_open.c | 4 ++-- storage/myisammrg/ha_myisammrg.cc | 6 +++--- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index 453e62b19bb..6d79472edfa 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -199,7 +199,9 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", #endif #if defined(SAFEMALLOC) /* Wait for other threads to free mysys_var */ +#ifdef THREAD (void) my_wait_for_other_threads_to_die(1); +#endif TERMINATE(stderr, (infoflag & MY_GIVE_INFO) != 0); #elif defined(__WIN__) && defined(_MSC_VER) _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); diff --git a/sql/item_create.cc b/sql/item_create.cc index 349c47816ad..4a440c00da5 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -5118,7 +5118,7 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type, CHARSET_INFO *real_cs= (cs ? cs : thd->variables.collation_connection); if (c_len == NULL) { - len= LL(-1); + len= (ulong) -1L; } else { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 35cddbe60ce..11838089432 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1809,7 +1809,7 @@ void close_connection(THD *thd, uint errcode, bool lock) extern "C" sig_handler end_mysqld_signal(int sig __attribute__((unused))) { DBUG_ENTER("end_mysqld_signal"); - kill(0, SIGTERM); // Take down mysqld nicely + kill_mysql(); // Take down mysqld nicely DBUG_VOID_RETURN; /* purecov: deadcode */ } diff --git a/sql/protocol.cc b/sql/protocol.cc index bb69cdb36af..e608420f21a 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -477,9 +477,10 @@ void Protocol::init(THD *thd_arg) for the error. */ -void Protocol::end_partial_result_set(THD *thd) +void Protocol::end_partial_result_set(THD *thd_arg) { - net_send_eof(thd, thd->server_status, 0 /* no warnings, we're inside SP */); + net_send_eof(thd_arg, thd_arg->server_status, + 0 /* no warnings, we're inside SP */); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ef23a91cf69..5988f05c93a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1512,7 +1512,7 @@ void THD::rollback_item_tree_changes() select_result::select_result() { thd=current_thd; - nest_level= -1; + nest_level= (uint) -1; } void select_result::send_error(uint errcode,const char *err) diff --git a/sql/sql_class.h b/sql/sql_class.h index ddaa62bd159..6dbdde28985 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2339,7 +2339,7 @@ public: @return -1 if nest level is undefined, otherwise a positive integer. */ - int get_nest_level() { return nest_level; } + int get_nest_level() { return (int) nest_level; } #ifdef EMBEDDED_LIBRARY virtual void begin_dataset() {} #else diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 6f5c29fa1e6..6af1ba1fbae 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -141,8 +141,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) (uchar*) myisam_file_magic, 4)) { DBUG_PRINT("error",("Wrong header in %s",name_buff)); - DBUG_DUMP("error_dump",(char*) share->state.header.file_version, - head_length); + DBUG_DUMP("error_dump", share->state.header.file_version, + (size_t) head_length); my_errno=HA_ERR_NOT_A_TABLE; goto err; } diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index c965e9e168f..392a8600da3 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -404,14 +404,14 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param) */ int ha_myisammrg::open(const char *name, int mode __attribute__((unused)), - uint test_if_locked) + uint test_if_locked_arg) { DBUG_ENTER("ha_myisammrg::open"); DBUG_PRINT("myrg", ("name: '%s' table: 0x%lx", name, (long) table)); - DBUG_PRINT("myrg", ("test_if_locked: %u", test_if_locked)); + DBUG_PRINT("myrg", ("test_if_locked: %u", test_if_locked_arg)); /* Save for later use. */ - this->test_if_locked= test_if_locked; + test_if_locked= test_if_locked_arg; /* retrieve children table list. */ my_errno= 0;