diff options
author | unknown <monty@mysql.com/nosik.monty.fi> | 2006-11-20 22:42:06 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/nosik.monty.fi> | 2006-11-20 22:42:06 +0200 |
commit | 14decc4fbc04b8ce0c5efb7d76b711c6e60a0266 (patch) | |
tree | c8a26659fd67578dcb2edfa68c23c6ca4650fc4e /sql | |
parent | 383fbde53239a9d4fd4e444a0b6d8942305f74f5 (diff) | |
download | mariadb-git-14decc4fbc04b8ce0c5efb7d76b711c6e60a0266.tar.gz |
Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
BitKeeper/etc/ignore:
added mysql-test/r/*.warnings
BUILD/SETUP.sh:
Don't build with BDB as default
client/client_priv.h:
Added OPT_DEBUG_INFO
client/mysqlbinlog.cc:
Fixed compiler warning
client/mysqldump.c:
Removed compiler warnings
Added option --debug-info to detect memory leaks
Fixed memory leak
Don't backup cluster replication tables (if used with 5.1)
cmd-line-utils/readline/bind.c:
Fixed compiler warning
cmd-line-utils/readline/chardefs.h:
Fixed compiler warning
cmd-line-utils/readline/complete.c:
Fixed compiler warning
cmd-line-utils/readline/display.c:
Fixed compiler warning
cmd-line-utils/readline/histexpand.c:
Fixed compiler warning
cmd-line-utils/readline/input.c:
Fixed compiler warning
cmd-line-utils/readline/isearch.c:
Fixed compiler warning
cmd-line-utils/readline/kill.c:
Fixed compiler warning
cmd-line-utils/readline/macro.c:
Fixed compiler warning
cmd-line-utils/readline/misc.c:
Fixed compiler warning
cmd-line-utils/readline/nls.c:
Fixed compiler warning
cmd-line-utils/readline/readline.c:
Fixed compiler warning
cmd-line-utils/readline/rltty.c:
Fixed compiler warning
cmd-line-utils/readline/search.c:
Fixed compiler warning
cmd-line-utils/readline/terminal.c:
Fixed compiler warning
cmd-line-utils/readline/text.c:
Fixed compiler warning
cmd-line-utils/readline/tilde.c:
Fixed compiler warning
cmd-line-utils/readline/undo.c:
Fixed compiler warning
cmd-line-utils/readline/util.c:
Fixed compiler warning
cmd-line-utils/readline/vi_mode.c:
Fixed compiler warning
dbug/dbug_analyze.c:
Fixed compiler warning
extra/yassl/src/ssl.cpp:
Fixed compiler warning
extra/yassl/testsuite/testsuite.cpp:
Fixed compiler warning
heap/_check.c:
Fixed compiler warning
heap/hp_delete.c:
Fixed compiler warning
heap/hp_hash.c:
Fixed compiler warning
heap/hp_open.c:
Fixed compiler warning
heap/hp_rkey.c:
Fixed compiler warning
heap/hp_rrnd.c:
Fixed compiler warning
heap/hp_write.c:
Fixed compiler warning
libmysql/libmysql.c:
Fixed compiler warning
libmysqld/libmysqld.c:
Fixed compiler warning
myisam/mi_close.c:
Fixed compiler warning
myisam/mi_delete.c:
Fixed compiler warning
myisam/mi_dynrec.c:
Fixed compiler warning
myisam/mi_keycache.c:
Fixed compiler warning
myisam/mi_page.c:
Fixed compiler warning
myisam/mi_statrec.c:
Fixed compiler warning
myisam/mi_test2.c:
Fixed compiler warning
myisam/mi_write.c:
Fixed compiler warning
myisam/myisampack.c:
Fixed compiler warning
myisammrg/myrg_extra.c:
Fixed compiler warning
mysql-test/mysql-test-run.pl:
Remove .reject, .progress, .log and .warnings flag at start
cluster -> mysql database (for 5.1)
mysql-test/include/federated.inc:
Remove mysqltest warnings
mysql-test/include/sp-vars.inc:
Remove mysqltest warnings
mysql-test/mysql-test-run.sh:
Fix so that 'make test' works again
Remove .reject, .progress .log and .warnings files at startup
mysql-test/r/ctype_cp1250_ch.result:
Drop used tables at startup
mysql-test/t/create.test:
Remove mysqltest warnings
mysql-test/t/csv.test:
Remove mysqltest warnings
mysql-test/t/ctype_collate.test:
Remove mysqltest warnings
mysql-test/t/ctype_cp1250_ch.test:
Drop used tables at startup
mysql-test/t/ctype_ucs.test:
Remove mysqltest warnings
mysql-test/t/func_sapdb.test:
Remove mysqltest warnings
mysql-test/t/func_str.test:
Remove mysqltest warnings
mysql-test/t/grant.test:
Remove mysqltest warnings
mysql-test/t/greedy_optimizer.test:
Remove mysqltest warnings
mysql-test/t/group_min_max.test:
Remove mysqltest warnings
mysql-test/t/innodb.test:
Remove mysqltest warnings
mysql-test/t/join.test:
Remove mysqltest warnings
mysql-test/t/limit.test:
Remove mysqltest warnings
mysql-test/t/null.test:
Remove mysqltest warnings
mysql-test/t/select.test:
Remove mysqltest warnings
mysql-test/t/sp-prelocking.test:
Remove mysqltest warnings
mysql-test/t/strict.test:
Remove mysqltest warnings
mysql-test/t/subselect.test:
Remove mysqltest warnings
mysql-test/t/type_newdecimal.test:
Remove mysqltest warnings
mysql-test/t/view_grant.test:
Remove mysqltest warnings
mysys/default.c:
Fixed compiler warning
mysys/hash.c:
Fixed compiler warning
mysys/list.c:
Fixed compiler warning
mysys/mf_iocache.c:
Fixed compiler warning
mysys/mf_keycache.c:
Fixed compiler warning
mysys/mf_keycaches.c:
Fixed compiler warning
mysys/my_alloc.c:
Fixed compiler warning
mysys/my_dup.c:
Fixed compiler warning
mysys/my_fopen.c:
Fixed compiler warning
mysys/my_fstream.c:
Fixed compiler warning
mysys/my_getwd.c:
Fixed compiler warning
mysys/my_handler.c:
Fixed compiler warning
Added missing enums in switch
mysys/my_lib.c:
Fixed compiler warning
mysys/my_lread.c:
Fixed compiler warning
mysys/my_lwrite.c:
Fixed compiler warning
mysys/my_malloc.c:
Fixed compiler warning
mysys/my_pread.c:
Fixed compiler warning
mysys/my_read.c:
Fixed compiler warning
mysys/my_realloc.c:
Fixed compiler warning
mysys/my_seek.c:
Fixed compiler warning
mysys/my_write.c:
Fixed compiler warning
mysys/safemalloc.c:
Fixed compiler warning
mysys/thr_lock.c:
Fixed compiler warning
mysys/tree.c:
Fixed compiler warning
mysys/typelib.c:
Fixed compiler warning
ndb/include/logger/LogHandler.hpp:
Changed SetErrorStr() to take const char* to remove compiler warnings (as many arguments to this are const strings)
ndb/include/ndb_global.h.in:
Added LINT_SET_PTR macro to be able to remove some compiler warnings
ndb/include/util/InputStream.hpp:
Fixed compiler warning
ndb/include/util/OutputStream.hpp:
Fixed compiler warning
ndb/include/util/SimpleProperties.hpp:
Fixed compiler warning
ndb/src/common/debugger/EventLogger.cpp:
remove if on 'signal' as this is a function pointer and is always true
ndb/src/common/debugger/signaldata/BackupSignalData.cpp:
Add missing enums
ndb/src/common/logger/LogHandler.cpp:
Changed SetErrorStr() to take const char* to remove compiler warnings (as many arguments to this are const strings)
ndb/src/common/portlib/NdbMutex.c:
Fixed compiler warning
ndb/src/common/portlib/NdbThread.c:
Fixed compiler warning
ndb/src/common/transporter/Transporter.cpp:
Swapped arguments to remove compiler warnings
ndb/src/cw/cpcd/CPCD.hpp:
Fixed compiler warning
ndb/src/kernel/blocks/backup/Backup.cpp:
Fixed compiler warning
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Fixed compiler warning
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Fixed compiler warning
ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp:
Fixed compiler warning
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
Added missing enums
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
Fixed compiler warning
ndb/src/kernel/error/ErrorReporter.cpp:
Fixed compiler warning
ndb/src/kernel/error/ErrorReporter.hpp:
Fixed compiler warning
ndb/src/kernel/error/ndbd_exit_codes.c:
Fixed compiler warning
ndb/src/kernel/vm/TransporterCallback.cpp:
Fixed compiler warning
ndb/src/mgmapi/mgmapi.cpp:
Fixed compiler warning
ndb/src/mgmclient/CommandInterpreter.cpp:
Fixed compiler warning
ndb/src/mgmsrv/MgmtSrvr.cpp:
Fixed compiler warning
ndb/src/mgmsrv/Services.cpp:
Fixed compiler warning
ndb/src/ndbapi/ClusterMgr.cpp:
Fixed compiler warning
ndb/src/ndbapi/DictCache.cpp:
Fixed compiler warning
ndb/src/ndbapi/Ndb.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbOperationDefine.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbOperationExec.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbOperationInt.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbOperationSearch.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbTransaction.cpp:
Fixed compiler warning
ndb/src/ndbapi/Ndbif.cpp:
Fixed compiler warning
ndb/src/ndbapi/Ndbinit.cpp:
Fixed compiler warning
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Fixed compiler warning
ndb/tools/drop_index.cpp:
Fixed compiler warning
ndb/tools/drop_tab.cpp:
Fixed compiler warning
ndb/tools/ndb_config.cpp:
Fixed compiler warning
regex/regexec.c:
Fixed compiler warning
server-tools/instance-manager/mysql_connection.cc:
Fixed compiler warning
sql/Makefile.am:
Fix for bison 1.875, which adds an attribute statement that gcc 4.1.0 can't parse
sql/filesort.cc:
Fixed compiler warning
sql/ha_archive.cc:
Fixed compiler warning
sql/ha_federated.cc:
Fixed compiler warning
sql/ha_federated.h:
Fixed compiler warning
sql/ha_innodb.cc:
Fixed compiler warning
sql/ha_myisam.cc:
Fixed compiler warning
sql/ha_myisammrg.cc:
Fixed compiler warning
sql/ha_ndbcluster.cc:
Fixed compiler warning
sql/handler.cc:
Fixed compiler warning
sql/item_cmpfunc.cc:
Fixed compiler warning
sql/item_subselect.cc:
Fixed compiler warning
sql/item_timefunc.cc:
Fixed compiler warning
sql/log_event.cc:
Fixed compiler warning
sql/mysqld.cc:
Fixed compiler warning
sql/net_serv.cc:
Fixed compiler warning
sql/opt_range.cc:
Fixed compiler warning
Formated DBUG statements to be as rest of code
sql/slave.cc:
Fixed compiler warning
sql/sql_acl.cc:
Fixed compiler warning
sql/sql_cache.cc:
Fixed compiler warning
Fixed bug in query cache when used with DBUG traceing
sql/sql_class.cc:
Fixed compiler warning
sql/sql_class.h:
Fixed compiler warning
sql/sql_delete.cc:
Fixed compiler warning
sql/sql_parse.cc:
Fixed compiler warning
Hack to fix my_sprintf() strings with %b
sql/sql_prepare.cc:
Fixed compiler warning
Hack to fix my_sprintf() strings with %b
sql/sql_repl.cc:
Fixed compiler warning
sql/sql_select.cc:
Fixed compiler warning
sql/sql_update.cc:
Fixed compiler warning
sql/sql_view.cc:
Fixed compiler warning
sql/strfunc.cc:
Fixed compiler warning
sql-common/client.c:
Fixed compiler warning
sql-common/my_time.c:
Fixed compiler warning
sql/table.cc:
Fixed compiler warning
sql/tztime.cc:
Fixed compiler warning
sql/unireg.cc:
Fixed compiler warning
strings/decimal.c:
Fixed compiler warning
tests/mysql_client_test.c:
Fixed compiler warning
vio/viosocket.c:
Fixed compiler warning
vio/viossl.c:
Fixed compiler warning
vio/viosslfactories.c:
Fixed compiler warning
Diffstat (limited to 'sql')
-rw-r--r-- | sql/Makefile.am | 2 | ||||
-rw-r--r-- | sql/filesort.cc | 2 | ||||
-rw-r--r-- | sql/ha_archive.cc | 6 | ||||
-rw-r--r-- | sql/ha_federated.cc | 12 | ||||
-rw-r--r-- | sql/ha_federated.h | 3 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 4 | ||||
-rw-r--r-- | sql/ha_myisam.cc | 2 | ||||
-rw-r--r-- | sql/ha_myisammrg.cc | 2 | ||||
-rw-r--r-- | sql/ha_ndbcluster.cc | 41 | ||||
-rw-r--r-- | sql/handler.cc | 2 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 4 | ||||
-rw-r--r-- | sql/item_subselect.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 3 | ||||
-rw-r--r-- | sql/log_event.cc | 15 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/net_serv.cc | 2 | ||||
-rw-r--r-- | sql/opt_range.cc | 20 | ||||
-rw-r--r-- | sql/slave.cc | 17 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 | ||||
-rw-r--r-- | sql/sql_cache.cc | 67 | ||||
-rw-r--r-- | sql/sql_class.cc | 6 | ||||
-rw-r--r-- | sql/sql_class.h | 2 | ||||
-rw-r--r-- | sql/sql_delete.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 12 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 12 | ||||
-rw-r--r-- | sql/sql_repl.cc | 4 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 4 | ||||
-rw-r--r-- | sql/sql_view.cc | 2 | ||||
-rw-r--r-- | sql/strfunc.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 2 | ||||
-rw-r--r-- | sql/tztime.cc | 7 | ||||
-rw-r--r-- | sql/unireg.cc | 8 |
33 files changed, 145 insertions, 138 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am index d9cea960915..6c685ba67c6 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -149,6 +149,8 @@ sql_yacc.cc: sql_yacc.yy sql_yacc.h: sql_yacc.yy sql_yacc.o: sql_yacc.cc sql_yacc.h $(HEADERS) + @SED@ -e 's/__attribute__ ((__unused__))//' sql_yacc.cc > sql_yacc.cc-new + @MV@ sql_yacc.cc-new sql_yacc.cc @echo "Note: The following compile may take a long time." @echo "If it fails, re-run configure with --with-low-memory" $(CXXCOMPILE) $(LM_CFLAGS) -c $< diff --git a/sql/filesort.cc b/sql/filesort.cc index b063b416191..7e98845372e 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -296,7 +296,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, DBUG_POP(); /* Ok to DBUG */ #endif memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO)); - DBUG_PRINT("exit",("records: %ld",records)); + DBUG_PRINT("exit",("records: %ld", (long) records)); DBUG_RETURN(error ? HA_POS_ERROR : records); } /* filesort */ diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc index 189c5facfab..113008c4885 100644 --- a/sql/ha_archive.cc +++ b/sql/ha_archive.cc @@ -682,7 +682,8 @@ int ha_archive::real_write_row(byte *buf, gzFile writer) } share->approx_file_size+= total_row_length; written= gzwrite(writer, buf, table->s->reclength); - DBUG_PRINT("ha_archive::real_write_row", ("Wrote %d bytes expected %d", written, table->s->reclength)); + DBUG_PRINT("ha_archive::real_write_row", ("Wrote %d bytes expected %lu", (int) written, + table->s->reclength)); if (!delayed_insert || !bulk_insert) share->dirty= TRUE; @@ -822,7 +823,8 @@ int ha_archive::get_row(gzFile file_to_read, byte *buf) DBUG_ENTER("ha_archive::get_row"); read= gzread(file_to_read, buf, table->s->reclength); - DBUG_PRINT("ha_archive::get_row", ("Read %d bytes expected %d", read, table->s->reclength)); + DBUG_PRINT("ha_archive::get_row", ("Read %d bytes expected %lu", (int) read, + table->s->reclength)); if (read == Z_STREAM_ERROR) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 8be1e40f42d..6328803c743 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -557,8 +557,8 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) if (share->scheme) { DBUG_PRINT("info", - ("error: parse_url. Returning error code %d \ - freeing share->scheme %lx", error_num, share->scheme)); + ("error: parse_url. Returning error code %d freeing share->scheme 0x%lx", + error_num, (long) share->scheme)); my_free((gptr) share->scheme, MYF(0)); share->scheme= 0; } @@ -624,7 +624,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, MYF(0)); share->connect_string_length= table->s->connect_string.length; - DBUG_PRINT("info",("parse_url alloced share->scheme %lx", share->scheme)); + DBUG_PRINT("info",("parse_url alloced share->scheme 0x%lx", (long) share->scheme)); /* remove addition of null terminator and store length @@ -1664,7 +1664,7 @@ void ha_federated::update_auto_increment(void) DBUG_ENTER("ha_federated::update_auto_increment"); thd->insert_id(mysql->last_used_con->insert_id); - DBUG_PRINT("info",("last_insert_id %d", auto_increment_value)); + DBUG_PRINT("info",("last_insert_id: %ld", (long) auto_increment_value)); DBUG_VOID_RETURN; } @@ -1917,8 +1917,8 @@ int ha_federated::delete_row(const byte *buf) deleted+= mysql->affected_rows; records-= mysql->affected_rows; DBUG_PRINT("info", - ("rows deleted %d rows deleted for all time %d", - int(mysql->affected_rows), deleted)); + ("rows deleted %ld rows deleted for all time %ld", + (long) mysql->affected_rows, (long) deleted)); DBUG_RETURN(0); } diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 11e5a4f634f..c04ce09e75d 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -232,8 +232,7 @@ public: */ double scan_time() { - DBUG_PRINT("info", - ("records %d", records)); + DBUG_PRINT("info", ("records %ld", (long) records)); return (double)(records*1000); } /* diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e9ccc0ccede..a1619d8e1a1 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4215,7 +4215,7 @@ ha_innobase::rnd_pos( } if (error) { - DBUG_PRINT("error", ("Got error: %ld", error)); + DBUG_PRINT("error", ("Got error: %d", error)); DBUG_RETURN(error); } @@ -4225,7 +4225,7 @@ ha_innobase::rnd_pos( error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT); if (error) { - DBUG_PRINT("error", ("Got error: %ld", error)); + DBUG_PRINT("error", ("Got error: %d", error)); } change_active_index(keynr); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 8e40105780b..19ec1b29da3 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1557,7 +1557,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, } } DBUG_PRINT("loop",("found: 0x%lx recpos: %d minpos: %d length: %d", - found,recpos,minpos,length)); + (long) found, recpos, minpos, length)); if (recpos != minpos) { // Reserved space (Null bits?) bzero((char*) recinfo_pos,sizeof(*recinfo_pos)); diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index 33da88bbdd4..5e613a63303 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -108,7 +108,7 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) if (table->s->reclength != mean_rec_length && mean_rec_length) { - DBUG_PRINT("error",("reclength: %d mean_rec_length: %d", + DBUG_PRINT("error",("reclength: %lu mean_rec_length: %lu", table->s->reclength, mean_rec_length)); goto err; } diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 957a3055e70..739fae79565 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1774,7 +1774,7 @@ inline int ha_ndbcluster::fetch_next(NdbScanOperation* cursor) all pending update or delete operations should be sent to NDB */ - DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending)); if (m_ops_pending) { if (m_transaction_on) @@ -2976,7 +2976,7 @@ int ha_ndbcluster::close_scan() Take over any pending transactions to the deleteing/updating transaction before closing the scan */ - DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending)); if (execute_no_commit(this,trans,false) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); @@ -3542,8 +3542,8 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) Thd_ndb *thd_ndb= get_thd_ndb(thd); Ndb *ndb= thd_ndb->ndb; - DBUG_PRINT("enter", ("thd: %x, thd_ndb: %x, thd_ndb->lock_count: %d", - thd, thd_ndb, thd_ndb->lock_count)); + DBUG_PRINT("enter", ("thd: 0x%lx thd_ndb: 0x%lx thd_ndb->lock_count: %d", + (long) thd, (long) thd_ndb, thd_ndb->lock_count)); if (lock_type != F_UNLCK) { @@ -3847,7 +3847,8 @@ int ndbcluster_commit(THD *thd, bool all) while ((share= it++)) { pthread_mutex_lock(&share->mutex); - DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %d ", share->table_name, share->commit_count)); + DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu", + share->table_name, (ulong) share->commit_count)); share->commit_count= 0; share->commit_count_lock++; pthread_mutex_unlock(&share->mutex); @@ -4281,7 +4282,7 @@ int ha_ndbcluster::create(const char *name, if (packfrm(data, length, &pack_data, &pack_length)) DBUG_RETURN(2); - DBUG_PRINT("info", ("setFrm data=%x, len=%d", pack_data, pack_length)); + DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length)); tab.setFrm(pack_data, pack_length); my_free((char*)data, MYF(0)); my_free((char*)pack_data, MYF(0)); @@ -5237,7 +5238,7 @@ bool ndbcluster_init() } { char buf[128]; - my_snprintf(buf, sizeof(buf), "mysqld --server-id=%d", server_id); + my_snprintf(buf, sizeof(buf), "mysqld --server-id=%lu", server_id); g_ndb_cluster_connection->set_name(buf); } g_ndb_cluster_connection->set_optimized_node_selection @@ -5813,9 +5814,9 @@ static NDB_SHARE* get_share(const char *table_name) share->use_count++; DBUG_PRINT("share", - ("table_name: %s, length: %d, use_count: %d, commit_count: %d", + ("table_name: %s length: %d use_count: %d commit_count: %lu", share->table_name, share->table_name_length, share->use_count, - share->commit_count)); + (ulong) share->commit_count)); pthread_mutex_unlock(&ndbcluster_mutex); return share; } @@ -5862,14 +5863,14 @@ static int packfrm(const void *data, uint len, uint blob_len; frm_blob_struct* blob; DBUG_ENTER("packfrm"); - DBUG_PRINT("enter", ("data: %x, len: %d", data, len)); + DBUG_PRINT("enter", ("data: 0x%lx, len: %d", (long) data, len)); error= 1; org_len= len; if (my_compress((byte*)data, &org_len, &comp_len)) goto err; - DBUG_PRINT("info", ("org_len: %d, comp_len: %d", org_len, comp_len)); + DBUG_PRINT("info", ("org_len: %lu comp_len: %lu", org_len, comp_len)); DBUG_DUMP("compressed", (char*)data, org_len); error= 2; @@ -5889,7 +5890,7 @@ static int packfrm(const void *data, uint len, *pack_len= blob_len; error= 0; - DBUG_PRINT("exit", ("pack_data: %x, pack_len: %d", *pack_data, *pack_len)); + DBUG_PRINT("exit", ("pack_data: 0x%lx, pack_len: %d", (long) *pack_data, *pack_len)); err: DBUG_RETURN(error); @@ -5903,13 +5904,13 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len, byte *data; ulong complen, orglen, ver; DBUG_ENTER("unpackfrm"); - DBUG_PRINT("enter", ("pack_data: %x", pack_data)); + DBUG_PRINT("enter", ("pack_data: 0x%lx", (long) pack_data)); complen= uint4korr((char*)&blob->head.complen); orglen= uint4korr((char*)&blob->head.orglen); ver= uint4korr((char*)&blob->head.ver); - DBUG_PRINT("blob",("ver: %d complen: %d orglen: %d", + DBUG_PRINT("blob",("ver: %lu complen: %lu orglen: %lu", ver,complen,orglen)); DBUG_DUMP("blob->data", (char*) blob->data, complen); @@ -5928,7 +5929,7 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len, *unpack_data= data; *unpack_len= complen; - DBUG_PRINT("exit", ("frmdata: %x, len: %d", *unpack_data, *unpack_len)); + DBUG_PRINT("exit", ("frmdata: 0x%lx, len: %d", (long) *unpack_data, *unpack_len)); DBUG_RETURN(0); } @@ -6521,7 +6522,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) my_thread_init(); DBUG_ENTER("ndb_util_thread"); - DBUG_PRINT("enter", ("ndb_cache_check_time: %d", ndb_cache_check_time)); + DBUG_PRINT("enter", ("ndb_cache_check_time: %lu", ndb_cache_check_time)); thd= new THD; /* note that contructor of THD uses DBUG_ */ THD_CHECK_SENTRY(thd); @@ -6550,7 +6551,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) &abstime); pthread_mutex_unlock(&LOCK_ndb_util_thread); - DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d", + DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu", ndb_cache_check_time)); if (abort_loop) @@ -7447,7 +7448,7 @@ void ndb_serialize_cond(const Item *item, void *arg) if (context->expecting(Item::INT_ITEM)) { Item_int *int_item= (Item_int *) item; - DBUG_PRINT("info", ("value %d", int_item->value)); + DBUG_PRINT("info", ("value %ld", (long) int_item->value)); NDB_ITEM_QUALIFICATION q; q.value_type= Item::INT_ITEM; curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); @@ -7470,7 +7471,7 @@ void ndb_serialize_cond(const Item *item, void *arg) context->supported= FALSE; break; case Item::REAL_ITEM: - DBUG_PRINT("info", ("REAL_ITEM %s")); + DBUG_PRINT("info", ("REAL_ITEM")); if (context->expecting(Item::REAL_ITEM)) { Item_float *float_item= (Item_float *) item; @@ -7518,7 +7519,7 @@ void ndb_serialize_cond(const Item *item, void *arg) context->supported= FALSE; break; case Item::DECIMAL_ITEM: - DBUG_PRINT("info", ("DECIMAL_ITEM %s")); + DBUG_PRINT("info", ("DECIMAL_ITEM")); if (context->expecting(Item::DECIMAL_ITEM)) { Item_decimal *decimal_item= (Item_decimal *) item; diff --git a/sql/handler.cc b/sql/handler.cc index cff8213edec..5bc9deb59e3 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1533,7 +1533,7 @@ prev_insert_id(ulonglong nr, struct system_variables *variables) */ DBUG_PRINT("info",("auto_increment: nr: %lu cannot honour " "auto_increment_offset: %lu", - nr, variables->auto_increment_offset)); + (ulong) nr, variables->auto_increment_offset)); return nr; } if (variables->auto_increment_increment == 1) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9a400d60ae6..221fc750e85 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2196,7 +2196,7 @@ cmp_item* cmp_item_row::make_same() cmp_item_row::~cmp_item_row() { DBUG_ENTER("~cmp_item_row"); - DBUG_PRINT("enter",("this: 0x%lx", this)); + DBUG_PRINT("enter",("this: 0x%lx", (long) this)); if (comparators) { for (uint i= 0; i < n; i++) @@ -2971,7 +2971,7 @@ longlong Item_is_not_null_test::val_int() if (!used_tables_cache) { owner->was_null|= (!cached_value); - DBUG_PRINT("info", ("cached :%d", cached_value)); + DBUG_PRINT("info", ("cached :%ld", (long) cached_value)); DBUG_RETURN(cached_value); } if (args[0]->is_null()) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 0ad517609c9..b43f70447c4 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -54,7 +54,7 @@ void Item_subselect::init(st_select_lex *select_lex, { DBUG_ENTER("Item_subselect::init"); - DBUG_PRINT("enter", ("select_lex: 0x%x", (ulong) select_lex)); + DBUG_PRINT("enter", ("select_lex: 0x%lx", (long) select_lex)); unit= select_lex->master_unit(); if (unit->item) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a776d8a5ff7..403d41ce716 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2498,7 +2498,8 @@ String *Item_char_typecast::val_str(String *str) { // Safe even if const arg char char_type[40]; my_snprintf(char_type, sizeof(char_type), "%s(%lu)", - cast_cs == &my_charset_bin ? "BINARY" : "CHAR", length); + cast_cs == &my_charset_bin ? "BINARY" : "CHAR", + (ulong) length); if (!res->alloced_length()) { // Don't change const str diff --git a/sql/log_event.cc b/sql/log_event.cc index 271658d8054..0a68d89dfb8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -727,7 +727,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file, LOG_EVENT_MINIMAL_HEADER_LEN); LOCK_MUTEX; - DBUG_PRINT("info", ("my_b_tell=%lu", my_b_tell(file))); + DBUG_PRINT("info", ("my_b_tell: %lu", (ulong) my_b_tell(file))); if (my_b_read(file, (byte *) head, header_size)) { DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \ @@ -1297,7 +1297,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, } else time_zone_len= 0; - DBUG_PRINT("info",("Query_log_event has flags2=%lu sql_mode=%lu",flags2,sql_mode)); + DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %lu", + (ulong) flags2, sql_mode)); } #endif /* MYSQL_CLIENT */ @@ -1345,7 +1346,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, common_header_len= description_event->common_header_len; post_header_len= description_event->post_header_len[event_type-1]; - DBUG_PRINT("info",("event_len=%ld, common_header_len=%d, post_header_len=%d", + DBUG_PRINT("info",("event_len: %u common_header_len: %d post_header_len: %d", event_len, common_header_len, post_header_len)); /* @@ -1393,7 +1394,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, case Q_FLAGS2_CODE: flags2_inited= 1; flags2= uint4korr(pos); - DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", flags2)); + DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", (ulong) flags2)); pos+= 4; break; case Q_SQL_MODE_CODE: @@ -3137,8 +3138,8 @@ Rotate_log_event::Rotate_log_event(THD* thd_arg, #ifndef DBUG_OFF char buff[22]; DBUG_ENTER("Rotate_log_event::Rotate_log_event(THD*,...)"); - DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg, - llstr(pos_arg, buff), flags)); + DBUG_PRINT("enter",("new_log_ident: %s pos: %s flags: %lu", new_log_ident_arg, + llstr(pos_arg, buff), (ulong) flags)); #endif if (flags & DUP_NAME) new_log_ident= my_strdup_with_length(new_log_ident_arg, @@ -3912,7 +3913,7 @@ Slave_log_event::Slave_log_event(THD* thd_arg, memcpy(master_log, rli->group_master_log_name, master_log_len + 1); master_port = mi->port; master_pos = rli->group_master_log_pos; - DBUG_PRINT("info", ("master_log: %s pos: %d", master_log, + DBUG_PRINT("info", ("master_log: %s pos: %lu", master_log, (ulong) master_pos)); } else diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bb102aa76d8..36a5605b507 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1531,7 +1531,7 @@ static void network_init(void) if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1)) { - sql_print_error("The socket file path is too long (> %lu): %s", + sql_print_error("The socket file path is too long (> %u): %s", sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port); unireg_abort(1); } @@ -3378,8 +3378,8 @@ int main(int argc, char **argv) if (stack_size && stack_size < thread_stack) { if (global_system_variables.log_warnings) - sql_print_warning("Asked for %ld thread stack, but got %ld", - thread_stack, stack_size); + sql_print_warning("Asked for %lu thread stack, but got %ld", + thread_stack, (long) stack_size); #if defined(__ia64__) || defined(__ia64) thread_stack= stack_size*2; #else @@ -3913,7 +3913,7 @@ static void create_new_thread(THD *thd) int error; thread_created++; threads.append(thd); - DBUG_PRINT("info",(("creating thread %d"), thd->thread_id)); + DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id)); thd->connect_time = time(NULL); if ((error=pthread_create(&thd->real_id,&connection_attrib, handle_one_connection, @@ -5130,7 +5130,7 @@ master-ssl", (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \ --skip-merge.", - (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0}, + (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"myisam-recover", OPT_MYISAM_RECOVER, "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.", (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0, diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 1601f7e5177..e84b2266e82 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -810,7 +810,7 @@ my_real_read(NET *net, ulong *complen) { my_bool interrupted = vio_should_retry(net->vio); - DBUG_PRINT("info",("vio_read returned %d, errno: %d", + DBUG_PRINT("info",("vio_read returned %ld, errno: %d", length, vio_errno(net->vio))); #if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER) /* diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 96239315026..ef755d868d9 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -878,7 +878,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT() file->extra(HA_EXTRA_NO_KEYREAD); if (free_file) { - DBUG_PRINT("info", ("Freeing separate handler %p (free=%d)", file, + DBUG_PRINT("info", ("Freeing separate handler 0x%lx (free: %d)", (long) file, free_file)); file->reset(); file->external_lock(current_thd, F_UNLCK); @@ -1836,9 +1836,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, double scan_time; DBUG_ENTER("SQL_SELECT::test_quick_select"); DBUG_PRINT("enter",("keys_to_use: %lu prev_tables: %lu const_tables: %lu", - keys_to_use.to_ulonglong(), (ulong) prev_tables, + (ulong) keys_to_use.to_ulonglong(), (ulong) prev_tables, (ulong) const_tables)); - DBUG_PRINT("info", ("records=%lu", (ulong)head->file->records)); + DBUG_PRINT("info", ("records: %lu", (ulong) head->file->records)); delete quick; quick=0; needed_reg.clear_all(); @@ -2102,7 +2102,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records) n_blocks * (1.0 - pow(1.0 - 1.0/n_blocks, rows2double(records))); if (busy_blocks < 1.0) busy_blocks= 1.0; - DBUG_PRINT("info",("sweep: nblocks=%g, busy_blocks=%g", n_blocks, + DBUG_PRINT("info",("sweep: nblocks: %g, busy_blocks: %g", n_blocks, busy_blocks)); /* Disabled: Bail out if # of blocks to read is bigger than # of blocks in @@ -2126,7 +2126,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records) result= busy_blocks; } } - DBUG_PRINT("info",("returning cost=%g", result)); + DBUG_PRINT("return",("cost: %g", result)); DBUG_RETURN(result); } @@ -2220,7 +2220,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, ha_rows roru_total_records; double roru_intersect_part= 1.0; DBUG_ENTER("get_best_disjunct_quick"); - DBUG_PRINT("info", ("Full table scan cost =%g", read_time)); + DBUG_PRINT("info", ("Full table scan cost: %g", read_time)); if (!(range_scans= (TRP_RANGE**)alloc_root(param->mem_root, sizeof(TRP_RANGE*)* @@ -2264,7 +2264,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, non_cpk_scan_records += (*cur_child)->records; } - DBUG_PRINT("info", ("index_merge scans cost=%g", imerge_cost)); + DBUG_PRINT("info", ("index_merge scans cost %g", imerge_cost)); if (imerge_too_expensive || (imerge_cost > read_time) || (non_cpk_scan_records+cpk_scan_records >= param->table->file->records) && read_time != DBL_MAX) @@ -2877,7 +2877,7 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info, DBUG_PRINT("info", ("Current out_rows= %g", info->out_rows)); DBUG_PRINT("info", ("Adding scan on %s", info->param->table->key_info[ror_scan->keynr].name)); - DBUG_PRINT("info", ("is_cpk_scan=%d",is_cpk_scan)); + DBUG_PRINT("info", ("is_cpk_scan: %d",is_cpk_scan)); selectivity_mult = ror_scan_selectivity(info, ror_scan); if (selectivity_mult == 1.0) @@ -8280,8 +8280,8 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, *records= num_groups; DBUG_PRINT("info", - ("table rows=%u, keys/block=%u, keys/group=%u, result rows=%u, blocks=%u", - table_records, keys_per_block, keys_per_group, *records, + ("table rows: %u keys/block: %u keys/group: %u result rows: %lu blocks: %u", + table_records, keys_per_block, keys_per_group, (ulong) *records, num_blocks)); DBUG_VOID_RETURN; } diff --git a/sql/slave.cc b/sql/slave.cc index e3497a4f0ac..84e28a7be52 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -247,7 +247,7 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log, bool look_for_description_event) { DBUG_ENTER("init_relay_log_pos"); - DBUG_PRINT("info", ("pos=%lu", pos)); + DBUG_PRINT("info", ("pos: %lu", (long) pos)); *errmsg=0; pthread_mutex_t *log_lock=rli->relay_log.get_log_lock(); @@ -3080,7 +3080,7 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings) return packet_error; } - DBUG_PRINT("info",( "len=%u, net->read_pos[4] = %d\n", + DBUG_PRINT("info",( "len: %lu net->read_pos[4]: %d\n", len, mysql->net.read_pos[4])); return len - 1; } @@ -4116,7 +4116,7 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev) /* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */ memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1); mi->master_log_pos= rev->pos; - DBUG_PRINT("info", ("master_log_pos: '%s' %d", + DBUG_PRINT("info", ("master_log_pos: '%s' %lu", mi->master_log_name, (ulong) mi->master_log_pos)); #ifndef DBUG_OFF /* @@ -4233,7 +4233,7 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf, int error = process_io_create_file(mi,(Create_file_log_event*)ev); delete ev; mi->master_log_pos += inc_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); pthread_mutex_unlock(&mi->data_lock); my_free((char*)tmp_buf, MYF(0)); DBUG_RETURN(error); @@ -4260,7 +4260,7 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf, } delete ev; mi->master_log_pos+= inc_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); pthread_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } @@ -4316,7 +4316,7 @@ static int queue_binlog_ver_3_event(MASTER_INFO *mi, const char *buf, delete ev; mi->master_log_pos+= inc_pos; err: - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); pthread_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } @@ -4486,7 +4486,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) rli->ign_master_log_pos_end= mi->master_log_pos; } rli->relay_log.signal_update(); // the slave SQL thread needs to re-check - DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu event originating from the same server, ignored", + (ulong) mi->master_log_pos)); } else { @@ -4494,7 +4495,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len) if (likely(!(rli->relay_log.appendv(buf,event_len,0)))) { mi->master_log_pos+= inc_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); rli->relay_log.harvest_bytes_written(&rli->log_space_total); } else diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 724cf88d373..d91da405c36 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3726,7 +3726,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, GRANT_COLUMN *grant_column; ulong want_access= grant->want_privilege & ~grant->privilege; DBUG_ENTER("check_grant_column"); - DBUG_PRINT("enter", ("table: %s want_access: %u", table_name, want_access)); + DBUG_PRINT("enter", ("table: %s want_access: %lu", table_name, want_access)); if (!want_access) DBUG_RETURN(0); // Already checked diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index ff033b69f98..5902374dff0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -527,7 +527,8 @@ void Query_cache_query::init_n_lock() my_rwlock_init(&lock, NULL); lock_writing(); DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx", - ((byte*) this)-ALIGN_SIZE(sizeof(Query_cache_block)))); + (long) (((byte*) this) - + ALIGN_SIZE(sizeof(Query_cache_block))))); DBUG_VOID_RETURN; } @@ -536,7 +537,8 @@ void Query_cache_query::unlock_n_destroy() { DBUG_ENTER("Query_cache_query::unlock_n_destroy"); DBUG_PRINT("qcache", ("destroyed & unlocked query for block 0x%lx", - ((byte*)this)-ALIGN_SIZE(sizeof(Query_cache_block)))); + (long) (((byte*) this) - + ALIGN_SIZE(sizeof(Query_cache_block))))); /* The following call is not needed on system where one can destroy an active semaphore @@ -702,6 +704,7 @@ void query_cache_abort(NET *net) void query_cache_end_of_result(THD *thd) { + Query_cache_block *query_block; DBUG_ENTER("query_cache_end_of_result"); /* See the comment on double-check locking usage above. */ @@ -717,13 +720,9 @@ void query_cache_end_of_result(THD *thd) if (unlikely(query_cache.query_cache_size == 0 || query_cache.flush_in_progress)) - { - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); - DBUG_VOID_RETURN; - } + goto end; - Query_cache_block *query_block= ((Query_cache_block*) - thd->net.query_cache_query); + query_block= ((Query_cache_block*) thd->net.query_cache_query); if (query_block) { DUMP(&query_cache); @@ -742,27 +741,21 @@ void query_cache_end_of_result(THD *thd) header->query())); query_cache.wreck(__LINE__, ""); - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); - - DBUG_VOID_RETURN; + BLOCK_UNLOCK_WR(query_block); + goto end; } #endif header->found_rows(current_thd->limit_found_rows); header->result()->type= Query_cache_block::RESULT; header->writer(0); thd->net.query_cache_query= 0; + BLOCK_UNLOCK_WR(query_block); DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); - - BLOCK_UNLOCK_WR(query_block); - } - else - { - // Cache was flushed or resized and query was deleted => do nothing - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); } +end: + STRUCT_UNLOCK(&query_cache.structure_guard_mutex); DBUG_VOID_RETURN; } @@ -879,8 +872,8 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", flags.character_set_client_num, flags.character_set_results_num, flags.collation_connection_num, - flags.limit, - (ulong)flags.time_zone, + (ulong) flags.limit, + (ulong) flags.time_zone, flags.sql_mode, flags.max_sort_length, flags.group_concat_max_len)); @@ -1122,8 +1115,8 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", flags.character_set_client_num, flags.character_set_results_num, flags.collation_connection_num, - flags.limit, - (ulong)flags.time_zone, + (ulong) flags.limit, + (ulong) flags.time_zone, flags.sql_mode, flags.max_sort_length, flags.group_concat_max_len)); @@ -1260,7 +1253,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu", #ifndef EMBEDDED_LIBRARY do { - DBUG_PRINT("qcache", ("Results (len %lu, used %lu, headers %lu)", + DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %u)", result_block->length, result_block->used, result_block->headers_len()+ ALIGN_SIZE(sizeof(Query_cache_result)))); @@ -2037,7 +2030,7 @@ Query_cache::append_result_data(Query_cache_block **current_block, { DBUG_ENTER("Query_cache::append_result_data"); DBUG_PRINT("qcache", ("append %lu bytes to 0x%lx query", - data_len, query_block)); + data_len, (long) query_block)); if (query_block->query()->add(data_len) > query_cache_limit) { @@ -3044,10 +3037,10 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex, OPTION_TO_QUERY_CACHE))) && lex->safe_to_cache_query) { - DBUG_PRINT("qcache", ("options %lx %lx, type %u", - OPTION_TO_QUERY_CACHE, - lex->select_lex.options, - (int) thd->variables.query_cache_type)); + DBUG_PRINT("qcache", ("options: %lx %lx type: %u", + OPTION_TO_QUERY_CACHE, + (long) lex->select_lex.options, + (int) thd->variables.query_cache_type)); if (!(table_count= process_and_count_tables(tables_used, tables_type))) DBUG_RETURN(0); @@ -3063,10 +3056,10 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex, } DBUG_PRINT("qcache", - ("not interesting query: %d or not cacheable, options %lx %lx, type %u", + ("not interesting query: %d or not cacheable, options %lx %lx type: %u", (int) lex->sql_command, OPTION_TO_QUERY_CACHE, - lex->select_lex.options, + (long) lex->select_lex.options, (int) thd->variables.query_cache_type)); DBUG_RETURN(0); } @@ -3655,7 +3648,8 @@ void Query_cache::queries_dump() DBUG_PRINT("qcache", ("F:%u C:%u L:%lu T:'%s' (%u) '%s' '%s'", flags.client_long_flag, flags.character_set_client_num, - (ulong)flags.limit, flags.time_zone->get_name(), + (ulong)flags.limit, + flags.time_zone->get_name()->ptr(), len, str, strend(str)+1)); DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block, (ulong) block->next, (ulong) block->prev, @@ -3875,9 +3869,8 @@ my_bool Query_cache::check_integrity(bool locked) break; } default: - DBUG_PRINT("error", - ("block 0x%lx have incorrect type %u", - block, block->type)); + DBUG_PRINT("error", ("block 0x%lx have incorrect type %u", + (long) block, block->type)); result = 1; } @@ -3975,8 +3968,8 @@ my_bool Query_cache::check_integrity(bool locked) } while (block != bins[i].free_blocks); if (count != bins[i].number) { - DBUG_PRINT("error", ("bin[%d].number is %d, but bin have %d blocks", - bins[i].number, count)); + DBUG_PRINT("error", ("bins[%d].number = %d, but bin have %d blocks", + i, bins[i].number, count)); result = 1; } } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ba2f525a4a4..d2f1e9ed0d9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -712,7 +712,7 @@ void THD::add_changed_table(const char *key, long key_length) { list_include(prev_changed, curr, changed_table_dup(key, key_length)); DBUG_PRINT("info", - ("key_length %u %u", key_length, (*prev_changed)->key_length)); + ("key_length %ld %u", key_length, (*prev_changed)->key_length)); DBUG_VOID_RETURN; } else if (cmp == 0) @@ -722,7 +722,7 @@ void THD::add_changed_table(const char *key, long key_length) { list_include(prev_changed, curr, changed_table_dup(key, key_length)); DBUG_PRINT("info", - ("key_length %u %u", key_length, + ("key_length %ld %u", key_length, (*prev_changed)->key_length)); DBUG_VOID_RETURN; } @@ -734,7 +734,7 @@ void THD::add_changed_table(const char *key, long key_length) } } *prev_changed = changed_table_dup(key, key_length); - DBUG_PRINT("info", ("key_length %u %u", key_length, + DBUG_PRINT("info", ("key_length %ld %u", key_length, (*prev_changed)->key_length)); DBUG_VOID_RETURN; } diff --git a/sql/sql_class.h b/sql/sql_class.h index c7bdfbd7ea7..2467385b679 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2084,7 +2084,7 @@ public: inline bool unique_add(void *ptr) { DBUG_ENTER("unique_add"); - DBUG_PRINT("info", ("tree %u - %u", tree.elements_in_tree, max_elements)); + DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements)); if (tree.elements_in_tree > max_elements && flush()) DBUG_RETURN(1); DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg)); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index e13e7728708..38c12562fe3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -326,7 +326,7 @@ cleanup: { thd->row_count_func= deleted; send_ok(thd,deleted); - DBUG_PRINT("info",("%d records deleted",deleted)); + DBUG_PRINT("info",("%ld records deleted",(long) deleted)); } DBUG_RETURN(error >= 0 || thd->net.report_error); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3a107c2296c..e5181193b9c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -381,9 +381,9 @@ int check_user(THD *thd, enum enum_server_command command, NO_ACCESS)) // authentication is OK { DBUG_PRINT("info", - ("Capabilities: %d packet_length: %ld Host: '%s' " + ("Capabilities: %lu packet_length: %ld Host: '%s' " "Login user: '%s' Priv_user: '%s' Using password: %s " - "Access: %u db: '%s'", + "Access: %lu db: '%s'", thd->client_capabilities, thd->max_client_packet_length, thd->main_security_ctx.host_or_ip, @@ -956,7 +956,7 @@ static int check_connection(THD *thd) if (thd->client_capabilities & CLIENT_IGNORE_SPACE) thd->variables.sql_mode|= MODE_IGNORE_SPACE; #ifdef HAVE_OPENSSL - DBUG_PRINT("info", ("client capabilities: %d", thd->client_capabilities)); + DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities)); if (thd->client_capabilities & CLIENT_SSL) { /* Do the SSL layering. */ @@ -1112,7 +1112,7 @@ pthread_handler_t handle_one_connection(void *arg) of handle_one_connection, which is thd. We need to know the start of the stack so that we could check for stack overruns. */ - DBUG_PRINT("info", ("handle_one_connection called by thread %d\n", + DBUG_PRINT("info", ("handle_one_connection called by thread %lu\n", thd->thread_id)); /* now that we've called my_thread_init(), it is safe to call DBUG_* */ @@ -1764,7 +1764,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (alloc_query(thd, packet, packet_length)) break; // fatal error is set char *packet_end= thd->query + thd->query_length; - mysql_log.write(thd,command, "%.*b", thd->query_length, thd->query); + /* 'b' stands for 'buffer' parameter', special for 'my_snprintf' */ + const char *format= "%.*b"; + mysql_log.write(thd,command, format, thd->query_length, thd->query); DBUG_PRINT("query",("%-.4096s",thd->query)); if (!(specialflag & SPECIAL_NO_PRIOR)) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6517afa5432..1e7601c0951 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1664,7 +1664,7 @@ static bool check_prepared_statement(Prepared_statement *stmt, enum enum_sql_command sql_command= lex->sql_command; int res= 0; DBUG_ENTER("check_prepared_statement"); - DBUG_PRINT("enter",("command: %d, param_count: %ld", + DBUG_PRINT("enter",("command: %d, param_count: %u", sql_command, stmt->param_count)); lex->first_lists_tables_same(); @@ -1877,9 +1877,12 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) thd->stmt_map.erase(stmt); } else - mysql_log.write(thd, COM_STMT_PREPARE, "[%lu] %.*b", stmt->id, + { + const char *format= "[%lu] %.*b"; + mysql_log.write(thd, COM_STMT_PREPARE, format, stmt->id, stmt->query_length, stmt->query); + } /* check_prepared_statemnt sends the metadata packet in case of success */ DBUG_VOID_RETURN; } @@ -2261,8 +2264,11 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length) if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); if (error == 0) - mysql_log.write(thd, COM_STMT_EXECUTE, "[%lu] %.*b", stmt->id, + { + const char *format= "[%lu] %.*b"; + mysql_log.write(thd, COM_STMT_EXECUTE, format, stmt->id, thd->query_length, thd->query); + } DBUG_VOID_RETURN; diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index e1933d42f9e..126efb35cec 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1101,7 +1101,7 @@ bool change_master(THD* thd, MASTER_INFO* mi) { mi->master_log_pos= lex_mi->pos; } - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); if (lex_mi->host) strmake(mi->host, lex_mi->host, sizeof(mi->host)-1); @@ -1218,7 +1218,7 @@ bool change_master(THD* thd, MASTER_INFO* mi) } } mi->rli.group_master_log_pos = mi->master_log_pos; - DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); + DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); /* Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 75cfff4cbb6..386d12e9a8a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9965,7 +9965,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) if (join->result->send_eof()) rc= 1; // Don't send error } - DBUG_PRINT("info",("%ld records output",join->send_records)); + DBUG_PRINT("info",("%ld records output", (long) join->send_records)); } else rc= -1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d431b671f18..dabda39d6b7 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -569,7 +569,7 @@ int mysql_update(THD *thd, (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; send_ok(thd, (ulong) thd->row_count_func, thd->insert_id_used ? thd->last_insert_id : 0L,buff); - DBUG_PRINT("info",("%d records updated",updated)); + DBUG_PRINT("info",("%ld records updated", (long) updated)); } thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ thd->abort_on_warning= 0; @@ -667,7 +667,7 @@ static table_map get_table_map(List<Item> *items) while ((item= (Item_field *) item_it++)) map|= item->used_tables(); - DBUG_PRINT("info",("table_map: 0x%08x", map)); + DBUG_PRINT("info", ("table_map: 0x%08lx", (long) map)); return map; } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 52b6c2c38c0..c0cdaf59712 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -563,7 +563,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, LEX_STRING *name; int i; - for (i= 0; name= names++; i++) + for (i= 0; (name= names++); i++) { buff.append(i ? ", " : "("); append_identifier(thd, &buff, name->str, name->length); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index c822d10af46..d03d88ee051 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -150,7 +150,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) int pos; const char *j; DBUG_ENTER("find_type2"); - DBUG_PRINT("enter",("x: '%.*s' lib: 0x%lx", length, x, typelib)); + DBUG_PRINT("enter",("x: '%.*s' lib: 0x%lx", length, x, (long) typelib)); if (!typelib->count) { diff --git a/sql/table.cc b/sql/table.cc index d72379efb32..5a2281775b1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -88,7 +88,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, MEM_ROOT **root_ptr, *old_root; TABLE_SHARE *share; DBUG_ENTER("openfrm"); - DBUG_PRINT("enter",("name: '%s' form: 0x%lx",name,outparam)); + DBUG_PRINT("enter",("name: '%s' form: 0x%lx", name, (long) outparam)); error= 1; disk_buff= NULL; diff --git a/sql/tztime.cc b/sql/tztime.cc index bd8e43075c4..fe23954bbb2 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -949,13 +949,12 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, */ if (shift) { - if (local_t > (TIMESTAMP_MAX_VALUE - shift*86400L + - sp->revtis[i].rt_offset - saved_seconds)) + if (local_t > (my_time_t) (TIMESTAMP_MAX_VALUE - shift*86400L + + sp->revtis[i].rt_offset - saved_seconds)) { DBUG_RETURN(0); /* my_time_t overflow */ } - else - local_t+= shift*86400L; + local_t+= shift*86400L; } if (sp->revtis[i].rt_type) diff --git a/sql/unireg.cc b/sql/unireg.cc index 768a288ca19..8568b09e498 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -394,16 +394,16 @@ static uint pack_keys(uchar *keybuff, uint key_count, KEY *keyinfo, pos[6]=pos[7]=0; // For the future pos+=8; key_parts+=key->key_parts; - DBUG_PRINT("loop",("flags: %d key_parts: %d at 0x%lx", - key->flags,key->key_parts, - key->key_part)); + DBUG_PRINT("loop", ("flags: %d key_parts: %d at 0x%lx", + key->flags, key->key_parts, + (long) key->key_part)); for (key_part=key->key_part,key_part_end=key_part+key->key_parts ; key_part != key_part_end ; key_part++) { uint offset; - DBUG_PRINT("loop",("field: %d startpos: %lu length: %ld", + DBUG_PRINT("loop",("field: %d startpos: %lu length: %d", key_part->fieldnr, key_part->offset + data_offset, key_part->length)); int2store(pos,key_part->fieldnr+1+FIELD_NAME_USED); |