diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 150f21ad8ae..a7987f1596e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18308,22 +18308,22 @@ wsrep_innobase_kill_one_trx( if (!thd) { DBUG_PRINT("wsrep", ("no thd for conflicting lock")); - WSREP_WARN("no THD for trx: %lu", victim_trx->id); + WSREP_WARN("no THD for trx: %lu", (ulong) victim_trx->id); DBUG_RETURN(1); } if (!bf_thd) { DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? bf_trx->id : 0); + WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? (ulong) bf_trx->id : (ulong) 0); DBUG_RETURN(1); } WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %lu", + WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %llu", signal, (long long)bf_seqno, thd_get_thread_id(thd), - victim_trx->id); + (ulonglong) victim_trx->id); WSREP_DEBUG("Aborting query: %s", (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); @@ -18340,14 +18340,15 @@ wsrep_innobase_kill_one_trx( if (wsrep_thd_query_state(thd) == QUERY_EXITING) { - WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id); + WSREP_DEBUG("kill trx EXITING for %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: %lu, state: %d", - victim_trx->id, + WSREP_DEBUG("withdraw for BF trx: %llu, state: %d", + (longlong) victim_trx->id, wsrep_thd_get_conflict_state(thd)); } @@ -18356,8 +18357,8 @@ wsrep_innobase_kill_one_trx( wsrep_thd_set_conflict_state(thd, MUST_ABORT); break; case MUST_ABORT: - WSREP_DEBUG("victim %lu in MUST ABORT state", - victim_trx->id); + WSREP_DEBUG("victim %llu in MUST ABORT state", + (longlong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(0); @@ -18365,8 +18366,9 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim %lu in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim %llu in state %d", + (longlong) victim_trx->id, + wsrep_thd_get_conflict_state(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -18378,8 +18380,8 @@ wsrep_innobase_kill_one_trx( WSREP_DEBUG("kill query for: %ld", thd_get_thread_id(thd)); - WSREP_DEBUG("kill trx QUERY_COMMITTING for %lu", - victim_trx->id); + WSREP_DEBUG("kill trx QUERY_COMMITTING for %llu", + (longlong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { wsrep_abort_slave_trx(bf_seqno, @@ -18393,8 +18395,8 @@ wsrep_innobase_kill_one_trx( switch (rcode) { case WSREP_WARNING: - WSREP_DEBUG("cancel commit warning: %lu", - victim_trx->id); + WSREP_DEBUG("cancel commit warning: %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(1); @@ -18403,9 +18405,9 @@ wsrep_innobase_kill_one_trx( break; default: WSREP_ERROR( - "cancel commit bad exit: %d %lu", + "cancel commit bad exit: %d %llu", rcode, - victim_trx->id); + (ulonglong) victim_trx->id); /* unable to interrupt, must abort */ /* note: kill_mysql() will block, if we cannot. * kill the lock holder first. @@ -18421,7 +18423,8 @@ wsrep_innobase_kill_one_trx( /* it is possible that victim trx is itself waiting for some * other lock. We need to cancel this waiting */ - WSREP_DEBUG("kill trx QUERY_EXEC for %lu", victim_trx->id); + WSREP_DEBUG("kill trx QUERY_EXEC for %llu", + (ulonglong) victim_trx->id); victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; if (victim_trx->lock.wait_lock) { @@ -18456,7 +18459,7 @@ wsrep_innobase_kill_one_trx( break; case QUERY_IDLE: { - WSREP_DEBUG("kill IDLE for %lu", victim_trx->id); + WSREP_DEBUG("kill IDLE for %llu", (ulonglong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { WSREP_DEBUG("kill BF IDLE, seqno: %lld", @@ -18473,7 +18476,7 @@ wsrep_innobase_kill_one_trx( if (wsrep_aborting_thd_contains(thd)) { WSREP_WARN("duplicate thd aborter %lu", - thd_get_thread_id(thd)); + (ulong) thd_get_thread_id(thd)); } else { wsrep_aborting_thd_enqueue(thd); DBUG_PRINT("wsrep",("enqueuing trx abort for %lu", diff --git a/storage/tokudb/PerconaFT/ft/bndata.cc b/storage/tokudb/PerconaFT/ft/bndata.cc index 4e2b4d090de..ecacb28acda 100644 --- a/storage/tokudb/PerconaFT/ft/bndata.cc +++ b/storage/tokudb/PerconaFT/ft/bndata.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc index 5bba977de1a..4495694e06f 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc +++ b/storage/tokudb/PerconaFT/ft/cachetable/cachetable.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include diff --git a/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc b/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc index 3223ab0a4ce..4d54962fe9c 100644 --- a/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc +++ b/storage/tokudb/PerconaFT/ft/cachetable/checkpoint.cc @@ -73,6 +73,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. * *****/ +#include #include #include "portability/toku_portability.h" diff --git a/storage/tokudb/PerconaFT/ft/cursor.cc b/storage/tokudb/PerconaFT/ft/cursor.cc index 8f598d0a0df..5402763f7a7 100644 --- a/storage/tokudb/PerconaFT/ft/cursor.cc +++ b/storage/tokudb/PerconaFT/ft/cursor.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft-internal.h" #include "ft/cursor.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc index ca5ffa6a186..3623847c6f8 100644 --- a/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc +++ b/storage/tokudb/PerconaFT/ft/ft-cachetable-wrappers.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/serialize/block_table.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-flusher.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-flusher.cc b/storage/tokudb/PerconaFT/ft/ft-flusher.cc index 0ded678a211..0232ae8bef6 100644 --- a/storage/tokudb/PerconaFT/ft/ft-flusher.cc +++ b/storage/tokudb/PerconaFT/ft/ft-flusher.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-internal.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc b/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc index 405bcd5b8f1..ffab8647541 100644 --- a/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc +++ b/storage/tokudb/PerconaFT/ft/ft-hot-flusher.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-flusher.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-ops.cc b/storage/tokudb/PerconaFT/ft/ft-ops.cc index f5da82ee000..e3fa7c1928a 100644 --- a/storage/tokudb/PerconaFT/ft/ft-ops.cc +++ b/storage/tokudb/PerconaFT/ft/ft-ops.cc @@ -147,6 +147,7 @@ basement nodes, bulk fetch, and partial fetch: */ +#include #include "ft/cachetable/checkpoint.h" #include "ft/cursor.h" #include "ft/ft.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-status.cc b/storage/tokudb/PerconaFT/ft/ft-status.cc index 982df1822c4..f885e7c69a4 100644 --- a/storage/tokudb/PerconaFT/ft/ft-status.cc +++ b/storage/tokudb/PerconaFT/ft/ft-status.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-status.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc index 7ca36c23780..2a926f83f84 100644 --- a/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc +++ b/storage/tokudb/PerconaFT/ft/ft-test-helpers.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" #include "ft/ft-internal.h" diff --git a/storage/tokudb/PerconaFT/ft/ft-verify.cc b/storage/tokudb/PerconaFT/ft/ft-verify.cc index a2835f730eb..7e3a64f441e 100644 --- a/storage/tokudb/PerconaFT/ft/ft-verify.cc +++ b/storage/tokudb/PerconaFT/ft/ft-verify.cc @@ -44,6 +44,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. * For each nonleaf node: All the messages have keys that are between the associated pivot keys ( left_pivot_key < message <= right_pivot_key) */ +#include #include "ft/serialize/block_table.h" #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" diff --git a/storage/tokudb/PerconaFT/ft/ft.cc b/storage/tokudb/PerconaFT/ft/ft.cc index 2a0fb6f6800..e6056a73031 100644 --- a/storage/tokudb/PerconaFT/ft/ft.cc +++ b/storage/tokudb/PerconaFT/ft/ft.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/serialize/block_table.h" #include "ft/ft.h" #include "ft/ft-cachetable-wrappers.h" diff --git a/storage/tokudb/PerconaFT/ft/le-cursor.cc b/storage/tokudb/PerconaFT/ft/le-cursor.cc index 81d0d3694a4..b90d48dc5ba 100644 --- a/storage/tokudb/PerconaFT/ft/le-cursor.cc +++ b/storage/tokudb/PerconaFT/ft/le-cursor.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-internal.h" #include "ft/le-cursor.h" diff --git a/storage/tokudb/PerconaFT/ft/leafentry.cc b/storage/tokudb/PerconaFT/ft/leafentry.cc index 56ce0c9d945..fcb9a344e27 100644 --- a/storage/tokudb/PerconaFT/ft/leafentry.cc +++ b/storage/tokudb/PerconaFT/ft/leafentry.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "serialize/wbuf.h" #include "leafentry.h" diff --git a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc index 28d8d49ba9f..64722bd68f1 100644 --- a/storage/tokudb/PerconaFT/ft/loader/dbufio.cc +++ b/storage/tokudb/PerconaFT/ft/loader/dbufio.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include @@ -135,7 +136,7 @@ static ssize_t dbf_read_some_compressed(struct dbufio_file *dbf, char *buf, size ret = 0; goto exit; } - if (readcode < header_size) { + if (readcode < (ssize_t) header_size) { errno = TOKUDB_NO_DATA; ret = -1; goto exit; @@ -163,7 +164,7 @@ static ssize_t dbf_read_some_compressed(struct dbufio_file *dbf, char *buf, size ret = -1; goto exit; } - if (readcode < total_size) { + if (readcode < (ssize_t) total_size) { errno = TOKUDB_NO_DATA; ret = -1; goto exit; diff --git a/storage/tokudb/PerconaFT/ft/loader/loader.cc b/storage/tokudb/PerconaFT/ft/loader/loader.cc index 5ff0d69af46..18f862581f1 100644 --- a/storage/tokudb/PerconaFT/ft/loader/loader.cc +++ b/storage/tokudb/PerconaFT/ft/loader/loader.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/tokudb/PerconaFT/ft/loader/pqueue.cc b/storage/tokudb/PerconaFT/ft/loader/pqueue.cc index 9ca37b1564b..950ab259f46 100644 --- a/storage/tokudb/PerconaFT/ft/loader/pqueue.cc +++ b/storage/tokudb/PerconaFT/ft/loader/pqueue.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include "toku_os.h" #include "ft-internal.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc b/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc index 6dca8c25378..45faa18cfb0 100644 --- a/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc +++ b/storage/tokudb/PerconaFT/ft/logger/log_upgrade.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include "log-internal.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/logcursor.cc b/storage/tokudb/PerconaFT/ft/logger/logcursor.cc index f13419ae43e..910a608cef9 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logcursor.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logcursor.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "log-internal.h" #include "logger/logcursor.h" #include diff --git a/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc b/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc index af8eb19d770..e9028f49daf 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logfilemgr.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "logger/log-internal.h" #include "logger/logcursor.h" #include "logger/logfilemgr.h" diff --git a/storage/tokudb/PerconaFT/ft/logger/logger.cc b/storage/tokudb/PerconaFT/ft/logger/logger.cc index eacec9cb83f..d6d1673b5e3 100644 --- a/storage/tokudb/PerconaFT/ft/logger/logger.cc +++ b/storage/tokudb/PerconaFT/ft/logger/logger.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include #include diff --git a/storage/tokudb/PerconaFT/ft/logger/recover.cc b/storage/tokudb/PerconaFT/ft/logger/recover.cc index 38f29773bd6..77eee8630a9 100644 --- a/storage/tokudb/PerconaFT/ft/logger/recover.cc +++ b/storage/tokudb/PerconaFT/ft/logger/recover.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/cachetable/cachetable.h" #include "ft/cachetable/checkpoint.h" #include "ft/ft.h" diff --git a/storage/tokudb/PerconaFT/ft/msg.cc b/storage/tokudb/PerconaFT/ft/msg.cc index f4f2c747734..b53b946b241 100644 --- a/storage/tokudb/PerconaFT/ft/msg.cc +++ b/storage/tokudb/PerconaFT/ft/msg.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "portability/toku_portability.h" #include "ft/msg.h" diff --git a/storage/tokudb/PerconaFT/ft/node.cc b/storage/tokudb/PerconaFT/ft/node.cc index 44dbc73ba2b..f04a8050294 100644 --- a/storage/tokudb/PerconaFT/ft/node.cc +++ b/storage/tokudb/PerconaFT/ft/node.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "ft/ft.h" #include "ft/ft-internal.h" #include "ft/serialize/ft_node-serialize.h" diff --git a/storage/tokudb/PerconaFT/ft/pivotkeys.cc b/storage/tokudb/PerconaFT/ft/pivotkeys.cc index b4a26d03ee1..b941ac62a42 100644 --- a/storage/tokudb/PerconaFT/ft/pivotkeys.cc +++ b/storage/tokudb/PerconaFT/ft/pivotkeys.cc @@ -35,6 +35,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include "portability/memory.h" diff --git a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc index 7101ba9f58c..ec5a1140310 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/block_table.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/block_table.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include "portability/memory.h" #include "portability/toku_assert.h" #include "portability/toku_portability.h" diff --git a/storage/tokudb/PerconaFT/ft/serialize/compress.cc b/storage/tokudb/PerconaFT/ft/serialize/compress.cc index 1719b6b7cb5..113a8763510 100644 --- a/storage/tokudb/PerconaFT/ft/serialize/compress.cc +++ b/storage/tokudb/PerconaFT/ft/serialize/compress.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include @@ -97,7 +98,6 @@ void toku_compress (enum toku_compression_method a, static const int zlib_without_checksum_windowbits = -15; a = normalize_compression_method(a); - assert(sourceLen < (1LL << 32)); switch (a) { case TOKU_NO_COMPRESSION: dest[0] = TOKU_NO_COMPRESSION; @@ -171,8 +171,10 @@ void toku_compress (enum toku_compression_method a, return; } case TOKU_SNAPPY_METHOD: { - snappy::RawCompress((char*)source, sourceLen, (char*)dest + 1, destLen); - *destLen += 1; + size_t tmp_dest= *destLen; + snappy::RawCompress((char*)source, sourceLen, (char*)dest + 1, + &tmp_dest); + *destLen= tmp_dest + 1; dest[0] = TOKU_SNAPPY_METHOD; return; } diff --git a/storage/tokudb/PerconaFT/ft/ule.cc b/storage/tokudb/PerconaFT/ft/ule.cc index 573c4488f70..117c9fd3fb4 100644 --- a/storage/tokudb/PerconaFT/ft/ule.cc +++ b/storage/tokudb/PerconaFT/ft/ule.cc @@ -47,6 +47,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. // See design documentation for nested transactions at // TokuWiki/Imp/TransactionsOverview. +#include #include "portability/toku_portability.h" #include "ft/ft-internal.h" diff --git a/storage/tokudb/PerconaFT/portability/toku_portability.h b/storage/tokudb/PerconaFT/portability/toku_portability.h index 921d3a309f6..459567552b1 100644 --- a/storage/tokudb/PerconaFT/portability/toku_portability.h +++ b/storage/tokudb/PerconaFT/portability/toku_portability.h @@ -178,6 +178,8 @@ extern void *realloc(void*, size_t) __THROW __attribute__((__deprecat # endif #if !defined(__APPLE__) // Darwin headers use these types, we should not poison them +#undef TRUE +#undef FALSE # pragma GCC poison u_int8_t # pragma GCC poison u_int16_t # pragma GCC poison u_int32_t diff --git a/storage/tokudb/PerconaFT/src/ydb.cc b/storage/tokudb/PerconaFT/src/ydb.cc index 88c6c86f214..2292cc1e8ba 100644 --- a/storage/tokudb/PerconaFT/src/ydb.cc +++ b/storage/tokudb/PerconaFT/src/ydb.cc @@ -39,6 +39,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. extern const char *toku_patent_string; const char *toku_copyright_string = "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved."; +#include #include #include #include diff --git a/storage/tokudb/PerconaFT/src/ydb_db.cc b/storage/tokudb/PerconaFT/src/ydb_db.cc index 25b24467684..806ea7c6ebe 100644 --- a/storage/tokudb/PerconaFT/src/ydb_db.cc +++ b/storage/tokudb/PerconaFT/src/ydb_db.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/tokudb/PerconaFT/src/ydb_env_func.cc b/storage/tokudb/PerconaFT/src/ydb_env_func.cc index 13c56fec6bf..cd5388106ac 100644 --- a/storage/tokudb/PerconaFT/src/ydb_env_func.cc +++ b/storage/tokudb/PerconaFT/src/ydb_env_func.cc @@ -36,6 +36,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." +#include #include #include diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index ceffa950739..4b7102d9fd6 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -465,7 +465,7 @@ fil_parse_write_crypt_data( buf_block_t* block) /*!< in: buffer block */ { /* check that redo log entry is complete */ - uint entry_size = + size_t entry_size = 4 + // size of space_id 2 + // size of offset 1 + // size of type @@ -474,7 +474,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (end_ptr - ptr < entry_size){ + if ((size_t) (end_ptr - ptr) < entry_size){ return NULL; } @@ -484,7 +484,7 @@ fil_parse_write_crypt_data( ptr += 2; uint type = mach_read_from_1(ptr); ptr += 1; - uint len = mach_read_from_1(ptr); + size_t len = mach_read_from_1(ptr); ptr += 1; ut_a(type == CRYPT_SCHEME_UNENCRYPTED || @@ -500,7 +500,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (end_ptr - ptr < len) { + if ((size_t) (end_ptr - ptr) < len) { return NULL; } @@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation( last_scrub_completed; bool need_scrubbing = crypt_data->rotate_state.scrubbing.is_active - && diff >= srv_background_scrub_data_interval; + && diff >= (time_t) srv_background_scrub_data_interval; if (need_key_rotation == false && need_scrubbing == false) break; @@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)( time_t waited = time(0) - wait_start; - if (waited >= srv_background_scrub_data_check_interval) { + if (waited >= (time_t) srv_background_scrub_data_check_interval) { break; } } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index df0f74fbb92..38cd3177ade 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -19226,22 +19226,22 @@ wsrep_innobase_kill_one_trx( if (!thd) { DBUG_PRINT("wsrep", ("no thd for conflicting lock")); - WSREP_WARN("no THD for trx: %lu", victim_trx->id); + WSREP_WARN("no THD for trx: %lu", (ulong) victim_trx->id); DBUG_RETURN(1); } if (!bf_thd) { DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); - WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? bf_trx->id : 0); + WSREP_WARN("no BF THD for trx: %lu", (bf_trx) ? (ulong) bf_trx->id : (ulong) 0); DBUG_RETURN(1); } WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); - WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %lu", + WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: %llu", signal, (long long)bf_seqno, thd_get_thread_id(thd), - victim_trx->id); + (ulonglong) victim_trx->id); WSREP_DEBUG("Aborting query: %s", (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); @@ -19258,14 +19258,15 @@ wsrep_innobase_kill_one_trx( if (wsrep_thd_query_state(thd) == QUERY_EXITING) { - WSREP_DEBUG("kill trx EXITING for %lu", victim_trx->id); + WSREP_DEBUG("kill trx EXITING for %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); } if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { - WSREP_DEBUG("withdraw for BF trx: %lu, state: %d", - victim_trx->id, + WSREP_DEBUG("withdraw for BF trx: %llu, state: %d", + (longlong) victim_trx->id, wsrep_thd_get_conflict_state(thd)); } @@ -19274,8 +19275,8 @@ wsrep_innobase_kill_one_trx( wsrep_thd_set_conflict_state(thd, MUST_ABORT); break; case MUST_ABORT: - WSREP_DEBUG("victim %lu in MUST ABORT state", - victim_trx->id); + WSREP_DEBUG("victim %llu in MUST ABORT state", + (longlong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(0); @@ -19283,8 +19284,9 @@ wsrep_innobase_kill_one_trx( case ABORTED: case ABORTING: // fall through default: - WSREP_DEBUG("victim %lu in state %d", - victim_trx->id, wsrep_thd_get_conflict_state(thd)); + WSREP_DEBUG("victim %llu in state %d", + (longlong) victim_trx->id, + wsrep_thd_get_conflict_state(thd)); wsrep_thd_UNLOCK(thd); DBUG_RETURN(0); break; @@ -19296,8 +19298,8 @@ wsrep_innobase_kill_one_trx( WSREP_DEBUG("kill query for: %ld", thd_get_thread_id(thd)); - WSREP_DEBUG("kill trx QUERY_COMMITTING for %lu", - victim_trx->id); + WSREP_DEBUG("kill trx QUERY_COMMITTING for %llu", + (longlong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { wsrep_abort_slave_trx(bf_seqno, @@ -19311,8 +19313,8 @@ wsrep_innobase_kill_one_trx( switch (rcode) { case WSREP_WARNING: - WSREP_DEBUG("cancel commit warning: %lu", - victim_trx->id); + WSREP_DEBUG("cancel commit warning: %llu", + (ulonglong) victim_trx->id); wsrep_thd_UNLOCK(thd); wsrep_thd_awake(thd, signal); DBUG_RETURN(1); @@ -19321,9 +19323,9 @@ wsrep_innobase_kill_one_trx( break; default: WSREP_ERROR( - "cancel commit bad exit: %d %lu", + "cancel commit bad exit: %d %llu", rcode, - victim_trx->id); + (ulonglong) victim_trx->id); /* unable to interrupt, must abort */ /* note: kill_mysql() will block, if we cannot. * kill the lock holder first. @@ -19339,7 +19341,8 @@ wsrep_innobase_kill_one_trx( /* it is possible that victim trx is itself waiting for some * other lock. We need to cancel this waiting */ - WSREP_DEBUG("kill trx QUERY_EXEC for %lu", victim_trx->id); + WSREP_DEBUG("kill trx QUERY_EXEC for %llu", + (ulonglong) victim_trx->id); victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; if (victim_trx->lock.wait_lock) { @@ -19374,7 +19377,7 @@ wsrep_innobase_kill_one_trx( break; case QUERY_IDLE: { - WSREP_DEBUG("kill IDLE for %lu", victim_trx->id); + WSREP_DEBUG("kill IDLE for %llu", (ulonglong) victim_trx->id); if (wsrep_thd_exec_mode(thd) == REPL_RECV) { WSREP_DEBUG("kill BF IDLE, seqno: %lld", @@ -19391,7 +19394,7 @@ wsrep_innobase_kill_one_trx( if (wsrep_aborting_thd_contains(thd)) { WSREP_WARN("duplicate thd aborter %lu", - thd_get_thread_id(thd)); + (ulong) thd_get_thread_id(thd)); } else { wsrep_aborting_thd_enqueue(thd); DBUG_PRINT("wsrep",("enqueuing trx abort for %lu",