From f67b8273c03b4802cb97e68b0c1baf5de330a2bf Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 21 Jan 2018 17:17:16 +0200 Subject: [PATCH] Fixed wrong arguments to printf in InnoDB --- storage/innobase/handler/ha_innodb.cc | 16 ++++++------ storage/innobase/handler/handler0alter.cc | 7 +++--- storage/innobase/row/row0import.cc | 30 +++++++++++------------ storage/innobase/row/row0merge.cc | 4 +-- storage/innobase/row/row0quiesce.cc | 28 ++++++++++----------- 5 files changed, 43 insertions(+), 42 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b42da1c025e..198cfadc195 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2166,7 +2166,7 @@ convert_error_code_to_mysql( case DB_TOO_BIG_INDEX_COL: my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0), - DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags)); + (ulong) DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags)); return(HA_ERR_INDEX_COL_TOO_LONG); case DB_NO_SAVEPOINT: @@ -5287,7 +5287,6 @@ innobase_close_connection( "MariaDB is closing a connection that has an active " "InnoDB transaction. " TRX_ID_FMT " row modifications " "will roll back.", - " row modifications will roll back.", trx->undo_no); ut_d(ib::warn() << "trx: " << trx << " started on: " @@ -12132,7 +12131,7 @@ create_table_info_t::create_options_are_invalid() ER_ILLEGAL_HA_CREATE_OPTION, "InnoDB: invalid KEY_BLOCK_SIZE = %u." " Valid values are [1, 2, 4, 8, 16]", - m_create_info->key_block_size); + (uint) m_create_info->key_block_size); ret = "KEY_BLOCK_SIZE"; break; } @@ -12623,7 +12622,7 @@ index_bad: m_thd, Sql_condition::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, "InnoDB: ignoring KEY_BLOCK_SIZE=%u.", - m_create_info->key_block_size); + (uint) m_create_info->key_block_size); } } @@ -12646,7 +12645,7 @@ index_bad: ER_ILLEGAL_HA_CREATE_OPTION, "InnoDB: ignoring KEY_BLOCK_SIZE=%u" " unless ROW_FORMAT=COMPRESSED.", - m_create_info->key_block_size); + (uint) m_create_info->key_block_size); zip_allowed = false; } } else { @@ -14199,7 +14198,8 @@ ha_innobase::records_in_range( push_warning_printf( ha_thd(), Sql_condition::WARN_LEVEL_WARN, ER_NO_DEFAULT, - "btr_estimate_n_rows_in_range(): %f", n_rows); + "btr_estimate_n_rows_in_range(): %lld", + (longlong) n_rows); ); func_exit: @@ -22963,7 +22963,7 @@ ib_push_frm_error( "installations? See " REFMAN "innodb-troubleshooting.html\n", - ib_table->name); + ib_table->name.m_name); if (push_warning) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, @@ -23007,7 +23007,7 @@ ib_push_frm_error( "installations? See " REFMAN "innodb-troubleshooting.html\n", - ib_table->name, n_keys, + ib_table->name.m_name, n_keys, table->s->keys); if (push_warning) { diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 44c40d05b4c..9e6d81e21e4 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -300,7 +300,7 @@ my_error_innodb( break; case DB_TOO_BIG_INDEX_COL: my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0), - DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags)); + (ulong) DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags)); break; case DB_TOO_MANY_CONCURRENT_TRXS: my_error(ER_TOO_MANY_CONCURRENT_TRXS, MYF(0)); @@ -1636,7 +1636,7 @@ innobase_get_foreign_key_info( /* Not possible to add a foreign key without a referenced column */ mutex_exit(&dict_sys->mutex); - my_error(ER_CANNOT_ADD_FOREIGN, MYF(0), tbl_namep); + my_error(ER_CANNOT_ADD_FOREIGN, MYF(0)); goto err_exit; } @@ -2050,7 +2050,8 @@ innobase_check_index_keys( } #endif /* MYSQL_RENAME_INDEX */ - my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key.name); + my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), + key.name); return(ER_WRONG_NAME_FOR_INDEX); } diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index a02f60c6800..473e0c25f86 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -2463,7 +2463,7 @@ row_import_cfg_read_index_fields( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading index fields."); return(DB_IO_ERROR); @@ -2499,7 +2499,7 @@ row_import_cfg_read_index_fields( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while parsing table name."); return(err); @@ -2569,7 +2569,7 @@ row_import_read_index_data( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), msg); + (ulong) errno, strerror(errno), msg); ib::error() << "IO Error: " << msg; @@ -2644,7 +2644,7 @@ row_import_read_index_data( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while parsing index name."); return(err); @@ -2683,7 +2683,7 @@ row_import_read_indexes( if (fread(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading number of indexes."); return(DB_IO_ERROR); @@ -2769,7 +2769,7 @@ row_import_read_columns( if (fread(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading table column meta-data."); return(DB_IO_ERROR); @@ -2833,7 +2833,7 @@ row_import_read_columns( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while parsing table column name."); return(err); @@ -2864,7 +2864,7 @@ row_import_read_v1( if (fread(value, 1, sizeof(value), file) != sizeof(value)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading meta-data export hostname length."); return(DB_IO_ERROR); @@ -2892,7 +2892,7 @@ row_import_read_v1( ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while parsing export hostname."); return(err); @@ -2906,7 +2906,7 @@ row_import_read_v1( if (fread(value, 1, sizeof(value), file) != sizeof(value)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading meta-data table name length."); return(DB_IO_ERROR); @@ -2933,7 +2933,7 @@ row_import_read_v1( if (err != DB_SUCCESS) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while parsing table name."); return(err); @@ -2952,7 +2952,7 @@ row_import_read_v1( if (fread(row, 1, sizeof(ib_uint64_t), file) != sizeof(ib_uint64_t)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading autoinc value."); return(DB_IO_ERROR); @@ -2968,7 +2968,7 @@ row_import_read_v1( if (fread(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading meta-data header."); return(DB_IO_ERROR); @@ -3039,7 +3039,7 @@ row_import_read_meta_data( if (fread(&row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_ERROR, ER_IO_READ_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while reading meta-data version."); return(DB_IO_ERROR); @@ -3090,7 +3090,7 @@ row_import_read_cfg( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_READ_ERROR, - errno, strerror(errno), msg); + (ulong) errno, strerror(errno), msg); cfg.m_missing = true; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 017821fdf38..4776bcc3c25 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4702,8 +4702,8 @@ row_merge_build_indexes( "Table %s is encrypted but encryption service or" " used key_id is not available. " " Can't continue reading table.", - !old_table->is_readable() ? old_table->name : - new_table->name); + !old_table->is_readable() ? old_table->name.m_name : + new_table->name.m_name); goto func_exit; } diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index 21cc67620f6..77cb35b8f21 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -67,7 +67,7 @@ row_quiesce_write_index_fields( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing index fields."); return(DB_IO_ERROR); @@ -87,7 +87,7 @@ row_quiesce_write_index_fields( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing index column."); return(DB_IO_ERROR); @@ -121,7 +121,7 @@ row_quiesce_write_indexes( if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing index count."); return(DB_IO_ERROR); @@ -175,7 +175,7 @@ row_quiesce_write_indexes( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing index meta-data."); return(DB_IO_ERROR); @@ -196,7 +196,7 @@ row_quiesce_write_indexes( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing index name."); return(DB_IO_ERROR); @@ -256,7 +256,7 @@ row_quiesce_write_table( if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing table column data."); return(DB_IO_ERROR); @@ -283,7 +283,7 @@ row_quiesce_write_table( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing column name."); return(DB_IO_ERROR); @@ -315,7 +315,7 @@ row_quiesce_write_header( if (fwrite(&value, 1, sizeof(value), file) != sizeof(value)) { ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing meta-data version number."); return(DB_IO_ERROR); @@ -345,7 +345,7 @@ row_quiesce_write_header( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing hostname."); return(DB_IO_ERROR); @@ -365,7 +365,7 @@ row_quiesce_write_header( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing table name."); return(DB_IO_ERROR); @@ -381,7 +381,7 @@ row_quiesce_write_header( if (fwrite(row, 1, sizeof(ib_uint64_t), file) != sizeof(ib_uint64_t)) { ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing table autoinc value."); return(DB_IO_ERROR); @@ -405,7 +405,7 @@ row_quiesce_write_header( if (fwrite(row, 1, sizeof(row), file) != sizeof(row)) { ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), + (ulong) errno, strerror(errno), "while writing table meta-data."); return(DB_IO_ERROR); @@ -458,7 +458,7 @@ row_quiesce_write_cfg( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), msg); + (ulong) errno, strerror(errno), msg); } if (fclose(file) != 0) { @@ -468,7 +468,7 @@ row_quiesce_write_cfg( ib_senderrf( thd, IB_LOG_LEVEL_WARN, ER_IO_WRITE_ERROR, - errno, strerror(errno), msg); + (ulong) errno, strerror(errno), msg); } }