From 22f9353bfd3ea7b5f8cd7533c300dde78427636f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 4 Oct 2014 15:26:04 +0200 Subject: [PATCH] xtradb/innodb: fix to compile with VS 2008 and compiler warnings --- storage/innobase/handler/handler0alter.cc | 8 ++++---- storage/innobase/row/row0mysql.cc | 2 +- storage/xtradb/handler/handler0alter.cc | 12 ++++++------ storage/xtradb/row/row0mysql.cc | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index fe36829ba44..123798b9839 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -2237,7 +2237,7 @@ innobase_check_foreigns_low( /* Check if any FOREIGN KEY constraints are defined on this column. */ - for (dict_foreign_set::iterator it = user_table->foreign_set.begin(); + for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin(); it != user_table->foreign_set.end(); ++it) { @@ -2274,7 +2274,7 @@ innobase_check_foreigns_low( /* Check if any FOREIGN KEY constraints in other tables are referring to the column that is being dropped. */ - for (dict_foreign_set::iterator it + for (dict_foreign_set::const_iterator it = user_table->referenced_set.begin(); it != user_table->referenced_set.end(); ++it) { @@ -4446,7 +4446,7 @@ err_exit: rename_foreign: trx->op_info = "renaming column in SYS_FOREIGN_COLS"; - for (dict_foreign_set::iterator it = user_table->foreign_set.begin(); + for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin(); it != user_table->foreign_set.end(); ++it) { @@ -4481,7 +4481,7 @@ rename_foreign: } } - for (dict_foreign_set::iterator it + for (dict_foreign_set::const_iterator it = user_table->referenced_set.begin(); it != user_table->referenced_set.end(); ++it) { diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index ca70543a97b..da79c53808b 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2839,7 +2839,7 @@ row_discard_tablespace_foreign_key_checks( /* Check if the table is referenced by foreign key constraints from some other table (not the table itself) */ - dict_foreign_set::iterator it + dict_foreign_set::const_iterator it = std::find_if(table->referenced_set.begin(), table->referenced_set.end(), dict_foreign_different_tables()); diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc index a561ae22f86..a5524fc6894 100644 --- a/storage/xtradb/handler/handler0alter.cc +++ b/storage/xtradb/handler/handler0alter.cc @@ -2238,7 +2238,7 @@ innobase_check_foreigns_low( /* Check if any FOREIGN KEY constraints are defined on this column. */ - for (dict_foreign_set::iterator it = user_table->foreign_set.begin(); + for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin(); it != user_table->foreign_set.end(); ++it) { @@ -2275,7 +2275,7 @@ innobase_check_foreigns_low( /* Check if any FOREIGN KEY constraints in other tables are referring to the column that is being dropped. */ - for (dict_foreign_set::iterator it + for (dict_foreign_set::const_iterator it = user_table->referenced_set.begin(); it != user_table->referenced_set.end(); ++it) { @@ -2667,7 +2667,7 @@ prepare_inplace_alter_table_dict( if (UNIV_UNLIKELY(ctx->trx->fake_changes)) { trx_rollback_to_savepoint(ctx->trx, NULL); trx_free_for_mysql(ctx->trx); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + DBUG_RETURN(true); } trx_start_for_ddl(ctx->trx, TRX_DICT_OP_INDEX); @@ -3387,7 +3387,7 @@ ha_innobase::prepare_inplace_alter_table( DBUG_ASSERT(!srv_read_only_mode); if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) { - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + DBUG_RETURN(true); } MONITOR_ATOMIC_INC(MONITOR_PENDING_ALTER_TABLE); @@ -4462,7 +4462,7 @@ err_exit: rename_foreign: trx->op_info = "renaming column in SYS_FOREIGN_COLS"; - for (dict_foreign_set::iterator it = user_table->foreign_set.begin(); + for (dict_foreign_set::const_iterator it = user_table->foreign_set.begin(); it != user_table->foreign_set.end(); ++it) { @@ -4497,7 +4497,7 @@ rename_foreign: } } - for (dict_foreign_set::iterator it + for (dict_foreign_set::const_iterator it = user_table->referenced_set.begin(); it != user_table->referenced_set.end(); ++it) { diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index ebf991e6ff8..fffcf7dc4b8 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -2853,7 +2853,7 @@ row_discard_tablespace_foreign_key_checks( /* Check if the table is referenced by foreign key constraints from some other table (not the table itself) */ - dict_foreign_set::iterator it + dict_foreign_set::const_iterator it = std::find_if(table->referenced_set.begin(), table->referenced_set.end(), dict_foreign_different_tables());