Skip to content

Commit f67b827

Browse files
committed
Fixed wrong arguments to printf in InnoDB
1 parent 30289a2 commit f67b827

File tree

5 files changed

+43
-42
lines changed

5 files changed

+43
-42
lines changed

storage/innobase/handler/ha_innodb.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ convert_error_code_to_mysql(
21662166

21672167
case DB_TOO_BIG_INDEX_COL:
21682168
my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0),
2169-
DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
2169+
(ulong) DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
21702170
return(HA_ERR_INDEX_COL_TOO_LONG);
21712171

21722172
case DB_NO_SAVEPOINT:
@@ -5287,7 +5287,6 @@ innobase_close_connection(
52875287
"MariaDB is closing a connection that has an active "
52885288
"InnoDB transaction. " TRX_ID_FMT " row modifications "
52895289
"will roll back.",
5290-
" row modifications will roll back.",
52915290
trx->undo_no);
52925291
ut_d(ib::warn()
52935292
<< "trx: " << trx << " started on: "
@@ -12132,7 +12131,7 @@ create_table_info_t::create_options_are_invalid()
1213212131
ER_ILLEGAL_HA_CREATE_OPTION,
1213312132
"InnoDB: invalid KEY_BLOCK_SIZE = %u."
1213412133
" Valid values are [1, 2, 4, 8, 16]",
12135-
m_create_info->key_block_size);
12134+
(uint) m_create_info->key_block_size);
1213612135
ret = "KEY_BLOCK_SIZE";
1213712136
break;
1213812137
}
@@ -12623,7 +12622,7 @@ create_table_info_t::innobase_table_flags()
1262312622
m_thd, Sql_condition::WARN_LEVEL_WARN,
1262412623
ER_ILLEGAL_HA_CREATE_OPTION,
1262512624
"InnoDB: ignoring KEY_BLOCK_SIZE=%u.",
12626-
m_create_info->key_block_size);
12625+
(uint) m_create_info->key_block_size);
1262712626
}
1262812627
}
1262912628

@@ -12646,7 +12645,7 @@ create_table_info_t::innobase_table_flags()
1264612645
ER_ILLEGAL_HA_CREATE_OPTION,
1264712646
"InnoDB: ignoring KEY_BLOCK_SIZE=%u"
1264812647
" unless ROW_FORMAT=COMPRESSED.",
12649-
m_create_info->key_block_size);
12648+
(uint) m_create_info->key_block_size);
1265012649
zip_allowed = false;
1265112650
}
1265212651
} else {
@@ -14199,7 +14198,8 @@ ha_innobase::records_in_range(
1419914198
push_warning_printf(
1420014199
ha_thd(), Sql_condition::WARN_LEVEL_WARN,
1420114200
ER_NO_DEFAULT,
14202-
"btr_estimate_n_rows_in_range(): %f", n_rows);
14201+
"btr_estimate_n_rows_in_range(): %lld",
14202+
(longlong) n_rows);
1420314203
);
1420414204

1420514205
func_exit:
@@ -22963,7 +22963,7 @@ ib_push_frm_error(
2296322963
"installations? See "
2296422964
REFMAN
2296522965
"innodb-troubleshooting.html\n",
22966-
ib_table->name);
22966+
ib_table->name.m_name);
2296722967

2296822968
if (push_warning) {
2296922969
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
@@ -23007,7 +23007,7 @@ ib_push_frm_error(
2300723007
"installations? See "
2300823008
REFMAN
2300923009
"innodb-troubleshooting.html\n",
23010-
ib_table->name, n_keys,
23010+
ib_table->name.m_name, n_keys,
2301123011
table->s->keys);
2301223012

2301323013
if (push_warning) {

storage/innobase/handler/handler0alter.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ my_error_innodb(
300300
break;
301301
case DB_TOO_BIG_INDEX_COL:
302302
my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0),
303-
DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
303+
(ulong) DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
304304
break;
305305
case DB_TOO_MANY_CONCURRENT_TRXS:
306306
my_error(ER_TOO_MANY_CONCURRENT_TRXS, MYF(0));
@@ -1636,7 +1636,7 @@ innobase_get_foreign_key_info(
16361636
/* Not possible to add a foreign key without a
16371637
referenced column */
16381638
mutex_exit(&dict_sys->mutex);
1639-
my_error(ER_CANNOT_ADD_FOREIGN, MYF(0), tbl_namep);
1639+
my_error(ER_CANNOT_ADD_FOREIGN, MYF(0));
16401640
goto err_exit;
16411641
}
16421642

@@ -2050,7 +2050,8 @@ innobase_check_index_keys(
20502050
}
20512051
#endif /* MYSQL_RENAME_INDEX */
20522052

2053-
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key.name);
2053+
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0),
2054+
key.name);
20542055

20552056
return(ER_WRONG_NAME_FOR_INDEX);
20562057
}

storage/innobase/row/row0import.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ row_import_cfg_read_index_fields(
24632463

24642464
ib_senderrf(
24652465
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2466-
errno, strerror(errno),
2466+
(ulong) errno, strerror(errno),
24672467
"while reading index fields.");
24682468

24692469
return(DB_IO_ERROR);
@@ -2499,7 +2499,7 @@ row_import_cfg_read_index_fields(
24992499

25002500
ib_senderrf(
25012501
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2502-
errno, strerror(errno),
2502+
(ulong) errno, strerror(errno),
25032503
"while parsing table name.");
25042504

25052505
return(err);
@@ -2569,7 +2569,7 @@ row_import_read_index_data(
25692569

25702570
ib_senderrf(
25712571
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2572-
errno, strerror(errno), msg);
2572+
(ulong) errno, strerror(errno), msg);
25732573

25742574
ib::error() << "IO Error: " << msg;
25752575

@@ -2644,7 +2644,7 @@ row_import_read_index_data(
26442644

26452645
ib_senderrf(
26462646
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2647-
errno, strerror(errno),
2647+
(ulong) errno, strerror(errno),
26482648
"while parsing index name.");
26492649

26502650
return(err);
@@ -2683,7 +2683,7 @@ row_import_read_indexes(
26832683
if (fread(row, 1, sizeof(row), file) != sizeof(row)) {
26842684
ib_senderrf(
26852685
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2686-
errno, strerror(errno),
2686+
(ulong) errno, strerror(errno),
26872687
"while reading number of indexes.");
26882688

26892689
return(DB_IO_ERROR);
@@ -2769,7 +2769,7 @@ row_import_read_columns(
27692769
if (fread(row, 1, sizeof(row), file) != sizeof(row)) {
27702770
ib_senderrf(
27712771
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2772-
errno, strerror(errno),
2772+
(ulong) errno, strerror(errno),
27732773
"while reading table column meta-data.");
27742774

27752775
return(DB_IO_ERROR);
@@ -2833,7 +2833,7 @@ row_import_read_columns(
28332833

28342834
ib_senderrf(
28352835
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2836-
errno, strerror(errno),
2836+
(ulong) errno, strerror(errno),
28372837
"while parsing table column name.");
28382838

28392839
return(err);
@@ -2864,7 +2864,7 @@ row_import_read_v1(
28642864
if (fread(value, 1, sizeof(value), file) != sizeof(value)) {
28652865
ib_senderrf(
28662866
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2867-
errno, strerror(errno),
2867+
(ulong) errno, strerror(errno),
28682868
"while reading meta-data export hostname length.");
28692869

28702870
return(DB_IO_ERROR);
@@ -2892,7 +2892,7 @@ row_import_read_v1(
28922892

28932893
ib_senderrf(
28942894
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2895-
errno, strerror(errno),
2895+
(ulong) errno, strerror(errno),
28962896
"while parsing export hostname.");
28972897

28982898
return(err);
@@ -2906,7 +2906,7 @@ row_import_read_v1(
29062906
if (fread(value, 1, sizeof(value), file) != sizeof(value)) {
29072907
ib_senderrf(
29082908
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2909-
errno, strerror(errno),
2909+
(ulong) errno, strerror(errno),
29102910
"while reading meta-data table name length.");
29112911

29122912
return(DB_IO_ERROR);
@@ -2933,7 +2933,7 @@ row_import_read_v1(
29332933
if (err != DB_SUCCESS) {
29342934
ib_senderrf(
29352935
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2936-
errno, strerror(errno),
2936+
(ulong) errno, strerror(errno),
29372937
"while parsing table name.");
29382938

29392939
return(err);
@@ -2952,7 +2952,7 @@ row_import_read_v1(
29522952
if (fread(row, 1, sizeof(ib_uint64_t), file) != sizeof(ib_uint64_t)) {
29532953
ib_senderrf(
29542954
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2955-
errno, strerror(errno),
2955+
(ulong) errno, strerror(errno),
29562956
"while reading autoinc value.");
29572957

29582958
return(DB_IO_ERROR);
@@ -2968,7 +2968,7 @@ row_import_read_v1(
29682968
if (fread(row, 1, sizeof(row), file) != sizeof(row)) {
29692969
ib_senderrf(
29702970
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
2971-
errno, strerror(errno),
2971+
(ulong) errno, strerror(errno),
29722972
"while reading meta-data header.");
29732973

29742974
return(DB_IO_ERROR);
@@ -3039,7 +3039,7 @@ row_import_read_meta_data(
30393039
if (fread(&row, 1, sizeof(row), file) != sizeof(row)) {
30403040
ib_senderrf(
30413041
thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR,
3042-
errno, strerror(errno),
3042+
(ulong) errno, strerror(errno),
30433043
"while reading meta-data version.");
30443044

30453045
return(DB_IO_ERROR);
@@ -3090,7 +3090,7 @@ row_import_read_cfg(
30903090

30913091
ib_senderrf(
30923092
thd, IB_LOG_LEVEL_WARN, ER_IO_READ_ERROR,
3093-
errno, strerror(errno), msg);
3093+
(ulong) errno, strerror(errno), msg);
30943094

30953095
cfg.m_missing = true;
30963096

storage/innobase/row/row0merge.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4702,8 +4702,8 @@ row_merge_build_indexes(
47024702
"Table %s is encrypted but encryption service or"
47034703
" used key_id is not available. "
47044704
" Can't continue reading table.",
4705-
!old_table->is_readable() ? old_table->name :
4706-
new_table->name);
4705+
!old_table->is_readable() ? old_table->name.m_name :
4706+
new_table->name.m_name);
47074707
goto func_exit;
47084708
}
47094709

storage/innobase/row/row0quiesce.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ row_quiesce_write_index_fields(
6767

6868
ib_senderrf(
6969
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
70-
errno, strerror(errno),
70+
(ulong) errno, strerror(errno),
7171
"while writing index fields.");
7272

7373
return(DB_IO_ERROR);
@@ -87,7 +87,7 @@ row_quiesce_write_index_fields(
8787

8888
ib_senderrf(
8989
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
90-
errno, strerror(errno),
90+
(ulong) errno, strerror(errno),
9191
"while writing index column.");
9292

9393
return(DB_IO_ERROR);
@@ -121,7 +121,7 @@ row_quiesce_write_indexes(
121121
if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) {
122122
ib_senderrf(
123123
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
124-
errno, strerror(errno),
124+
(ulong) errno, strerror(errno),
125125
"while writing index count.");
126126

127127
return(DB_IO_ERROR);
@@ -175,7 +175,7 @@ row_quiesce_write_indexes(
175175

176176
ib_senderrf(
177177
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
178-
errno, strerror(errno),
178+
(ulong) errno, strerror(errno),
179179
"while writing index meta-data.");
180180

181181
return(DB_IO_ERROR);
@@ -196,7 +196,7 @@ row_quiesce_write_indexes(
196196

197197
ib_senderrf(
198198
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
199-
errno, strerror(errno),
199+
(ulong) errno, strerror(errno),
200200
"while writing index name.");
201201

202202
return(DB_IO_ERROR);
@@ -256,7 +256,7 @@ row_quiesce_write_table(
256256
if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) {
257257
ib_senderrf(
258258
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
259-
errno, strerror(errno),
259+
(ulong) errno, strerror(errno),
260260
"while writing table column data.");
261261

262262
return(DB_IO_ERROR);
@@ -283,7 +283,7 @@ row_quiesce_write_table(
283283

284284
ib_senderrf(
285285
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
286-
errno, strerror(errno),
286+
(ulong) errno, strerror(errno),
287287
"while writing column name.");
288288

289289
return(DB_IO_ERROR);
@@ -315,7 +315,7 @@ row_quiesce_write_header(
315315
if (fwrite(&value, 1, sizeof(value), file) != sizeof(value)) {
316316
ib_senderrf(
317317
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
318-
errno, strerror(errno),
318+
(ulong) errno, strerror(errno),
319319
"while writing meta-data version number.");
320320

321321
return(DB_IO_ERROR);
@@ -345,7 +345,7 @@ row_quiesce_write_header(
345345

346346
ib_senderrf(
347347
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
348-
errno, strerror(errno),
348+
(ulong) errno, strerror(errno),
349349
"while writing hostname.");
350350

351351
return(DB_IO_ERROR);
@@ -365,7 +365,7 @@ row_quiesce_write_header(
365365

366366
ib_senderrf(
367367
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
368-
errno, strerror(errno),
368+
(ulong) errno, strerror(errno),
369369
"while writing table name.");
370370

371371
return(DB_IO_ERROR);
@@ -381,7 +381,7 @@ row_quiesce_write_header(
381381
if (fwrite(row, 1, sizeof(ib_uint64_t), file) != sizeof(ib_uint64_t)) {
382382
ib_senderrf(
383383
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
384-
errno, strerror(errno),
384+
(ulong) errno, strerror(errno),
385385
"while writing table autoinc value.");
386386

387387
return(DB_IO_ERROR);
@@ -405,7 +405,7 @@ row_quiesce_write_header(
405405
if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) {
406406
ib_senderrf(
407407
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
408-
errno, strerror(errno),
408+
(ulong) errno, strerror(errno),
409409
"while writing table meta-data.");
410410

411411
return(DB_IO_ERROR);
@@ -458,7 +458,7 @@ row_quiesce_write_cfg(
458458

459459
ib_senderrf(
460460
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
461-
errno, strerror(errno), msg);
461+
(ulong) errno, strerror(errno), msg);
462462
}
463463

464464
if (fclose(file) != 0) {
@@ -468,7 +468,7 @@ row_quiesce_write_cfg(
468468

469469
ib_senderrf(
470470
thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR,
471-
errno, strerror(errno), msg);
471+
(ulong) errno, strerror(errno), msg);
472472
}
473473
}
474474

0 commit comments

Comments
 (0)