diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-04-25 15:06:40 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-04-25 15:06:40 +0400 |
commit | 6595861f5802dad8997fcaa6466d0ca1130d4df7 (patch) | |
tree | 04ff8238e674eda09018f800a52c457ae979ebd8 /sql/sql_table.cc | |
parent | 20c9177518c3bb07c74df9fa8e25ba46af60f484 (diff) | |
download | mariadb-git-6595861f5802dad8997fcaa6466d0ca1130d4df7.tar.gz |
Fix for bug#50946: fast index creation still seems to copy the table
Problem: ALTER TABLE ADD INDEX may lead to table copying if there's
numeric field(s) with non-default display width modificator specified.
Fix: compare numeric field's storage lenghts when we decide whether
they can be considered 'equal' for table alteration purposes.
mysql-test/r/error_simulation.result:
Fix for bug#50946: fast index creation still seems to copy the table
- test result.
mysql-test/t/error_simulation.test:
Fix for bug#50946: fast index creation still seems to copy the table
- test case.
sql/field.cc:
Fix for bug#50946: fast index creation still seems to copy the table
- check numeric field's pack lengths instead of it's display lenghts
comparing fields equality for table alteration purposes.
sql/sql_table.cc:
Fix for bug#50946: fast index creation still seems to copy the table
- check compare_tables() result for testing purposes.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ad72cab664e..1101be67d5e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6922,6 +6922,13 @@ view_err: &candidate_key_count)) goto err; + DBUG_EXECUTE_IF("alter_table_only_metadata_change", { + if (need_copy_table_res != ALTER_TABLE_METADATA_ONLY) + goto err; }); + DBUG_EXECUTE_IF("alter_table_only_index_change", { + if (need_copy_table_res != ALTER_TABLE_INDEX_CHANGED) + goto err; }); + if (need_copy_table == ALTER_TABLE_METADATA_ONLY) need_copy_table= need_copy_table_res; } |