summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0btr.cc6
-rw-r--r--storage/innobase/btr/btr0scrub.cc21
-rw-r--r--storage/innobase/buf/buf0buf.cc31
-rw-r--r--storage/innobase/buf/buf0lru.cc23
-rw-r--r--storage/innobase/data/data0data.cc2
-rw-r--r--storage/innobase/dict/dict0dict.cc6
-rw-r--r--storage/innobase/dict/dict0stats.cc30
-rw-r--r--storage/innobase/fil/fil0crypt.cc8
-rw-r--r--storage/innobase/fil/fil0fil.cc2
-rw-r--r--storage/innobase/fil/fil0pagecompress.cc6
-rw-r--r--storage/innobase/fts/fts0config.cc6
-rw-r--r--storage/innobase/fts/fts0fts.cc4
-rw-r--r--storage/innobase/fts/fts0que.cc3
-rw-r--r--storage/innobase/handler/ha_innodb.cc95
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc23
-rw-r--r--storage/innobase/include/fil0fil.ic2
-rw-r--r--storage/innobase/include/mtr0log.ic20
-rw-r--r--storage/innobase/include/univ.i63
-rw-r--r--storage/innobase/lock/lock0lock.cc15
-rw-r--r--storage/innobase/log/log0log.cc9
-rw-r--r--storage/innobase/os/os0file.cc10
-rw-r--r--storage/innobase/page/page0cur.cc3
-rw-r--r--storage/innobase/page/page0zip.cc2
-rw-r--r--storage/innobase/rem/rem0rec.cc42
-rw-r--r--storage/innobase/row/row0ftsort.cc6
-rw-r--r--storage/innobase/row/row0import.cc104
-rw-r--r--storage/innobase/row/row0mysql.cc4
-rw-r--r--storage/innobase/srv/srv0srv.cc17
-rw-r--r--storage/innobase/srv/srv0start.cc14
-rw-r--r--storage/innobase/sync/sync0arr.cc9
-rw-r--r--storage/innobase/trx/trx0i_s.cc4
-rw-r--r--storage/innobase/trx/trx0sys.cc4
-rw-r--r--storage/innobase/ut/ut0ut.cc9
33 files changed, 288 insertions, 315 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index f75d6d529a7..489b612a17a 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -5163,9 +5163,9 @@ loop:
rec = btr_cur_get_rec(&node_cur);
fprintf(stderr, "\n"
- "InnoDB: node ptr child page n:o %lu\n",
- (ulong) btr_node_ptr_get_child_page_no(
- rec, offsets));
+ "InnoDB: node ptr child page n:o "
+ ULINTPF "\n",
+ btr_node_ptr_get_child_page_no(rec, offsets));
fputs("InnoDB: record on page ", stderr);
rec_print_new(stderr, rec, offsets);
diff --git a/storage/innobase/btr/btr0scrub.cc b/storage/innobase/btr/btr0scrub.cc
index 0d59481c4b5..307d6d0ec6c 100644
--- a/storage/innobase/btr/btr0scrub.cc
+++ b/storage/innobase/btr/btr0scrub.cc
@@ -1,4 +1,5 @@
// Copyright (c) 2014, Google Inc.
+// Copyright (c) 2017, MariaDB Corporation.
/**************************************************//**
@file btr/btr0scrub.cc
@@ -102,16 +103,9 @@ log_scrub_failure(
scrub_data->scrub_stat.page_split_failures_unknown++;
}
- buf_frame_t* buf = buf_block_get_frame(block);
- const ulint space_id = mach_read_from_4(buf + FIL_PAGE_SPACE_ID);
- const ulint page_no = mach_read_from_4(buf + FIL_PAGE_OFFSET);
- fprintf(stderr,
- "InnoDB: Warning: Failed to scrub index %s table %s page %lu in space %lu : %s\n",
- index->name(),
- index->table->name.m_name,
- page_no,
- space_id,
- reason);
+ ib::warn() << "Failed to scrub index " << index->name
+ << " of table " << index->table->name
+ << " page " << block->page.id << ": " << reason;
}
/****************************************************************
@@ -152,11 +146,10 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table,
if (now >= last + 30) {
fprintf(stderr,
- "WARNING: %s:%u waited %lu seconds for"
+ "WARNING: %s:%u waited %ld seconds for"
" dict_sys lock, space: " ULINTPF
- " lock_to_close_table: %u\n",
- file, line, (unsigned long)(now - start),
- space_id,
+ " lock_to_close_table: %d\n",
+ file, line, long(now - start), space_id,
lock_to_close_table);
last = now;
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index a6ed277a90e..1ddd4c483e1 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -5266,7 +5266,7 @@ buf_page_init(
ut_d(buf_LRU_print());
ut_d(buf_validate());
ut_d(buf_LRU_validate());
- ut_ad(0);
+ ut_error;
}
ut_ad(!block->page.in_zip_hash);
@@ -6076,7 +6076,7 @@ database_corrupted:
}
ib_push_warning(innobase_get_trx(), DB_DECRYPTION_FAILED,
- "Table in tablespace %lu encrypted."
+ "Table in tablespace %u encrypted."
"However key management plugin or used key_id %lu is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
@@ -7066,15 +7066,16 @@ buf_print_io_instance(
ut_ad(pool_info);
fprintf(file,
- "Buffer pool size %lu\n"
- "Free buffers %lu\n"
- "Database pages %lu\n"
- "Old database pages %lu\n"
- "Modified db pages %lu\n"
+ "Buffer pool size " ULINTPF "\n"
+ "Free buffers " ULINTPF "\n"
+ "Database pages " ULINTPF "\n"
+ "Old database pages " ULINTPF "\n"
+ "Modified db pages " ULINTPF "\n"
"Percent of dirty pages(LRU & free pages): %.3f\n"
"Max dirty pages percent: %.3f\n"
- "Pending reads %lu\n"
- "Pending writes: LRU %lu, flush list %lu, single page %lu\n",
+ "Pending reads " ULINTPF "\n"
+ "Pending writes: LRU " ULINTPF ", flush list " ULINTPF
+ ", single page " ULINTPF "\n",
pool_info->pool_size,
pool_info->free_list_len,
pool_info->lru_len,
@@ -7089,9 +7090,10 @@ buf_print_io_instance(
pool_info->n_pending_flush_single_page);
fprintf(file,
- "Pages made young %lu, not young %lu\n"
+ "Pages made young " ULINTPF ", not young " ULINTPF "\n"
"%.2f youngs/s, %.2f non-youngs/s\n"
- "Pages read %lu, created %lu, written %lu\n"
+ "Pages read " ULINTPF ", created " ULINTPF
+ ", written " ULINTPF "\n"
"%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
pool_info->n_pages_made_young,
pool_info->n_pages_not_made_young,
@@ -7115,8 +7117,9 @@ buf_print_io_instance(
hit_rate = 1000 - hit_rate;
fprintf(file,
- "Buffer pool hit rate %lu / 1000,"
- " young-making rate %lu / 1000 not %lu / 1000\n",
+ "Buffer pool hit rate " ULINTPF " / 1000,"
+ " young-making rate " ULINTPF " / 1000 not "
+ ULINTPF " / 1000\n",
(ulint) hit_rate,
(ulint) (1000 * pool_info->young_making_delta
/ pool_info->n_page_get_delta),
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index d6d5db3dfa9..c492ec60494 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2664,13 +2665,13 @@ buf_LRU_print_instance(
}
if (bpage->buf_fix_count) {
- fprintf(stderr, "buffix count %lu ",
- (ulong) bpage->buf_fix_count);
+ fprintf(stderr, "buffix count %u ",
+ bpage->buf_fix_count);
}
if (buf_page_get_io_fix(bpage)) {
- fprintf(stderr, "io_fix %lu ",
- (ulong) buf_page_get_io_fix(bpage));
+ fprintf(stderr, "io_fix %d ",
+ buf_page_get_io_fix(bpage));
}
if (bpage->oldest_modification) {
@@ -2681,23 +2682,23 @@ buf_LRU_print_instance(
const byte* frame;
case BUF_BLOCK_FILE_PAGE:
frame = buf_block_get_frame((buf_block_t*) bpage);
- fprintf(stderr, "\ntype %lu"
+ fprintf(stderr, "\ntype " ULINTPF
" index id " IB_ID_FMT "\n",
- (ulong) fil_page_get_type(frame),
+ fil_page_get_type(frame),
btr_page_get_index_id(frame));
break;
case BUF_BLOCK_ZIP_PAGE:
frame = bpage->zip.data;
- fprintf(stderr, "\ntype %lu size %lu"
+ fprintf(stderr, "\ntype " ULINTPF " size " ULINTPF
" index id " IB_ID_FMT "\n",
- (ulong) fil_page_get_type(frame),
- (ulong) bpage->size.physical(),
+ fil_page_get_type(frame),
+ bpage->size.physical(),
btr_page_get_index_id(frame));
break;
default:
- fprintf(stderr, "\n!state %lu!\n",
- (ulong) buf_page_get_state(bpage));
+ fprintf(stderr, "\n!state %d!\n",
+ buf_page_get_state(bpage));
break;
}
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index 8b1900face7..d819ad50ed9 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -429,7 +429,7 @@ print_hex:
fputs(" Hex: ",stderr);
for (i = 0; i < len; i++) {
- fprintf(stderr, "%02lx", static_cast<ulong>(*data++));
+ fprintf(stderr, "%02x", *data++);
}
if (dfield_is_ext(dfield)) {
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index d7fcbdf3906..06f68fbf6bd 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -6596,7 +6596,7 @@ dict_table_schema_check(
if ((ulint) table->n_def - n_sys_cols != req_schema->n_cols) {
/* the table has a different number of columns than required */
ut_snprintf(errstr, errstr_sz,
- "%s has %lu columns but should have %lu.",
+ "%s has %lu columns but should have " ULINTPF ".",
ut_format_name(req_schema->table_name,
buf, sizeof(buf)),
table->n_def - n_sys_cols,
@@ -6694,7 +6694,7 @@ dict_table_schema_check(
ut_snprintf(
errstr, errstr_sz,
"Table %s has " ULINTPF " foreign key(s) pointing"
- " to other tables, but it must have %lu.",
+ " to other tables, but it must have " ULINTPF ".",
ut_format_name(req_schema->table_name,
buf, sizeof(buf)),
static_cast<ulint>(table->foreign_set.size()),
@@ -6706,7 +6706,7 @@ dict_table_schema_check(
ut_snprintf(
errstr, errstr_sz,
"There are " ULINTPF " foreign key(s) pointing to %s, "
- "but there must be %lu.",
+ "but there must be " ULINTPF ".",
static_cast<ulint>(table->referenced_set.size()),
ut_format_name(req_schema->table_name,
buf, sizeof(buf)),
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 0c8642df3ed..47bab4141de 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
-Copyright (c) 2009, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1046,8 +1047,8 @@ dict_stats_analyze_index_level(
ulint* prev_rec_offsets;
ulint i;
- DEBUG_PRINTF(" %s(table=%s, index=%s, level=%lu)\n", __func__,
- index->table->name, index->name, level);
+ DEBUG_PRINTF(" %s(table=%s, index=%s, level=" ULINTPF ")\n",
+ __func__, index->table->name, index->name, level);
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_SX_LOCK));
@@ -1292,7 +1293,7 @@ dict_stats_analyze_index_level(
DEBUG_PRINTF(" %s(): total recs: " UINT64PF
", total pages: " UINT64PF
- ", n_diff[%lu]: " UINT64PF "\n",
+ ", n_diff[" ULINTPF "]: " UINT64PF "\n",
__func__, *total_recs,
*total_pages,
i, n_diff[i]);
@@ -1912,8 +1913,9 @@ dict_stats_index_set_n_diff(
index->stat_n_sample_sizes[n_prefix - 1]
= data->n_leaf_pages_to_analyze;
- DEBUG_PRINTF(" %s(): n_diff=" UINT64PF " for n_prefix=%lu"
- " (%lu"
+ DEBUG_PRINTF(" %s(): n_diff=" UINT64PF
+ " for n_prefix=" ULINTPF
+ " (" ULINTPF
" * " UINT64PF " / " UINT64PF
" * " UINT64PF " / " UINT64PF ")\n",
__func__,
@@ -2068,8 +2070,8 @@ dict_stats_analyze_index(
for (n_prefix = n_uniq; n_prefix >= 1; n_prefix--) {
- DEBUG_PRINTF(" %s(): searching level with >=%llu"
- " distinct records, n_prefix=%lu\n",
+ DEBUG_PRINTF(" %s(): searching level with >=%llu "
+ "distinct records, n_prefix=" ULINTPF "\n",
__func__, N_DIFF_REQUIRED(index), n_prefix);
/* Commit the mtr to release the tree S lock to allow
@@ -2173,8 +2175,9 @@ dict_stats_analyze_index(
}
found_level:
- DEBUG_PRINTF(" %s(): found level %lu that has " UINT64PF
- " distinct records for n_prefix=%lu\n",
+ DEBUG_PRINTF(" %s(): found level " ULINTPF
+ " that has " UINT64PF
+ " distinct records for n_prefix=" ULINTPF "\n",
__func__, level, n_diff_on_level[n_prefix - 1],
n_prefix);
/* here we are either on level 1 or the level that we are on
@@ -2535,20 +2538,19 @@ dict_stats_save(
ut_ad(!dict_index_is_ibuf(index));
- for (ulint i = 0; i < index->n_uniq; i++) {
+ for (unsigned i = 0; i < index->n_uniq; i++) {
char stat_name[16];
char stat_description[1024];
- ulint j;
ut_snprintf(stat_name, sizeof(stat_name),
- "n_diff_pfx%02lu", i + 1);
+ "n_diff_pfx%02u", i + 1);
/* craft a string that contains the column names */
ut_snprintf(stat_description,
sizeof(stat_description),
"%s", index->fields[0].name());
- for (j = 1; j <= i; j++) {
+ for (unsigned j = 1; j <= i; j++) {
size_t len;
len = strlen(stat_description);
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index db7efe89d37..5ad91759d89 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2014, 2017, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2014, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -731,7 +731,8 @@ fil_space_decrypt(
<< " carries key_version " << key_version
<< " (should be undefined)");
- mach_write_to_4(src_frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0);
+ memset(src_frame
+ + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0, 4);
}
return false;
@@ -1324,7 +1325,8 @@ fil_crypt_realloc_iops(
} else {
DBUG_PRINT("ib_crypt",
- ("thr_no: %u only waited %lu%% skip re-estimate.",
+ ("thr_no: %u only waited " ULINTPF
+ "%% skip re-estimate.",
state->thread_no,
(100 * state->cnt_waited) / state->batch));
}
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 06ec31a7ed4..806c2d4ed7f 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -3859,8 +3859,6 @@ fil_ibd_create(
return(DB_OUT_OF_FILE_SPACE);
}
- /* printf("Creating tablespace %s id %lu\n", path, space_id); */
-
/* We have to write the space id to the file immediately and flush the
file to disk. This is because in crash recovery we must be aware what
tablespaces exist and what are their space id's, so that we can apply
diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc
index 39a02aa40df..e9a9a0c59a0 100644
--- a/storage/innobase/fil/fil0pagecompress.cc
+++ b/storage/innobase/fil/fil0pagecompress.cc
@@ -153,7 +153,8 @@ fil_compress_page(
#ifdef UNIV_PAGECOMPRESS_DEBUG
ib_logf(IB_LOG_LEVEL_INFO,
- "Preparing for compress for space %lu name %s len %lu.",
+ "Preparing for compress for space " ULINTPF
+ " name %s len " ULINTPF ".",
space_id, fil_space_name(space), len);
#endif /* UNIV_PAGECOMPRESS_DEBUG */
@@ -341,7 +342,8 @@ fil_compress_page(
#ifdef UNIV_PAGECOMPRESS_DEBUG
ib_logf(IB_LOG_LEVEL_INFO,
- "Compression succeeded for space %lu name %s len %lu out_len %lu.",
+ "Compression succeeded for space " ULINTPF
+ " name %s len " ULINTPF " out_len " ULINTPF ".",
space_id, fil_space_name(space), len, write_size);
#endif /* UNIV_PAGECOMPRESS_DEBUG */
diff --git a/storage/innobase/fts/fts0config.cc b/storage/innobase/fts/fts0config.cc
index cca3d5fcd87..4d41df1abf9 100644
--- a/storage/innobase/fts/fts0config.cc
+++ b/storage/innobase/fts/fts0config.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -349,7 +350,7 @@ fts_config_set_index_ulint(
ut_a(FTS_MAX_INT_LEN < FTS_MAX_CONFIG_VALUE_LEN);
value.f_len = ut_snprintf(
- (char*) value.f_str, FTS_MAX_INT_LEN, "%lu", int_value);
+ (char*) value.f_str, FTS_MAX_INT_LEN, ULINTPF, int_value);
error = fts_config_set_index_value(trx, index, name, &value);
@@ -422,7 +423,7 @@ fts_config_set_ulint(
ut_a(FTS_MAX_INT_LEN < FTS_MAX_CONFIG_VALUE_LEN);
value.f_len = my_snprintf(
- (char*) value.f_str, FTS_MAX_INT_LEN, "%lu", int_value);
+ (char*) value.f_str, FTS_MAX_INT_LEN, ULINTPF, int_value);
error = fts_config_set_value(trx, fts_table, name, &value);
@@ -435,4 +436,3 @@ fts_config_set_ulint(
return(error);
}
-
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index a7d09b5dd47..dd0e036170c 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, MariaDB Corporation. All Rights reserved.
+Copyright (c) 2016, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2542,7 +2542,7 @@ fts_get_max_cache_size(
{
dberr_t error;
fts_string_t value;
- ulint cache_size_in_mb;
+ ulong cache_size_in_mb;
/* Set to the default value. */
cache_size_in_mb = FTS_CACHE_SIZE_LOWER_LIMIT_IN_MB;
diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc
index beef71aa178..bc1d173cc29 100644
--- a/storage/innobase/fts/fts0que.cc
+++ b/storage/innobase/fts/fts0que.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -487,7 +488,7 @@ fts_query_lcs(
len = FTS_ELEM(table, c, 0, 0);
fts_print_lcs_table(table, r, c);
- printf("\nLen=%lu\n", len);
+ printf("\nLen=" ULINTPF "\n", len);
ut_free(table);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 6f219bb5d20..3e00e5e2ad2 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2334,7 +2334,8 @@ innobase_get_cset_width(
if (cset != 0) {
sql_print_warning(
- "Unknown collation #%lu.", cset);
+ "Unknown collation #" ULINTPF ".",
+ cset);
}
} else {
@@ -4268,9 +4269,8 @@ innobase_change_buffering_inited_ok:
} else if (srv_max_io_capacity < srv_io_capacity) {
sql_print_warning("InnoDB: innodb_io_capacity"
" cannot be set higher than"
- " innodb_io_capacity_max.\n"
- "InnoDB: Setting"
- " innodb_io_capacity to %lu\n",
+ " innodb_io_capacity_max."
+ "Setting innodb_io_capacity=%lu",
srv_max_io_capacity);
srv_io_capacity = srv_max_io_capacity;
@@ -6335,9 +6335,10 @@ innobase_build_index_translation(
if (index_mapping == NULL) {
/* Report an error if index_mapping continues to be
NULL and mysql_num_index is a non-zero value */
- sql_print_error("InnoDB: fail to allocate memory for"
- " index translation table. Number of"
- " Index:%lu, array size:%lu",
+ sql_print_error("InnoDB: fail to allocate memory for "
+ "index translation table. Number of "
+ "Index: " ULINTPF
+ ", array size:" ULINTPF,
mysql_num_index,
share->idx_trans_tbl.array_size);
ret = false;
@@ -6846,9 +6847,9 @@ ha_innobase::open(
if (key_used_on_scan != MAX_KEY) {
sql_print_warning(
- "Table %s key_used_on_scan is %lu even"
- " though there is no primary key inside"
- " InnoDB.", name, (ulong) key_used_on_scan);
+ "Table %s key_used_on_scan is %u even "
+ "though there is no primary key inside "
+ "InnoDB.", name, key_used_on_scan);
}
}
@@ -11092,7 +11093,8 @@ wsrep_append_foreign_key(
if (rcode != DB_SUCCESS) {
WSREP_ERROR(
- "FK key set failed: %lu (%lu %lu), index: %s %s, %s",
+ "FK key set failed: " ULINTPF
+ " (" ULINTPF " " ULINTPF "), index: %s %s, %s",
rcode, referenced, shared,
(index) ? index->name() : "void index",
(index && index->table) ? index->table->name.m_name :
@@ -11154,8 +11156,9 @@ wsrep_append_foreign_key(
copy);
if (rcode) {
- DBUG_PRINT("wsrep", ("row key failed: %lu", rcode));
- WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu",
+ DBUG_PRINT("wsrep", ("row key failed: " ULINTPF, rcode));
+ WSREP_ERROR("Appending cascaded fk row key failed: %s, "
+ ULINTPF,
(wsrep_thd_query(thd)) ?
wsrep_thd_query(thd) : "void", rcode);
return DB_ERROR;
@@ -11434,13 +11437,7 @@ ha_innobase::position(
len = key_info->key_length;
}
- /* We assume that the 'ref' value len is always fixed for the same
- table. */
-
- if (len != ref_length) {
- sql_print_error("Stored ref len is %lu, but table ref len is"
- " %lu", (ulong) len, (ulong) ref_length);
- }
+ ut_ad(len == ref_length);
}
/*****************************************************************//**
@@ -11776,8 +11773,8 @@ create_table_info_t::create_table_def()
ER_CANT_CREATE_TABLE,
"In InnoDB, charset-collation codes"
" must be below 256."
- " Unsupported code %lu.",
- (ulong) charset_no);
+ " Unsupported code " ULINTPF ".",
+ charset_no);
mem_heap_free(heap);
dict_mem_table_free(table);
@@ -12298,7 +12295,7 @@ create_table_info_t::create_options_are_invalid()
push_warning_printf(
m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: invalid KEY_BLOCK_SIZE = %lu."
+ "InnoDB: invalid KEY_BLOCK_SIZE = %u."
" Valid values are [1, 2, 4, 8, 16]",
m_create_info->key_block_size);
ret = "KEY_BLOCK_SIZE";
@@ -12789,7 +12786,7 @@ index_bad:
push_warning_printf(
m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ignoring KEY_BLOCK_SIZE=%lu.",
+ "InnoDB: ignoring KEY_BLOCK_SIZE=%u.",
m_create_info->key_block_size);
}
}
@@ -12811,7 +12808,7 @@ index_bad:
push_warning_printf(
m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ignoring KEY_BLOCK_SIZE=%lu"
+ "InnoDB: ignoring KEY_BLOCK_SIZE=%u"
" unless ROW_FORMAT=COMPRESSED.",
m_create_info->key_block_size);
zip_allowed = false;
@@ -15098,15 +15095,14 @@ ha_innobase::info_low(
if (j + 1 > index->n_uniq) {
sql_print_error(
- "Index %s of %s has %lu columns"
- " unique inside InnoDB, but"
- " MariaDB is asking statistics for"
- " %lu columns. Have you mixed"
- " up .frm files from different"
+ "Index %s of %s has %u columns"
+ " unique inside InnoDB, but "
+ "MySQL is asking statistics for"
+ " %lu columns. Have you mixed "
+ "up .frm files from different "
" installations? %s",
index->name(),
ib_table->name.m_name,
- (unsigned long)
index->n_uniq, j + 1,
TROUBLESHOOTING_MSG);
break;
@@ -15636,11 +15632,9 @@ ha_innobase::check(
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_NOT_KEYFILE,
- "InnoDB: Index '%-.200s' contains %lu"
- " entries, should be %lu.",
- index->name(),
- (ulong) n_rows,
- (ulong) n_rows_in_table);
+ "InnoDB: Index '%-.200s' contains " ULINTPF
+ " entries, should be " ULINTPF ".",
+ index->name(), n_rows, n_rows_in_table);
is_ok = false;
dict_set_corrupted(
index, m_prebuilt->trx,
@@ -17086,16 +17080,16 @@ innodb_show_rwlock_status(
}
buf1len = ut_snprintf(
- buf1, sizeof buf1, "rwlock: %s:%lu",
+ buf1, sizeof buf1, "rwlock: %s:%u",
innobase_basename(rw_lock->cfile_name),
- static_cast<ulong>(rw_lock->cline));
+ rw_lock->cline);
int buf2len;
char buf2[IO_SIZE];
buf2len = ut_snprintf(
- buf2, sizeof buf2, "waits=%lu",
- static_cast<ulong>(rw_lock->count_os_wait));
+ buf2, sizeof buf2, "waits=%u",
+ rw_lock->count_os_wait);
if (stat_print(thd, innobase_hton_name,
hton_name_len,
@@ -17114,16 +17108,16 @@ innodb_show_rwlock_status(
char buf1[IO_SIZE];
buf1len = ut_snprintf(
- buf1, sizeof buf1, "sum rwlock: %s:%lu",
+ buf1, sizeof buf1, "sum rwlock: %s:%u",
innobase_basename(block_rwlock->cfile_name),
- static_cast<ulong>(block_rwlock->cline));
+ block_rwlock->cline);
int buf2len;
char buf2[IO_SIZE];
buf2len = ut_snprintf(
- buf2, sizeof buf2, "waits=%lu",
- static_cast<ulong>(block_rwlock_oswait_count));
+ buf2, sizeof buf2, "waits=" ULINTPF,
+ block_rwlock_oswait_count);
if (stat_print(thd, innobase_hton_name,
hton_name_len,
@@ -20332,9 +20326,9 @@ wsrep_innobase_kill_one_trx(
WSREP_LOG_CONFLICT(bf_thd, thd, TRUE);
- WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%lu) trx: "
- TRX_ID_FMT,
- signal, (long long)bf_seqno,
+ WSREP_DEBUG("BF kill (" ULINTPF ", seqno: " INT64PF
+ "), victim: (%lu) trx: " TRX_ID_FMT,
+ signal, bf_seqno,
thd_get_thread_id(thd),
victim_trx->id);
@@ -22832,7 +22826,8 @@ ib_warn_row_too_big(const dict_table_t* table)
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW,
- "Row size too large (> %lu). Changing some columns to TEXT"
+ "Row size too large (> " ULINTPF ")."
+ " Changing some columns to TEXT"
" or BLOB %smay help. In current row format, BLOB prefix of"
" %d bytes is stored inline.", free_space
, prefix ? "or using ROW_FORMAT=DYNAMIC or"
@@ -23177,7 +23172,7 @@ ib_push_frm_error(
break;
case DICT_FRM_INCONSISTENT_KEYS:
- sql_print_error("InnoDB: Table %s contains %lu "
+ sql_print_error("InnoDB: Table %s contains " ULINTPF " "
"indexes inside InnoDB, which "
"is different from the number of "
"indexes %u defined in the MariaDB "
@@ -23192,7 +23187,7 @@ ib_push_frm_error(
if (push_warning) {
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_NO_SUCH_INDEX,
- "InnoDB: Table %s contains %lu "
+ "InnoDB: Table %s contains " ULINTPF " "
"indexes inside InnoDB, which "
"is different from the number of "
"indexes %u defined in the MariaDB ",
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 2fde0cb23b9..7a4dc610694 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1472,8 +1472,8 @@ ibuf_print_ops(
ut_a(UT_ARR_SIZE(op_names) == IBUF_OP_COUNT);
for (i = 0; i < IBUF_OP_COUNT; i++) {
- fprintf(file, "%s %lu%s", op_names[i],
- (ulong) ops[i], (i < (IBUF_OP_COUNT - 1)) ? ", " : "");
+ fprintf(file, "%s " ULINTPF "%s", op_names[i],
+ ops[i], (i < (IBUF_OP_COUNT - 1)) ? ", " : "");
}
putc('\n', file);
@@ -4928,12 +4928,12 @@ ibuf_print(
mutex_enter(&ibuf_mutex);
fprintf(file,
- "Ibuf: size %lu, free list len %lu,"
- " seg size %lu, %lu merges\n",
- (ulong) ibuf->size,
- (ulong) ibuf->free_list_len,
- (ulong) ibuf->seg_size,
- (ulong) ibuf->n_merges);
+ "Ibuf: size " ULINTPF ", free list len " ULINTPF ","
+ " seg size " ULINTPF ", " ULINTPF " merges\n",
+ ibuf->size,
+ ibuf->free_list_len,
+ ibuf->seg_size,
+ ibuf->n_merges);
fputs("merged operations:\n ", file);
ibuf_print_ops(ibuf->n_merged_ops, file);
@@ -4948,9 +4948,10 @@ ibuf_print(
if (count > 0) {
fprintf(stderr,
- "Ibuf count for space/page %lu/%lu"
- " is %lu\n",
- (ulong) i, (ulong) j, (ulong) count);
+ "Ibuf count for page "
+ ULINTPF ":" ULINTPF ""
+ " is " ULINTPF "\n",
+ i, j, count);
}
}
}
diff --git a/storage/innobase/include/fil0fil.ic b/storage/innobase/include/fil0fil.ic
index 01fa1093e5e..2fb158a5878 100644
--- a/storage/innobase/include/fil0fil.ic
+++ b/storage/innobase/include/fil0fil.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2015, 2017 MariaDB Corporation.
+Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic
index 701f1482e64..972fdc81518 100644
--- a/storage/innobase/include/mtr0log.ic
+++ b/storage/innobase/include/mtr0log.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -227,20 +228,11 @@ mlog_write_initial_log_record_fast(
if (space == TRX_SYS_SPACE
&& offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
- if (buf_dblwr_being_created) {
- /* Do nothing: we only come to this branch in an
- InnoDB database creation. We do not redo log
- anything for the doublewrite buffer pages. */
- return(log_ptr);
- } else {
- ib::error() << "Trying to redo log a record of type "
- << type << " on page "
- << page_id_t(space, offset) << "in the"
- " doublewrite buffer, continuing anyway."
- " Please post a bug report to"
- " bugs.mysql.com.";
- ut_ad(0);
- }
+ ut_ad(buf_dblwr_being_created);
+ /* Do nothing: we only come to this branch in an
+ InnoDB database creation. We do not redo log
+ anything for the doublewrite buffer pages. */
+ return(log_ptr);
}
return(mlog_write_initial_log_record_low(type, space, offset,
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 0e3fb994e49..faf5387a5d1 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -102,6 +102,7 @@ support cross-platform development and expose comonly used SQL names. */
#endif
#include <stdint.h>
+#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */
#include <inttypes.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -454,52 +455,48 @@ mysql_com.h if you are to use this macro. */
==========================
*/
-/* Note that inside MySQL 'byte' is defined as char on Linux! */
-#define byte unsigned char
+/** Unsigned octet of bits */
+typedef unsigned char byte;
+/** Machine-word-width unsigned integer */
+typedef size_t ulint;
+/** Machine-word-width signed integer */
+typedef ssize_t lint;
-/* Another basic type we use is unsigned long integer which should be equal to
-the word size of the machine, that is on a 32-bit platform 32 bits, and on a
-64-bit platform 64 bits. We also give the printf format for the type as a
-macro ULINTPF. */
+/** ulint format for the printf() family of functions */
+#define ULINTPF "%zu"
+/** ulint hexadecimal format for the printf() family of functions */
+#define ULINTPFx "%zx"
#ifdef _WIN32
/* Use the integer types and formatting strings defined in Visual Studio. */
# define UINT32PF "%u"
-# define UINT64PF "%llu"
-# define UINT64PFx "%016llx"
+# define INT64PF "%lld"
# define UINT64scan "llu"
-typedef unsigned __int64 ib_uint64_t;
-typedef unsigned __int32 ib_uint32_t;
-#else
-# define UINT32PF "%u"
-#if SIZEOF_LONG == 8
-# define UINT64PF "%lu"
-# define UINT64PFx "%016lx"
-# define UINT64scan "lu"
-#else
-# define UINT64PF "%llu"
# define UINT64PFx "%016llx"
+#elif defined __APPLE__
+/* Apple prefers to call the 64-bit types 'long long'
+in both 32-bit and 64-bit environments. */
+# define UINT32PF "%" PRIu32
+# define INT64PF "%lld"
# define UINT64scan "llu"
+# define UINT64PFx "%016llx"
+#else
+/* Use the integer types and formatting strings defined in the C99 standard. */
+# define UINT32PF "%" PRIu32
+# define INT64PF "%" PRId64
+# define UINT64scan PRIu64
+# define UINT64PFx "%016" PRIx64
#endif
+
+typedef int64_t ib_int64_t;
typedef uint64_t ib_uint64_t;
typedef uint32_t ib_uint32_t;
-#endif /* _WIN32 */
-#ifdef _WIN64
-typedef unsigned __int64 ulint;
-typedef __int64 lint;
-# define ULINTPF UINT64PF
-#else
-typedef unsigned long int ulint;
-typedef long int lint;
-# define ULINTPF "%lu"
-#endif /* _WIN64 */
+#define UINT64PF "%" UINT64scan
+#define IB_ID_FMT UINT64PF
-#ifndef _WIN32
-#if SIZEOF_LONG != SIZEOF_VOIDP
-#error "Error: InnoDB's ulint must be of the same size as void*"
-#endif
-#endif
+/** Log sequence number (also used for redo log byte arithmetics) */
+typedef ib_uint64_t lsn_t;
/** The 'undefined' value for a ulint */
#define ULINT_UNDEFINED ((ulint)(-1))
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 134853dd0d7..1068adc6462 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -3613,18 +3613,7 @@ lock_move_reorganize_page(
}
}
-#ifdef UNIV_DEBUG
- {
- ulint i = lock_rec_find_set_bit(lock);
-
- /* Check that all locks were moved. */
- if (i != ULINT_UNDEFINED) {
- ib::fatal() << "lock_move_reorganize_page(): "
- << i << " not moved in "
- << (void*) lock;
- }
- }
-#endif /* UNIV_DEBUG */
+ ut_ad(lock_rec_find_set_bit(lock) == ULINT_UNDEFINED);
}
lock_mutex_exit();
@@ -6606,7 +6595,7 @@ lock_rec_block_validate(
if (err != DB_SUCCESS) {
ib::error() << "Lock rec block validate failed for tablespace "
- << ((space && space->name) ? space->name : " system ")
+ << space->name
<< " space_id " << space_id
<< " page_no " << page_no << " err " << err;
}
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index d26886e45f9..c96260ca1ac 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -742,14 +742,11 @@ failure:
if (!success) {
ib::error() << "Cannot continue operation. ib_logfiles are too"
- " small for innodb_thread_concurrency "
+ " small for innodb_thread_concurrency="
<< srv_thread_concurrency << ". The combined size of"
" ib_logfiles should be bigger than"
- " 200 kB * innodb_thread_concurrency. To get mysqld"
- " to start up, set innodb_thread_concurrency in"
- " my.cnf to a lower value, for example, to 8. After"
- " an ERROR-FREE shutdown of mysqld you can adjust"
- " the size of ib_logfiles. " << INNODB_PARAMETERS_MSG;
+ " 200 kB * innodb_thread_concurrency. "
+ << INNODB_PARAMETERS_MSG;
}
return(success);
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index c53d2221b6f..5213090bb52 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -7352,7 +7352,7 @@ AIO::print_segment_info(
fprintf(file, ", ");
}
- fprintf(file, "%lu", *segments);
+ fprintf(file, ULINTPF, *segments);
}
fprintf(file, "] ");
@@ -7433,8 +7433,8 @@ os_aio_print(FILE* file)
double avg_bytes_read;
for (ulint i = 0; i < srv_n_file_io_threads; ++i) {
- fprintf(file, "I/O thread %lu state: %s (%s)",
- (ulint) i,
+ fprintf(file, "I/O thread " ULINTPF " state: %s (%s)",
+ i,
srv_io_thread_op_info[i],
srv_io_thread_function[i]);
@@ -7485,7 +7485,7 @@ os_aio_print(FILE* file)
}
fprintf(file,
- "%.2f reads/s, %lu avg bytes/read,"
+ "%.2f reads/s, " ULINTPF " avg bytes/read,"
" %.2f writes/s, %.2f fsyncs/s\n",
(os_n_file_reads - os_n_file_reads_old)
/ time_elapsed,
@@ -7540,7 +7540,7 @@ AIO::to_file(FILE* file) const
{
acquire();
- fprintf(file, " %lu\n", static_cast<ulint>(m_n_reserved));
+ fprintf(file, " " ULINTPF "\n", m_n_reserved);
for (ulint i = 0; i < m_slots.size(); ++i) {
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index f2ba1c64229..df7d26c63e8 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -1324,7 +1324,8 @@ use_heap:
data_len = rec_offs_data_size(offsets);
fprintf(stderr, "InnoDB: Error: current_rec == insert_rec "
- " extra_len %lu data_len %lu insert_buf %p rec %p\n",
+ " extra_len " ULINTPF
+ " data_len " ULINTPF " insert_buf %p rec %p\n",
extra_len, data_len, insert_buf, rec);
fprintf(stderr, "InnoDB; Physical record: \n");
rec_print(stderr, rec, index);
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index 11b8838ce2d..88c5a425818 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -2,7 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2014, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index cc611725095..6d974e7accb 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -1871,17 +1871,17 @@ rec_print_old(
n = rec_get_n_fields_old(rec);
- fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
- " %u-byte offsets; info bits %lu\n",
- (ulong) n,
+ fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";"
+ " %u-byte offsets; info bits " ULINTPF "\n",
+ n,
rec_get_1byte_offs_flag(rec) ? 1 : 2,
- (ulong) rec_get_info_bits(rec, FALSE));
+ rec_get_info_bits(rec, FALSE));
for (i = 0; i < n; i++) {
data = rec_get_nth_field_old(rec, i, &len);
- fprintf(file, " %lu:", (ulong) i);
+ fprintf(file, " " ULINTPF ":", i);
if (len != UNIV_SQL_NULL) {
if (len <= 30) {
@@ -1890,8 +1890,8 @@ rec_print_old(
} else {
ut_print_buf(file, data, 30);
- fprintf(file, " (total %lu bytes)",
- (ulong) len);
+ fprintf(file, " (total " ULINTPF " bytes)",
+ len);
}
} else {
fprintf(file, " SQL NULL, size " ULINTPF " ",
@@ -1924,7 +1924,7 @@ rec_print_comp(
data = rec_get_nth_field(rec, offsets, i, &len);
- fprintf(file, " %lu:", (ulong) i);
+ fprintf(file, " " ULINTPF ":", i);
if (len != UNIV_SQL_NULL) {
if (len <= 30) {
@@ -1932,16 +1932,17 @@ rec_print_comp(
ut_print_buf(file, data, len);
} else if (rec_offs_nth_extern(offsets, i)) {
ut_print_buf(file, data, 30);
- fprintf(file, " (total %lu bytes, external)",
- (ulong) len);
+ fprintf(file,
+ " (total " ULINTPF " bytes, external)",
+ len);
ut_print_buf(file, data + len
- BTR_EXTERN_FIELD_REF_SIZE,
BTR_EXTERN_FIELD_REF_SIZE);
} else {
ut_print_buf(file, data, 30);
- fprintf(file, " (total %lu bytes)",
- (ulong) len);
+ fprintf(file, " (total " ULINTPF " bytes)",
+ len);
}
} else {
fputs(" SQL NULL", file);
@@ -2007,7 +2008,7 @@ rec_print_mbr_old(
}
}
} else {
- fprintf(file, " SQL NULL, size %lu ",
+ fprintf(file, " SQL NULL, size " ULINTPF " ",
rec_get_nth_field_size(rec, i));
}
@@ -2123,10 +2124,10 @@ rec_print_new(
return;
}
- fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
- " compact format; info bits %lu\n",
- (ulong) rec_offs_n_fields(offsets),
- (ulong) rec_get_info_bits(rec, TRUE));
+ fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";"
+ " compact format; info bits " ULINTPF "\n",
+ rec_offs_n_fields(offsets),
+ rec_get_info_bits(rec, TRUE));
rec_print_comp(file, rec, offsets);
rec_validate(rec, offsets);
@@ -2342,9 +2343,10 @@ wsrep_rec_get_foreign_key(
data = rec_get_nth_field(rec, offsets, i, &len);
if (key_len + ((len != UNIV_SQL_NULL) ? len + 1 : 1) >
*buf_len) {
- fprintf (stderr,
- "WSREP: FK key len exceeded %lu %lu %lu\n",
- key_len, len, *buf_len);
+ fprintf(stderr,
+ "WSREP: FK key len exceeded "
+ ULINTPF " " ULINTPF " " ULINTPF "\n",
+ key_len, len, *buf_len);
goto err_out;
}
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 19e1ba926d0..9aca879fa1a 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2016, MariaDB Corporation.
+Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -946,7 +946,7 @@ loop:
goto exit;
} else if (retried > 10000) {
ut_ad(!doc_item);
- /* retied too many times and cannot get new record */
+ /* retried too many times and cannot get new record */
ib::error() << "FTS parallel sort processed "
<< num_doc_processed
<< " records, the sort queue has "
@@ -1673,7 +1673,7 @@ row_fts_merge_insert(
}
if (fts_enable_diag_print) {
- ib::info() << "InnoDB_FTS: to inserted " << count_diag
+ ib::info() << "InnoDB_FTS: to insert " << count_diag
<< " records";
}
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 6a44aa4b8d7..01a55d0dc61 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -1078,10 +1078,9 @@ row_import::match_index_columns(
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_TABLE_SCHEMA_MISMATCH,
- "Index field count %lu doesn't match"
- " tablespace metadata file value %lu",
- (ulong) index->n_fields,
- (ulong) cfg_index->m_n_fields);
+ "Index field count %u doesn't match"
+ " tablespace metadata file value " ULINTPF,
+ index->n_fields, cfg_index->m_n_fields);
return(DB_ERROR);
}
@@ -1098,8 +1097,8 @@ row_import::match_index_columns(
ER_TABLE_SCHEMA_MISMATCH,
"Index field name %s doesn't match"
" tablespace metadata field name %s"
- " for field position %lu",
- field->name(), cfg_field->name(), (ulong) i);
+ " for field position " ULINTPF,
+ field->name(), cfg_field->name(), i);
err = DB_ERROR;
}
@@ -1107,12 +1106,10 @@ row_import::match_index_columns(
if (cfg_field->prefix_len != field->prefix_len) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_TABLE_SCHEMA_MISMATCH,
- "Index %s field %s prefix len %lu"
- " doesn't match metadata file value"
- " %lu",
+ "Index %s field %s prefix len %u"
+ " doesn't match metadata file value %u",
index->name(), field->name(),
- (ulong) field->prefix_len,
- (ulong) cfg_field->prefix_len);
+ field->prefix_len, cfg_field->prefix_len);
err = DB_ERROR;
}
@@ -1120,12 +1117,11 @@ row_import::match_index_columns(
if (cfg_field->fixed_len != field->fixed_len) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_TABLE_SCHEMA_MISMATCH,
- "Index %s field %s fixed len %lu"
- " doesn't match metadata file value"
- " %lu",
+ "Index %s field %s fixed len %u"
+ " doesn't match metadata file value %u",
index->name(), field->name(),
- (ulong) field->fixed_len,
- (ulong) cfg_field->fixed_len);
+ field->fixed_len,
+ cfg_field->fixed_len);
err = DB_ERROR;
}
@@ -1166,12 +1162,11 @@ row_import::match_table_columns(
} else if (cfg_col_index != col->ind) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
- ER_TABLE_SCHEMA_MISMATCH,
- "Column %s ordinal value mismatch, it's at"
- " %lu in the table and %lu in the tablespace"
- " meta-data file",
- col_name,
- (ulong) col->ind, (ulong) cfg_col_index);
+ ER_TABLE_SCHEMA_MISMATCH,
+ "Column %s ordinal value mismatch, it's at %u"
+ " in the table and " ULINTPF
+ " in the tablespace meta-data file",
+ col_name, col->ind, cfg_col_index);
err = DB_ERROR;
} else {
@@ -1253,19 +1248,19 @@ row_import::match_schema(
{
/* Do some simple checks. */
- if (m_flags != m_table->flags) {
+ if ((m_table->flags ^ m_flags) & ~DICT_TF_MASK_DATA_DIR) {
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
- "Table flags don't match, server table has 0x%lx"
- " and the meta-data file has 0x%lx",
- (ulong) m_table->n_cols, (ulong) m_flags);
+ "Table flags don't match, server table has 0x%x"
+ " and the meta-data file has 0x" ULINTPFx,
+ m_table->flags, m_flags);
return(DB_ERROR);
} else if (m_table->n_cols != m_n_cols) {
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
- "Number of columns don't match, table has %lu"
- " columns but the tablespace meta-data file has"
- " %lu columns",
- (ulong) m_table->n_cols, (ulong) m_n_cols);
+ "Number of columns don't match, table has %u"
+ " columns but the tablespace meta-data file has "
+ ULINTPF " columns",
+ m_table->n_cols, m_n_cols);
return(DB_ERROR);
} else if (UT_LIST_GET_LEN(m_table->indexes) != m_n_indexes) {
@@ -1275,11 +1270,10 @@ row_import::match_schema(
table matching the IMPORT definition. */
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
- "Number of indexes don't match, table has %lu"
- " indexes but the tablespace meta-data file has"
- " %lu indexes",
- (ulong) UT_LIST_GET_LEN(m_table->indexes),
- (ulong) m_n_indexes);
+ "Number of indexes don't match, table has " ULINTPF
+ " indexes but the tablespace meta-data file has "
+ ULINTPF " indexes",
+ UT_LIST_GET_LEN(m_table->indexes), m_n_indexes);
return(DB_ERROR);
}
@@ -1580,9 +1574,10 @@ PageConverter::adjust_cluster_index_blob_column(
ib_errf(m_trx->mysql_thd, IB_LOG_LEVEL_ERROR,
ER_INNODB_INDEX_CORRUPT,
- "Externally stored column(%lu) has a reference"
- " length of %lu in the cluster index %s",
- (ulong) i, (ulong) len, m_cluster_index->name());
+ "Externally stored column(" ULINTPF
+ ") has a reference length of " ULINTPF
+ " in the cluster index %s",
+ i, len, m_cluster_index->name());
return(DB_CORRUPTION);
}
@@ -2265,11 +2260,10 @@ row_import_adjust_root_pages_of_secondary_indexes(
ib_errf(trx->mysql_thd,
IB_LOG_LEVEL_WARN,
ER_INNODB_INDEX_CORRUPT,
- "Index %s contains %lu entries,"
- " should be %lu, you should recreate"
- " this index.", index->name(),
- (ulong) purge.get_n_rows(),
- (ulong) n_rows_in_table);
+ "Index '%s' contains " ULINTPF " entries, "
+ "should be " ULINTPF ", you should recreate "
+ "this index.", index->name(),
+ purge.get_n_rows(), n_rows_in_table);
index->type |= DICT_CORRUPT;
@@ -2570,10 +2564,10 @@ row_import_read_index_data(
char msg[BUFSIZ];
ut_snprintf(msg, sizeof(msg),
- "while reading index meta-data, expected"
- " to read %lu bytes but read only %lu"
- " bytes",
- (ulong) sizeof(row), (ulong) n_bytes);
+ "while reading index meta-data, expected "
+ "to read " ULINTPF
+ " bytes but read only " ULINTPF " bytes",
+ sizeof(row), n_bytes);
ib_senderrf(
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
@@ -2625,8 +2619,8 @@ row_import_read_index_data(
if (len > OS_FILE_MAX_PATH) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_INNODB_INDEX_CORRUPT,
- "Index name length (%lu) is too long,"
- " the meta-data is corrupt", len);
+ "Index name length (" ULINTPF ") is too long, "
+ "the meta-data is corrupt", len);
return(DB_CORRUPTION);
}
@@ -2708,8 +2702,8 @@ row_import_read_indexes(
} else if (cfg->m_n_indexes > 1024) {
// FIXME: What is the upper limit? */
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
- "Number of indexes in meta-data file is too high: %lu",
- (ulong) cfg->m_n_indexes);
+ "Number of indexes in meta-data file is too high: "
+ ULINTPF, cfg->m_n_indexes);
cfg->m_n_indexes = 0;
return(DB_CORRUPTION);
@@ -2813,8 +2807,8 @@ row_import_read_columns(
if (len == 0 || len > 128) {
ib_errf(thd, IB_LOG_LEVEL_ERROR,
ER_IO_READ_ERROR,
- "Column name length %lu, is invalid",
- (ulong) len);
+ "Column name length " ULINTPF ", is invalid",
+ len);
return(DB_CORRUPTION);
}
@@ -3064,8 +3058,8 @@ row_import_read_meta_data(
return(row_import_read_v1(file, thd, &cfg));
default:
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
- "Unsupported meta-data version number (%lu),"
- " file ignored", (ulong) cfg.m_version);
+ "Unsupported meta-data version number (" ULINTPF "), "
+ "file ignored", cfg.m_version);
}
return(DB_ERROR);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 8b7c64868b8..d285352dadb 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1440,7 +1440,7 @@ row_insert_for_mysql(
return(DB_TABLESPACE_NOT_FOUND);
} else if (prebuilt->table->is_encrypted) {
ib_push_warning(trx, DB_DECRYPTION_FAILED,
- "Table %s in tablespace %lu encrypted."
+ "Table %s in tablespace " ULINTPF " encrypted."
"However key management plugin or used key_id is not found or"
" used encryption algorithm or method does not match.",
prebuilt->table->name, prebuilt->table->space);
@@ -1866,7 +1866,7 @@ row_update_for_mysql_using_upd_graph(
DBUG_RETURN(DB_ERROR);
} else if (prebuilt->table->is_encrypted) {
ib_push_warning(trx, DB_DECRYPTION_FAILED,
- "Table %s in tablespace %lu encrypted."
+ "Table %s in tablespace " ULINTPF " encrypted."
"However key management plugin or used key_id is not found or"
" used encryption algorithm or method does not match.",
prebuilt->table->name, prebuilt->table->space);
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 8c7c7c674e3..c0b218dd6dd 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -709,13 +709,12 @@ srv_print_master_thread_info(
/*=========================*/
FILE *file) /* in: output stream */
{
- fprintf(file, "srv_master_thread loops: %lu srv_active,"
- " %lu srv_shutdown, %lu srv_idle\n",
+ fprintf(file, "srv_master_thread loops: " ULINTPF " srv_active, "
+ ULINTPF " srv_shutdown, " ULINTPF " srv_idle\n"
+ "srv_master_thread log flush and writes: " ULINTPF "\n",
srv_main_active_loops,
srv_main_shutdown_loops,
- srv_main_idle_loops);
- fprintf(file,
- "srv_master_thread log flush and writes: " ULINTPF "\n",
+ srv_main_idle_loops,
srv_log_writes_and_flush);
}
@@ -1384,13 +1383,13 @@ srv_printf_innodb_monitor(
srv_conc_get_waiting_threads());
/* This is a dirty read, without holding trx_sys->mutex. */
- fprintf(file, "%lu read views open inside InnoDB\n",
+ fprintf(file, ULINTPF " read views open inside InnoDB\n",
trx_sys->mvcc->size());
n_reserved = fil_space_get_n_reserved_extents(0);
if (n_reserved > 0) {
fprintf(file,
- "%lu tablespace extents now reserved for"
+ ULINTPF " tablespace extents now reserved for"
" B-tree split operations\n",
n_reserved);
}
@@ -1948,8 +1947,8 @@ loop:
"WSREP: avoiding InnoDB self crash due to long "
"semaphore wait of > %lu seconds\n"
"Server is processing SST donor operation, "
- "fatal_cnt now: %lu",
- (ulong) srv_fatal_semaphore_wait_threshold, fatal_cnt);
+ "fatal_cnt now: " ULINTPF,
+ srv_fatal_semaphore_wait_threshold, fatal_cnt);
}
#endif /* WITH_WSREP */
if (fatal_cnt > 10) {
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index bcb52fc5bfb..9e89dfda833 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -743,7 +743,7 @@ srv_check_undo_redo_logs_exists()
ut_snprintf(
name, sizeof(name),
- "%s%cundo%03lu",
+ "%s%cundo%03zu",
srv_undo_dir, OS_PATH_SEPARATOR,
i);
@@ -836,7 +836,7 @@ srv_undo_tablespaces_init(bool create_new_db)
ut_snprintf(
name, sizeof(name),
- "%s%cundo%03lu",
+ "%s%cundo%03zu",
srv_undo_dir, OS_PATH_SEPARATOR, i + 1);
/* Undo space ids start from 1. */
@@ -872,7 +872,7 @@ srv_undo_tablespaces_init(bool create_new_db)
char name[OS_FILE_MAX_PATH];
ut_snprintf(name, sizeof(name),
- "%s%cundo%03lu",
+ "%s%cundo%03zu",
srv_undo_dir, OS_PATH_SEPARATOR,
undo_tablespace_ids[i]);
@@ -913,7 +913,7 @@ srv_undo_tablespaces_init(bool create_new_db)
ut_snprintf(
name, sizeof(name),
- "%s%cundo%03lu",
+ "%s%cundo%03zu",
srv_undo_dir, OS_PATH_SEPARATOR,
undo_tablespace_ids[i]);
@@ -949,7 +949,7 @@ srv_undo_tablespaces_init(bool create_new_db)
ut_snprintf(
name, sizeof(name),
- "%s%cundo%03lu", srv_undo_dir, OS_PATH_SEPARATOR, i);
+ "%s%cundo%03zu", srv_undo_dir, OS_PATH_SEPARATOR, i);
/* Undo space ids start from 1. */
err = srv_undo_tablespace_open(name, i);
@@ -2756,9 +2756,9 @@ innodb_shutdown()
logs_empty_and_mark_files_at_shutdown();
- if (srv_conc_get_active_threads() != 0) {
+ if (ulint n_threads = srv_conc_get_active_threads()) {
ib::warn() << "Query counter shows "
- << srv_conc_get_active_threads() << " queries still"
+ << n_threads << " queries still"
" inside InnoDB at shutdown";
}
diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc
index 00ee1b25268..956511a7f59 100644
--- a/storage/innobase/sync/sync0arr.cc
+++ b/storage/innobase/sync/sync0arr.cc
@@ -587,12 +587,13 @@ sync_array_cell_print(
}
fprintf(file,
- "number of readers %lu, waiters flag %lu,"
- " lock_word: %lx\n"
+ "number of readers " ULINTPF
+ ", waiters flag %u, "
+ "lock_word: " ULINTPFx "\n"
"Last time read locked in file %s line %u\n"
"Last time write locked in file %s line %u\n",
- (ulint) rw_lock_get_reader_count(rwlock),
- (ulint) rwlock->waiters,
+ rw_lock_get_reader_count(rwlock),
+ rwlock->waiters,
rwlock->lock_word,
innobase_basename(rwlock->last_s_file_name),
rwlock->last_s_line,
diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc
index 9c5ae4d02da..fcc50b8c76d 100644
--- a/storage/innobase/trx/trx0i_s.cc
+++ b/storage/innobase/trx/trx0i_s.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1612,7 +1613,8 @@ trx_i_s_create_lock_id(
if (row->lock_space != ULINT_UNDEFINED) {
/* record lock */
res_len = ut_snprintf(lock_id, lock_id_size,
- TRX_ID_FMT ":%lu:%lu:%lu",
+ TRX_ID_FMT
+ ":" ULINTPF ":" ULINTPF ":" ULINTPF,
row->lock_trx_id, row->lock_space,
row->lock_page, row->lock_rec);
} else {
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index 24983dcc2a3..19d4a228eda 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -258,8 +258,8 @@ trx_sys_print_mysql_binlog_offset(void)
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW);
fprintf(stderr,
- "InnoDB: Last MySQL binlog file position %lu %lu,"
- " file name %s\n",
+ "InnoDB: Last MySQL binlog file position " ULINTPF " " ULINTPF
+ ", file name %s\n",
trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low,
sys_header + TRX_SYS_MYSQL_LOG_INFO
+ TRX_SYS_MYSQL_LOG_NAME);
diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc
index c352323eca9..2cae865cff2 100644
--- a/storage/innobase/ut/ut0ut.cc
+++ b/storage/innobase/ut/ut0ut.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -214,14 +215,14 @@ ut_print_timestamp(
GetLocalTime(&cal_tm);
- fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#llx",
+ fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#zx",
(int) cal_tm.wYear,
(int) cal_tm.wMonth,
(int) cal_tm.wDay,
(int) cal_tm.wHour,
(int) cal_tm.wMinute,
(int) cal_tm.wSecond,
- static_cast<ulonglong>(thread_id));
+ thread_id);
#else
struct tm* cal_tm_ptr;
time_t tm;
@@ -230,7 +231,7 @@ ut_print_timestamp(
time(&tm);
localtime_r(&tm, &cal_tm);
cal_tm_ptr = &cal_tm;
- fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#lx",
+ fprintf(file, "%d-%02d-%02d %02d:%02d:%02d %#zx",
cal_tm_ptr->tm_year + 1900,
cal_tm_ptr->tm_mon + 1,
cal_tm_ptr->tm_mday,
@@ -323,7 +324,7 @@ ut_print_buf(
fprintf(file, " len " ULINTPF "; hex ", len);
for (data = (const byte*) buf, i = 0; i < len; i++) {
- fprintf(file, "%02lx", static_cast<ulong>(*data++));
+ fprintf(file, "%02x", *data++);
}
fputs("; asc ", file);