3426 Dmitry Lenev 2011-11-16
WL#5534 Online ALTER, Phase 1.
Patch #50: Review fix.
Move check for potentially broken .FRMs to
is_inplace_alter_impossible().
modified:
sql/sql_table.cc
3425 Jon Olav Hauglid 2011-11-16
WL#5534 Online ALTER, Phase 1.
Patch #49:
Expanded test coverage - added regression test for
Bug#11750045 regarding ALTER IGNORE TABLE.
modified:
mysql-test/r/innodb_mysql_lock.result
mysql-test/t/innodb_mysql_lock.test
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2011-11-16 14:12:49 +0000
+++ b/sql/sql_table.cc 2011-11-16 15:29:56 +0000
@@ -5134,14 +5134,6 @@ static bool fill_alter_inplace_info(THD
At the moment we can't handle altering temporary tables without a copy.
We also test if OPTIMIZE TABLE was given and was mapped to alter table.
In that case we always do full copy.
-
- There was a bug prior to mysql-4.0.25. Number of null fields was
- calculated incorrectly. As a result frm and data files gets out of
- sync after fast alter table. There is no way to determine by which
- mysql version (in 4.0 and 4.1 branches) table was created, thus we
- disable fast alter table for all tables created by mysql versions
- prior to 5.0 branch.
- See BUG#6236.
*/
if (table->s->fields != alter_info->create_list.elements ||
table->s->db_type() != create_info->db_type ||
@@ -5156,7 +5148,6 @@ static bool fill_alter_inplace_info(THD
Alter_info::ADD_FOREIGN_KEY |
Alter_info::DROP_FOREIGN_KEY)) ||
order_num ||
- !table->s->mysql_version ||
(table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
{
/*
@@ -5171,8 +5162,7 @@ static bool fill_alter_inplace_info(THD
if (create_info->used_fields & HA_CREATE_USED_DEFAULT_CHARSET)
ha_alter_info->handler_flags|= Alter_inplace_info::SET_DEFAULT_CHARACTER_SET;
/* TODO check for ADD/DROP FOREIGN KEY */
- if (!table->s->mysql_version ||
- (table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar))
+ if (table->s->frm_version < FRM_VER_TRUE_VARCHAR && varchar)
ha_alter_info->handler_flags|= Alter_inplace_info::ALTER_COLUMN_TYPE;
}
/*
@@ -6043,6 +6033,18 @@ static bool is_inplace_alter_impossible(
DBUG_RETURN(true);
}
+ /*
+ There was a bug prior to mysql-4.0.25. Number of null fields was
+ calculated incorrectly. As a result frm and data files gets out of
+ sync after fast alter table. There is no way to determine by which
+ mysql version (in 4.0 and 4.1 branches) table was created, thus we
+ disable fast alter table for all tables created by mysql versions
+ prior to 5.0 branch.
+ See BUG#6236.
+ */
+ if (!table->s->mysql_version)
+ DBUG_RETURN(true);
+
DBUG_RETURN(false);
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-wl5534 branch (Dmitry.Lenev:3425 to 3426) WL#5534 | Dmitry Lenev | 17 Nov |