Skip to content

Commit bf8735e

Browse files
committed
Fix MSVC warning C4819 when system codepage is set to UTF-8.
The warning message says the file contains a character which can not be represented in current codepage (not exactly accurate)
1 parent e85089a commit bf8735e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

storage/innobase/handler/handler0alter.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10313,17 +10313,17 @@ commit_try_norebuild(
1031310313

1031410314
dict_fs2utf8(ctx->new_table->name.m_name, db, sizeof db,
1031510315
table, sizeof table);
10316-
10316+
tmp_name[0]= (char)0xff;
1031710317
for (size_t i = 0; error == DB_SUCCESS && i < size; i++) {
10318-
snprintf(tmp_name, sizeof tmp_name, "\xff%zu", i);
10318+
snprintf(tmp_name+1, sizeof(tmp_name)-1, "%zu", i);
1031910319
error = dict_stats_rename_index(db, table,
1032010320
ha_alter_info->
1032110321
rename_keys[i].
1032210322
old_key->name.str,
1032310323
tmp_name, trx);
1032410324
}
1032510325
for (size_t i = 0; error == DB_SUCCESS && i < size; i++) {
10326-
snprintf(tmp_name, sizeof tmp_name, "\xff%zu", i);
10326+
snprintf(tmp_name+1, sizeof(tmp_name)-1, "%zu", i);
1032710327
error = dict_stats_rename_index(db, table, tmp_name,
1032810328
ha_alter_info
1032910329
->rename_keys[i].

0 commit comments

Comments
 (0)