Commit c03341a0 authored by vdimov's avatar vdimov

branches/zip: Adjust the innodb test after change in behavior in MySQL

The change in behavior was introduced by this changeset:

  ------------------------------------------------------------
  revno: 3405
  revision-id: joro@sun.com-20100317141846-es0qyf5zcqb0hu1c
  parent: davi.arnaut@sun.com-20100309125156-z2c4uyqque49v61k
  committer: Georgi Kodinov <joro@sun.com>
  branch nick: B49838-5.1-bugteam
  timestamp: Wed 2010-03-17 16:18:46 +0200
  message:
    Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may corrupt
       definition at engine
    
    If a single ALTER TABLE contains both DROP INDEX and ADD INDEX using 
    the same index name (a.k.a. index modification) we need to disable 
    in-place alter table because we can't ask the storage engine to have 
    two copies of the index with the same name even temporarily (if we 
    first do the ADD INDEX and then DROP INDEX) and we can't modify 
    indexes that are needed by e.g. foreign keys if we first do 
    DROP INDEX and then ADD INDEX.
    Fixed the problem by disabling in-place ALTER TABLE for these cases.
  modified:
    mysql-test/r/innodb_mysql.result sp1f-innodb_mysql.result-20060426055153-bychbbfnqtvmvrwccwhn24i6yi46uqjv
    mysql-test/t/innodb_mysql.test sp1f-innodb_mysql.test-20060816102624-6ymo37d3nyhvbqyzqn5ohsfuydwo426k
    sql/sql_table.cc               sp1f-sql_table.cc-19700101030959-tzdkvgigezpuaxnldqh3fx2h7h2ggslu
parent c7020fd5
......@@ -692,7 +692,6 @@ select count(*) from t1 where sca_pic is null;
count(*)
2
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
ERROR 42000: Incorrect index name 'sca_pic'
alter table t1 drop index sca_pic;
alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
......@@ -1753,7 +1752,7 @@ variable_value - @innodb_rows_deleted_orig
71
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
variable_value - @innodb_rows_inserted_orig
1084
1087
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
variable_value - @innodb_rows_updated_orig
885
......
......@@ -428,7 +428,9 @@ select count(*) from t1 where sca_code = 'PD';
select count(*) from t1 where sca_code <= 'PD';
select count(*) from t1 where sca_pic is null;
# this should be fixed by MySQL (see Bug #51451)
--error ER_WRONG_NAME_FOR_INDEX
# now that http://bugs.mysql.com/49838 is fixed the following ALTER does
# copy the table instead of failing
# --error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
alter table t1 drop index sca_pic;
alter table t1 add index sca_pic (cat_code, sca_pic);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment