3471 Jon Olav Hauglid 2012-01-26
WL#5534 Online ALTER, Phase 1.
Patch #78: More review comments.
modified:
mysql-test/suite/innodb/r/innodb-index.result
sql/sql_table.cc
3470 Jon Olav Hauglid 2012-01-26 [merge]
Merge from mysql-trunk to mysql-trunk-wl5534
No conflicts
added:
mysql-test/suite/sys_vars/r/stored_program_cache_basic.result
mysql-test/suite/sys_vars/t/stored_program_cache_basic.test
renamed:
mysql-test/suite/sys_vars/r/innodb_sort_buf_size_basic.result => mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result
mysql-test/suite/sys_vars/t/innodb_sort_buf_size_basic.test => mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test
modified:
cmake/build_configurations/mysql_release.cmake
include/m_ctype.h
mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
mysql-test/include/have_example_plugin.inc
mysql-test/include/have_semisync_plugin.inc
mysql-test/include/have_simple_parser.inc
mysql-test/include/have_udf.inc
mysql-test/include/order_by.inc
mysql-test/include/range.inc
mysql-test/include/show_slave_status.inc
mysql-test/include/wait_for_ndb_to_binlog.inc
mysql-test/mysql-test-run.pl
mysql-test/r/bigint.result
mysql-test/r/ctype_utf8.result
mysql-test/r/date_formats.result
mysql-test/r/func_in_icp.result
mysql-test/r/func_in_icp_mrr.result
mysql-test/r/func_in_mrr.result
mysql-test/r/func_in_mrr_cost.result
mysql-test/r/func_in_none.result
mysql-test/r/func_str.result
mysql-test/r/func_time.result
mysql-test/r/innodb_icp.result
mysql-test/r/innodb_icp_none.result
mysql-test/r/innodb_mrr.result
mysql-test/r/innodb_mrr_cost.result
mysql-test/r/innodb_mrr_cost_icp.result
mysql-test/r/innodb_mrr_icp.result
mysql-test/r/innodb_mrr_none.result
mysql-test/r/mysqld--help-notwin.result
mysql-test/r/mysqld--help-win.result
mysql-test/r/optimizer_debug_sync.result
mysql-test/r/order_by_icp_mrr.result
mysql-test/r/order_by_none.result
mysql-test/r/partition_binlog_stmt.result
mysql-test/r/partition_explicit_prune.result
mysql-test/r/plugin.result
mysql-test/r/range_all.result
mysql-test/r/range_icp.result
mysql-test/r/range_icp_mrr.result
mysql-test/r/range_mrr.result
mysql-test/r/range_mrr_cost.result
mysql-test/r/range_none.result
mysql-test/r/temporal_literal.result
mysql-test/r/type_date.result
mysql-test/r/type_temporal_fractional.result
mysql-test/r/type_temporal_upgrade.result
mysql-test/r/type_time.result
mysql-test/r/view.result
mysql-test/r/xa.result
mysql-test/suite/parts/r/partition-dml-1-9-innodb.result
mysql-test/suite/parts/r/partition-dml-1-9-myisam.result
mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
mysql-test/suite/rpl/r/rpl_log_pos.result
mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
mysql-test/suite/rpl/r/rpl_packet.result
mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
mysql-test/suite/sys_vars/r/innodb_undo_logs_basic.result
mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test
mysql-test/t/bigint.test
mysql-test/t/ctype_utf8.test
mysql-test/t/date_formats.test
mysql-test/t/func_str.test
mysql-test/t/func_time.test
mysql-test/t/mysql_embedded.test
mysql-test/t/optimizer_debug_sync.test
mysql-test/t/partition_binlog_stmt.test
mysql-test/t/partition_explicit_prune.test
mysql-test/t/plugin.test
mysql-test/t/temporal_literal.test
mysql-test/t/type_date.test
mysql-test/t/type_temporal_fractional.test
mysql-test/t/type_temporal_upgrade.test
mysql-test/t/type_time.test
mysql-test/t/udf_skip_grants-master.opt
mysql-test/t/view.test
mysql-test/t/xa.test
mysys/charset-def.c
sql/debug_sync.cc
sql/handler.cc
sql/handler.h
sql/item.cc
sql/item_cmpfunc.cc
sql/item_timefunc.cc
sql/mysqld.cc
sql/mysqld.h
sql/opt_explain.cc
sql/opt_range.cc
sql/records.cc
sql/rpl_master.cc
sql/share/errmsg-utf8.txt
sql/sp_cache.cc
sql/sp_cache.h
sql/sql_executor.cc
sql/sql_lex.cc
sql/sql_parse.cc
sql/sql_prepare.cc
sql/sql_select.cc
sql/sql_tmp_table.cc
sql/sql_view.cc
sql/sys_vars.cc
storage/example/ha_example.cc
storage/innobase/btr/btr0btr.cc
storage/innobase/btr/btr0cur.cc
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0dblwr.cc
storage/innobase/buf/buf0flu.cc
storage/innobase/data/data0data.cc
storage/innobase/dict/dict0load.cc
storage/innobase/dict/dict0stats.cc
storage/innobase/fts/fts0fts.cc
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/i_s.cc
storage/innobase/ibuf/ibuf0ibuf.cc
storage/innobase/include/btr0btr.h
storage/innobase/include/buf0flu.h
storage/innobase/include/data0data.h
storage/innobase/include/data0data.ic
storage/innobase/include/mtr0log.ic
storage/innobase/lock/lock0lock.cc
storage/innobase/os/os0file.cc
storage/innobase/page/page0page.cc
storage/innobase/row/row0ins.cc
storage/innobase/row/row0sel.cc
storage/innobase/row/row0umod.cc
storage/innobase/row/row0upd.cc
storage/innobase/srv/srv0srv.cc
storage/innobase/trx/trx0purge.cc
storage/innobase/trx/trx0rec.cc
storage/innobase/trx/trx0trx.cc
storage/innobase/ut/ut0crc32.cc
storage/perfschema/ha_perfschema.cc
storage/perfschema/pfs_engine_table.cc
storage/perfschema/pfs_engine_table.h
storage/perfschema/pfs_instr_class.cc
storage/perfschema/pfs_instr_class.h
storage/perfschema/pfs_server.cc
storage/perfschema/table_esgs_by_account_by_event_name.cc
storage/perfschema/table_esgs_by_account_by_event_name.h
storage/perfschema/table_esgs_by_host_by_event_name.cc
storage/perfschema/table_esgs_by_host_by_event_name.h
storage/perfschema/table_esgs_by_thread_by_event_name.cc
storage/perfschema/table_esgs_by_thread_by_event_name.h
storage/perfschema/table_esgs_by_user_by_event_name.cc
storage/perfschema/table_esgs_by_user_by_event_name.h
storage/perfschema/table_esgs_global_by_event_name.cc
storage/perfschema/table_esgs_global_by_event_name.h
storage/perfschema/table_esms_by_account_by_event_name.cc
storage/perfschema/table_esms_by_account_by_event_name.h
storage/perfschema/table_esms_by_host_by_event_name.cc
storage/perfschema/table_esms_by_host_by_event_name.h
storage/perfschema/table_esms_by_thread_by_event_name.cc
storage/perfschema/table_esms_by_thread_by_event_name.h
storage/perfschema/table_esms_by_user_by_event_name.cc
storage/perfschema/table_esms_by_user_by_event_name.h
storage/perfschema/table_esms_global_by_event_name.cc
storage/perfschema/table_esms_global_by_event_name.h
storage/perfschema/table_events_stages.cc
storage/perfschema/table_events_stages.h
storage/perfschema/table_events_statements.cc
storage/perfschema/table_events_statements.h
storage/perfschema/table_events_waits.cc
storage/perfschema/table_events_waits_summary.cc
storage/perfschema/table_ews_by_account_by_event_name.cc
storage/perfschema/table_ews_by_host_by_event_name.cc
storage/perfschema/table_ews_by_thread_by_event_name.cc
storage/perfschema/table_ews_by_user_by_event_name.cc
storage/perfschema/table_ews_global_by_event_name.cc
storage/perfschema/table_tiws_by_index_usage.cc
storage/perfschema/table_tiws_by_index_usage.h
storage/perfschema/table_tiws_by_table.cc
storage/perfschema/table_tiws_by_table.h
storage/perfschema/table_tlws_by_table.cc
storage/perfschema/table_tlws_by_table.h
strings/ctype-ucs2.c
strings/ctype-utf8.c
strings/dtoa.c
mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result
mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test
=== modified file 'mysql-test/suite/innodb/r/innodb-index.result'
--- a/mysql-test/suite/innodb/r/innodb-index.result 2011-12-12 12:06:08 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index.result 2012-01-26 16:00:10 +0000
@@ -115,8 +115,8 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`),
UNIQUE KEY `c` (`c`),
KEY `d2` (`d`),
- KEY `d` (`d`),
- KEY `b` (`b`)
+ KEY `b` (`b`),
+ KEY `d` (`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values(6,1,'ggg','ggg');
select * from t1;
@@ -166,8 +166,8 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`a`),
UNIQUE KEY `c` (`c`),
KEY `d2` (`d`),
- KEY `d` (`d`),
- KEY `b` (`b`)
+ KEY `b` (`b`),
+ KEY `d` (`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2012-01-26 12:23:27 +0000
+++ b/sql/sql_table.cc 2012-01-26 16:00:10 +0000
@@ -4635,25 +4635,23 @@ make_unique_key_name(const char *field_n
****************************************************************************/
-/*
+/**
Rename a table.
- SYNOPSIS
- mysql_rename_table()
- base The handlerton handle.
- old_db The old database name.
- old_name The old table name.
- new_db The new database name.
- new_name The new table name.
- flags flags for build_table_filename().
- FN_FROM_IS_TMP old_name is temporary.
- FN_TO_IS_TMP new_name is temporary.
- NO_FRM_RENAME Don't rename the FRM file
- but only the table in the storage engine.
-
- RETURN
- FALSE OK
- TRUE Error
+ @param base The handlerton handle.
+ @param old_db The old database name.
+ @param old_name The old table name.
+ @param new_db The new database name.
+ @param new_name The new table name.
+ @param flags flags
+ FN_FROM_IS_TMP old_name is temporary.
+ FN_TO_IS_TMP new_name is temporary.
+ NO_FRM_RENAME Don't rename the FRM file
+ but only the table in the storage engine.
+ NO_HA_TABLE Don't remove table in engine.
+
+ @return false OK
+ @return true Error
*/
bool
@@ -4701,7 +4699,7 @@ mysql_rename_table(handlerton *base, con
to_base= lc_to;
}
- if (flags & FRM_ONLY)
+ if (flags & NO_HA_TABLE)
{
if (rename_file_ext(from,to,reg_ext))
error= my_errno;
@@ -5913,7 +5911,7 @@ static bool mysql_inplace_alter_table(TH
*/
if (mysql_rename_table(db_type, alter_ctx->new_db, alter_ctx->tmp_name,
alter_ctx->db, alter_ctx->table_name,
- FN_FROM_IS_TMP | FRM_ONLY))
+ FN_FROM_IS_TMP | NO_HA_TABLE))
{
// Since changes were done in-place, we can't revert them.
(void) quick_rm_table(thd, db_type,
@@ -7062,20 +7060,30 @@ bool mysql_alter_table(THD *thd,char *ne
true, false)))
goto err_new_table_cleanup;
- enum_alter_inplace_result inplace_supported;
- if (alter_info->flags == 0)
- // No-op ALTER, no need to call handler API functions.
+ if (ha_alter_info.handler_flags == 0)
+ {
+ /*
+ No-op ALTER, no need to call handler API functions.
+
+ If this code path is entered for an ALTER statement that
+ should not be a real no-op, new handler flags should be added
+ and fill_alter_inplace_info() adjusted.
+
+ Note that we can end up here if an ALTER statement has clauses
+ that cancel each other out (e.g. ADD/DROP identically index).
+
+ Also note that we ignore the LOCK clause here.
+ */
+ close_temporary_table(thd, altered_table, true, false);
goto end_inplace;
- else if (ha_alter_info.handler_flags == 0)
- // Unrecognized ALTER command, do copy for safety
- inplace_supported= HA_ALTER_INPLACE_NOT_SUPPORTED;
- else
- // Ask storage engine whether to use copy or in-place
- inplace_supported=
- table->file->check_if_supported_inplace_alter(altered_table,
- create_info,
- alter_info,
- &ha_alter_info);
+ }
+
+ // Ask storage engine whether to use copy or in-place
+ enum_alter_inplace_result inplace_supported=
+ table->file->check_if_supported_inplace_alter(altered_table,
+ create_info,
+ alter_info,
+ &ha_alter_info);
switch (inplace_supported) {
case HA_ALTER_INPLACE_EXCLUSIVE_LOCK:
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl5534 branch (jon.hauglid:3470 to 3471) WL#5534 | Jon Olav Hauglid | 30 Jan |