From 50ed0bd891f11a2dae3a67d1ecbf8223fcbedbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 10 Dec 2021 11:29:06 +0200 Subject: 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. --- storage/innobase/dict/dict0load.cc | 6 +++--- 1 file 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 &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()); -- cgit v1.2.1