Commit 50ed0bd8 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27219 Some error messages might report table names incorrectly on LLP64

In commit 49e2c8f0 (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.
parent 186c1fa2
......@@ -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());
......
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