summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-12-10 11:29:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-12-10 11:29:06 +0200
commit50ed0bd891f11a2dae3a67d1ecbf8223fcbedbc6 (patch)
tree51fb3cc963afec24f563e3206a94aad32e51412f
parent186c1fa25057a465f4725ef28ce3d878af20947b (diff)
downloadmariadb-git-50ed0bd891f11a2dae3a67d1ecbf8223fcbedbc6.tar.gz
MDEV-27219 Some error messages might report table names incorrectly on LLP64
In commit 49e2c8f0a6fefdeac50925f758090d6bd099768d (MDEV-25743) some more use of the printf-style format "%.*s" was added. The length parameter is of type int, not size_t. On 64-bit platforms that follow the LLP64 convention (such as 64-bit Microsoft Windows), sizeof(int)==4 and sizeof(size_t)==8. Let us explicitly cast the lengths to the correct type in order to avoid any trouble.
-rw-r--r--storage/innobase/dict/dict0load.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index a69f645758f..5baf353280e 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -769,7 +769,7 @@ dict_sys_tables_rec_read(
" data dictionary contains invalid flags."
" SYS_TABLES.TYPE=" ULINTPF
" SYS_TABLES.N_COLS=" ULINTPF,
- name.size(), name.data(), type, *n_cols);
+ int(name.size()), name.data(), type, *n_cols);
return(false);
}
@@ -794,7 +794,7 @@ dict_sys_tables_rec_read(
" contains invalid flags."
" SYS_TABLES.TYPE=" ULINTPF
" SYS_TABLES.MIX_LEN=" ULINTPF,
- name.size(), name.data(),
+ int(name.size()), name.data(),
type, *flags2);
return(false);
}
@@ -2252,7 +2252,7 @@ static dict_table_t *dict_load_table_one(const span<const char> &name,
DBUG_ENTER("dict_load_table_one");
DBUG_PRINT("dict_load_table_one",
- ("table: %.*s", name.size(), name.data()));
+ ("table: %.*s", int(name.size()), name.data()));
ut_ad(dict_sys.locked());