Commit d23eb8e6 authored by Marko Mäkelä's avatar Marko Mäkelä

Follow-up to MDEV-12488: Fix some type mismatch in header files

This reduces the number of compilation warnings on Windows.
parent aafaf05a
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
...@@ -541,13 +541,15 @@ dict_tf_is_valid( ...@@ -541,13 +541,15 @@ dict_tf_is_valid(
/* Make sure there are no bits that we do not know about. */ /* Make sure there are no bits that we do not know about. */
if (unused != 0) { if (unused != 0) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table unused flags are %ld" "InnoDB: Error: table unused flags are " ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF " atomic_blobs " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" "\nInnoDB: unused " ULINTPF " data_dir " ULINTPF
"InnoDB: page_compression %ld page_compression_level %ld\n" " zip_ssize " ULINTPF
"InnoDB: atomic_writes %ld\n", "\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
unused, unused,
compact, atomic_blobs, unused, data_dir, zip_ssize, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
...@@ -563,13 +565,17 @@ dict_tf_is_valid( ...@@ -563,13 +565,17 @@ dict_tf_is_valid(
if (!compact) { if (!compact) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table compact flags are %ld" "InnoDB: Error: table compact flags are "
ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
compact, compact, atomic_blobs, unused, data_dir, zip_ssize, compact, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
...@@ -580,13 +586,15 @@ dict_tf_is_valid( ...@@ -580,13 +586,15 @@ dict_tf_is_valid(
/* Antelope does not support COMPRESSED row format. */ /* Antelope does not support COMPRESSED row format. */
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF " atomic_blobs " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" "\nInnoDB: unused " ULINTPF " data_dir " ULINTPF
"InnoDB: page_compression %ld page_compression_level %ld\n" " zip_ssize " ULINTPF
"InnoDB: atomic_writes %ld\n", "\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
...@@ -603,12 +611,17 @@ dict_tf_is_valid( ...@@ -603,12 +611,17 @@ dict_tf_is_valid(
|| zip_ssize > PAGE_ZIP_SSIZE_MAX) { || zip_ssize > PAGE_ZIP_SSIZE_MAX) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table compact flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table compact flags are "
ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, flags,
compact, atomic_blobs, unused, data_dir, zip_ssize, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
...@@ -627,12 +640,16 @@ dict_tf_is_valid( ...@@ -627,12 +640,16 @@ dict_tf_is_valid(
|| !atomic_blobs) { || !atomic_blobs) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
...@@ -645,12 +662,16 @@ dict_tf_is_valid( ...@@ -645,12 +662,16 @@ dict_tf_is_valid(
if(atomic_writes > ATOMIC_WRITES_OFF) { if(atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
...@@ -695,7 +716,7 @@ dict_sys_tables_type_validate( ...@@ -695,7 +716,7 @@ dict_sys_tables_type_validate(
if (redundant) { if (redundant) {
if (zip_ssize || atomic_blobs) { if (zip_ssize || atomic_blobs) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
zip_ssize, atomic_blobs); zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -703,7 +724,7 @@ dict_sys_tables_type_validate( ...@@ -703,7 +724,7 @@ dict_sys_tables_type_validate(
/* Make sure there are no bits that we do not know about. */ /* Make sure there are no bits that we do not know about. */
if (unused) { if (unused) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, unused %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", unused " ULINTPF "\n",
type, unused); type, unused);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -719,7 +740,7 @@ dict_sys_tables_type_validate( ...@@ -719,7 +740,7 @@ dict_sys_tables_type_validate(
} else if (zip_ssize) { } else if (zip_ssize) {
/* Antelope does not support COMPRESSED format. */ /* Antelope does not support COMPRESSED format. */
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF "\n",
type, zip_ssize); type, zip_ssize);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -730,14 +751,14 @@ dict_sys_tables_type_validate( ...@@ -730,14 +751,14 @@ dict_sys_tables_type_validate(
should be in N_COLS, but we already know about the should be in N_COLS, but we already know about the
low_order_bit and DICT_N_COLS_COMPACT flags. */ low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs) { if (!atomic_blobs) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
type, zip_ssize, atomic_blobs); type, zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
/* Validate that the number is within allowed range. */ /* Validate that the number is within allowed range. */
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) { if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " max %d\n",
type, zip_ssize, PAGE_ZIP_SSIZE_MAX); type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -755,8 +776,8 @@ dict_sys_tables_type_validate( ...@@ -755,8 +776,8 @@ dict_sys_tables_type_validate(
low_order_bit and DICT_N_COLS_COMPACT flags. */ low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs || !page_compression) { if (!atomic_blobs || !page_compression) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n" fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", page_compression " ULINTPF " page_compression_level " ULINTPF "\n"
"InnoDB: Error: atomic_blobs %lu\n", "InnoDB: Error: atomic_blobs " ULINTPF "\n",
type, page_compression, page_compression_level, atomic_blobs); type, page_compression, page_compression_level, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -764,7 +785,7 @@ dict_sys_tables_type_validate( ...@@ -764,7 +785,7 @@ dict_sys_tables_type_validate(
/* Validate that the atomic writes number is within allowed range. */ /* Validate that the atomic writes number is within allowed range. */
if (atomic_writes > ATOMIC_WRITES_OFF) { if (atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", atomic_writes " ULINTPF "\n",
type, atomic_writes); type, atomic_writes);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
......
...@@ -109,7 +109,7 @@ struct fil_space_crypt_t : st_encryption_scheme ...@@ -109,7 +109,7 @@ struct fil_space_crypt_t : st_encryption_scheme
The object is expected to be placed in a buffer that The object is expected to be placed in a buffer that
has been zero-initialized. */ has been zero-initialized. */
fil_space_crypt_t( fil_space_crypt_t(
ulint new_type, uint new_type,
uint new_min_key_version, uint new_min_key_version,
uint new_key_id, uint new_key_id,
fil_encryption_t new_encryption) fil_encryption_t new_encryption)
...@@ -117,10 +117,10 @@ struct fil_space_crypt_t : st_encryption_scheme ...@@ -117,10 +117,10 @@ struct fil_space_crypt_t : st_encryption_scheme
min_key_version(new_min_key_version), min_key_version(new_min_key_version),
page0_offset(0), page0_offset(0),
encryption(new_encryption), encryption(new_encryption),
key_found(), mutex(),
key_found(new_min_key_version),
rotate_state() rotate_state()
{ {
key_found = new_min_key_version;
key_id = new_key_id; key_id = new_key_id;
my_random_bytes(iv, sizeof(iv)); my_random_bytes(iv, sizeof(iv));
mutex_create(fil_crypt_data_mutex_key, mutex_create(fil_crypt_data_mutex_key,
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2015, MariaDB Corporation. Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -137,7 +137,7 @@ fil_page_type_validate( ...@@ -137,7 +137,7 @@ fil_page_type_validate(
page_type == FIL_PAGE_TYPE_ZBLOB2 || page_type == FIL_PAGE_TYPE_ZBLOB2 ||
page_type == FIL_PAGE_TYPE_COMPRESSED))) { page_type == FIL_PAGE_TYPE_COMPRESSED))) {
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); ulint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED); bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED);
bool page_compressed_encrypted = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); bool page_compressed_encrypted = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
ulint space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); ulint space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
...@@ -149,28 +149,17 @@ fil_page_type_validate( ...@@ -149,28 +149,17 @@ fil_page_type_validate(
fil_system_exit(); fil_system_exit();
/* Dump out the page info */ /* Dump out the page info */
fprintf(stderr, "InnoDB: Space %lu offset %lu name %s page_type %lu page_type_name %s\n" fprintf(stderr, "InnoDB: Page " ULINTPF ":" ULINTPF
"InnoDB: key_version %u page_compressed %d page_compressed_encrypted %d lsn %llu compressed_len %lu\n", " name %s page_type " ULINTPF " page_type_name %s\n"
space, offset, rspace->name, page_type, fil_get_page_type_name(page_type), "InnoDB: key_version " ULINTPF
key_version, page_compressed, page_compressed_encrypted, (ulonglong)lsn, compressed_len); " page_compressed %d page_compressed_encrypted %d lsn "
fflush(stderr); LSN_PF " compressed_len " ULINTPF "\n",
space, offset, rspace->name, page_type,
ut_ad(page_type == FIL_PAGE_PAGE_COMPRESSED || fil_get_page_type_name(page_type),
page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED || key_version,
page_type == FIL_PAGE_INDEX || page_compressed, page_compressed_encrypted,
page_type == FIL_PAGE_UNDO_LOG || lsn, compressed_len);
page_type == FIL_PAGE_INODE || ut_error;
page_type == FIL_PAGE_IBUF_FREE_LIST ||
page_type == FIL_PAGE_TYPE_ALLOCATED ||
page_type == FIL_PAGE_IBUF_BITMAP ||
page_type == FIL_PAGE_TYPE_SYS ||
page_type == FIL_PAGE_TYPE_TRX_SYS ||
page_type == FIL_PAGE_TYPE_FSP_HDR ||
page_type == FIL_PAGE_TYPE_XDES ||
page_type == FIL_PAGE_TYPE_BLOB ||
page_type == FIL_PAGE_TYPE_ZBLOB ||
page_type == FIL_PAGE_TYPE_ZBLOB2 ||
page_type == FIL_PAGE_TYPE_COMPRESSED);
return false; return false;
} }
......
...@@ -540,15 +540,16 @@ dict_tf_is_valid( ...@@ -540,15 +540,16 @@ dict_tf_is_valid(
/* Make sure there are no bits that we do not know about. */ /* Make sure there are no bits that we do not know about. */
if (unused != 0) { if (unused != 0) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table unused flags are %ld" "InnoDB: Error: table unused flags are " ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF " atomic_blobs " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" "\nInnoDB: unused " ULINTPF " data_dir " ULINTPF
"InnoDB: page_compression %ld page_compression_level %ld\n" " zip_ssize " ULINTPF
"InnoDB: atomic_writes %ld\n", "\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
unused, unused,
compact, atomic_blobs, unused, data_dir, zip_ssize, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
...@@ -564,17 +565,20 @@ dict_tf_is_valid( ...@@ -564,17 +565,20 @@ dict_tf_is_valid(
if (!compact) { if (!compact) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table compact flags are %ld" "InnoDB: Error: table compact flags are "
ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
compact, compact, atomic_blobs, unused, data_dir, zip_ssize, compact, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
return(false); return(false);
} }
...@@ -582,17 +586,18 @@ dict_tf_is_valid( ...@@ -582,17 +586,18 @@ dict_tf_is_valid(
/* Antelope does not support COMPRESSED row format. */ /* Antelope does not support COMPRESSED row format. */
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n" " in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF " atomic_blobs " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" "\nInnoDB: unused " ULINTPF " data_dir " ULINTPF
"InnoDB: page_compression %ld page_compression_level %ld\n" " zip_ssize " ULINTPF
"InnoDB: atomic_writes %ld\n", "\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
return(false); return(false);
} }
...@@ -606,12 +611,17 @@ dict_tf_is_valid( ...@@ -606,12 +611,17 @@ dict_tf_is_valid(
|| zip_ssize > PAGE_ZIP_SSIZE_MAX) { || zip_ssize > PAGE_ZIP_SSIZE_MAX) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table compact flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table compact flags are "
ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, flags,
compact, atomic_blobs, unused, data_dir, zip_ssize, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
...@@ -630,16 +640,19 @@ dict_tf_is_valid( ...@@ -630,16 +640,19 @@ dict_tf_is_valid(
|| !atomic_blobs) { || !atomic_blobs) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
return(false); return(false);
} }
} }
...@@ -649,12 +662,16 @@ dict_tf_is_valid( ...@@ -649,12 +662,16 @@ dict_tf_is_valid(
if(atomic_writes > ATOMIC_WRITES_OFF) { if(atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: table flags are %ld in the data dictionary and are corrupted\n" "InnoDB: Error: table flags are " ULINTPF
" in the data dictionary and are corrupted\n"
"InnoDB: Error: data dictionary flags are\n" "InnoDB: Error: data dictionary flags are\n"
"InnoDB: compact %ld atomic_blobs %ld\n" "InnoDB: compact " ULINTPF
"InnoDB: unused %ld data_dir %ld zip_ssize %ld\n" " atomic_blobs " ULINTPF "\n"
"InnoDB: page_compression %ld page_compression_level %ld\n" "InnoDB: unused " ULINTPF
"InnoDB: atomic_writes %ld\n", " data_dir " ULINTPF " zip_ssize " ULINTPF
"\nInnoDB: page_compression " ULINTPF
" page_compression_level " ULINTPF
"\nInnoDB: atomic_writes " ULINTPF "\n",
flags, compact, atomic_blobs, unused, data_dir, zip_ssize, flags, compact, atomic_blobs, unused, data_dir, zip_ssize,
page_compression, page_compression_level, atomic_writes page_compression, page_compression_level, atomic_writes
); );
...@@ -699,7 +716,7 @@ dict_sys_tables_type_validate( ...@@ -699,7 +716,7 @@ dict_sys_tables_type_validate(
if (redundant) { if (redundant) {
if (zip_ssize || atomic_blobs) { if (zip_ssize || atomic_blobs) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=Redundant, zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
zip_ssize, atomic_blobs); zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -707,7 +724,7 @@ dict_sys_tables_type_validate( ...@@ -707,7 +724,7 @@ dict_sys_tables_type_validate(
/* Make sure there are no bits that we do not know about. */ /* Make sure there are no bits that we do not know about. */
if (unused) { if (unused) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, unused %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", unused " ULINTPF "\n",
type, unused); type, unused);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -723,7 +740,7 @@ dict_sys_tables_type_validate( ...@@ -723,7 +740,7 @@ dict_sys_tables_type_validate(
} else if (zip_ssize) { } else if (zip_ssize) {
/* Antelope does not support COMPRESSED format. */ /* Antelope does not support COMPRESSED format. */
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF "\n",
type, zip_ssize); type, zip_ssize);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -734,14 +751,14 @@ dict_sys_tables_type_validate( ...@@ -734,14 +751,14 @@ dict_sys_tables_type_validate(
should be in N_COLS, but we already know about the should be in N_COLS, but we already know about the
low_order_bit and DICT_N_COLS_COMPACT flags. */ low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs) { if (!atomic_blobs) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " atomic_blobs " ULINTPF "\n",
type, zip_ssize, atomic_blobs); type, zip_ssize, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
/* Validate that the number is within allowed range. */ /* Validate that the number is within allowed range. */
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) { if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", zip_ssize " ULINTPF " max %d\n",
type, zip_ssize, PAGE_ZIP_SSIZE_MAX); type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -759,8 +776,8 @@ dict_sys_tables_type_validate( ...@@ -759,8 +776,8 @@ dict_sys_tables_type_validate(
low_order_bit and DICT_N_COLS_COMPACT flags. */ low_order_bit and DICT_N_COLS_COMPACT flags. */
if (!atomic_blobs || !page_compression) { if (!atomic_blobs || !page_compression) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n" fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", page_compression " ULINTPF " page_compression_level " ULINTPF "\n"
"InnoDB: Error: atomic_blobs %lu\n", "InnoDB: Error: atomic_blobs " ULINTPF "\n",
type, page_compression, page_compression_level, atomic_blobs); type, page_compression, page_compression_level, atomic_blobs);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
...@@ -768,7 +785,7 @@ dict_sys_tables_type_validate( ...@@ -768,7 +785,7 @@ dict_sys_tables_type_validate(
/* Validate that the atomic writes number is within allowed range. */ /* Validate that the atomic writes number is within allowed range. */
if (atomic_writes > ATOMIC_WRITES_OFF) { if (atomic_writes > ATOMIC_WRITES_OFF) {
fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu\n", fprintf(stderr, "InnoDB: Error: SYS_TABLES::TYPE=" ULINTPF ", atomic_writes " ULINTPF "\n",
type, atomic_writes); type, atomic_writes);
return(ULINT_UNDEFINED); return(ULINT_UNDEFINED);
} }
......
...@@ -109,7 +109,7 @@ struct fil_space_crypt_t : st_encryption_scheme ...@@ -109,7 +109,7 @@ struct fil_space_crypt_t : st_encryption_scheme
The object is expected to be placed in a buffer that The object is expected to be placed in a buffer that
has been zero-initialized. */ has been zero-initialized. */
fil_space_crypt_t( fil_space_crypt_t(
ulint new_type, uint new_type,
uint new_min_key_version, uint new_min_key_version,
uint new_key_id, uint new_key_id,
fil_encryption_t new_encryption) fil_encryption_t new_encryption)
...@@ -117,10 +117,10 @@ struct fil_space_crypt_t : st_encryption_scheme ...@@ -117,10 +117,10 @@ struct fil_space_crypt_t : st_encryption_scheme
min_key_version(new_min_key_version), min_key_version(new_min_key_version),
page0_offset(0), page0_offset(0),
encryption(new_encryption), encryption(new_encryption),
key_found(), mutex(),
key_found(new_min_key_version),
rotate_state() rotate_state()
{ {
key_found = new_min_key_version;
key_id = new_key_id; key_id = new_key_id;
my_random_bytes(iv, sizeof(iv)); my_random_bytes(iv, sizeof(iv));
mutex_create(fil_crypt_data_mutex_key, mutex_create(fil_crypt_data_mutex_key,
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2015, MariaDB Corporation. Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -137,7 +137,7 @@ fil_page_type_validate( ...@@ -137,7 +137,7 @@ fil_page_type_validate(
page_type == FIL_PAGE_TYPE_ZBLOB2 || page_type == FIL_PAGE_TYPE_ZBLOB2 ||
page_type == FIL_PAGE_TYPE_COMPRESSED))) { page_type == FIL_PAGE_TYPE_COMPRESSED))) {
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION); ulint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED); bool page_compressed = (page_type == FIL_PAGE_PAGE_COMPRESSED);
bool page_compressed_encrypted = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); bool page_compressed_encrypted = (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
ulint space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); ulint space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
...@@ -148,30 +148,18 @@ fil_page_type_validate( ...@@ -148,30 +148,18 @@ fil_page_type_validate(
fil_space_t* rspace = fil_space_get_by_id(space); fil_space_t* rspace = fil_space_get_by_id(space);
fil_system_exit(); fil_system_exit();
/* Dump out the page info */ /* Dump out the page info */
fprintf(stderr, "InnoDB: Space %lu offset %lu name %s page_type %lu page_type_name %s\n" fprintf(stderr, "InnoDB: Page " ULINTPF ":" ULINTPF
"InnoDB: key_version %u page_compressed %d page_compressed_encrypted %d lsn %llu compressed_len %lu\n", " name %s page_type " ULINTPF " page_type_name %s\n"
space, offset, rspace->name, page_type, fil_get_page_type_name(page_type), "InnoDB: key_version " ULINTPF
key_version, page_compressed, page_compressed_encrypted, (ulonglong)lsn, compressed_len); " page_compressed %d page_compressed_encrypted %d lsn "
fflush(stderr); LSN_PF " compressed_len " ULINTPF "\n",
space, offset, rspace->name, page_type,
ut_ad(page_type == FIL_PAGE_PAGE_COMPRESSED || fil_get_page_type_name(page_type),
page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED || key_version,
page_type == FIL_PAGE_INDEX || page_compressed, page_compressed_encrypted,
page_type == FIL_PAGE_UNDO_LOG || lsn, compressed_len);
page_type == FIL_PAGE_INODE || ut_error;
page_type == FIL_PAGE_IBUF_FREE_LIST ||
page_type == FIL_PAGE_TYPE_ALLOCATED ||
page_type == FIL_PAGE_IBUF_BITMAP ||
page_type == FIL_PAGE_TYPE_SYS ||
page_type == FIL_PAGE_TYPE_TRX_SYS ||
page_type == FIL_PAGE_TYPE_FSP_HDR ||
page_type == FIL_PAGE_TYPE_XDES ||
page_type == FIL_PAGE_TYPE_BLOB ||
page_type == FIL_PAGE_TYPE_ZBLOB ||
page_type == FIL_PAGE_TYPE_ZBLOB2 ||
page_type == FIL_PAGE_TYPE_COMPRESSED);
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment