Hi Chris,
Test changes look OK (tested on Solaris 10 x86_64). I'd prefer to have
one more check, though, see inline...
Christopher Powers wrote:
> #At file:///home/cpowers/work/dev/dev-02/mysql/
>
> 2957 Christopher Powers 2009-01-14
> Bug #42099 Falcon: Online ALTER add/drop primary key
>
> - Implemented online alter add/drop primary key
> - Improved index mapping between server and Falon
> -
> modified:
> mysql-test/suite/falcon/r/falcon_online_index.result
> mysql-test/suite/falcon/t/falcon_online_index.test
> storage/falcon/Database.cpp
> storage/falcon/Index.cpp
> storage/falcon/Statement.cpp
> storage/falcon/StorageTable.cpp
> storage/falcon/StorageTable.h
> storage/falcon/StorageTableShare.cpp
> storage/falcon/Table.cpp
> storage/falcon/Table.h
> storage/falcon/ha_falcon.cpp
> storage/falcon/ha_falcon.h
>
> per-file messages:
> mysql-test/suite/falcon/r/falcon_online_index.result
> Allow online add/drop primary key
> mysql-test/suite/falcon/t/falcon_online_index.test
> Allow online add/drop primary key
<snip>
> === modified file 'mysql-test/suite/falcon/r/falcon_online_index.result'
> --- a/mysql-test/suite/falcon/r/falcon_online_index.result 2008-10-15 06:12:14 +0000
> +++ b/mysql-test/suite/falcon/r/falcon_online_index.result 2009-01-14 18:30:01 +0000
> @@ -131,13 +131,9 @@ Table Non_unique Key_name Seq_in_index C
> t1 0 PRIMARY 1 a NULL 10 NULL NULL BTREE
> #-------- ONLINE: ALTER ADD/DROP PRIMARY KEY --------#
> ALTER ONLINE TABLE t1 DROP PRIMARY KEY;
> -ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 DROP
> PRIMARY KEY'
> -ALTER TABLE t1 DROP PRIMARY KEY;
> -ALTER ONLINE TABLE t1 ADD PRIMARY KEY (c);
> -ERROR 42000: This version of MySQL doesn't yet support 'ALTER ONLINE TABLE t1 ADD
> PRIMARY KEY (c)'
> SHOW INDEXES FROM t1;
>
> Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
> -ALTER TABLE t1 ADD PRIMARY KEY (a);
> +ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a);
I'd prefer to explicitly check that the primary key was added. That is,
check that you add something like this to the results if you do the test
change I have suggested below...
SHOW INDEXES FROM t1;
Table Non_unique Key_name Seq_in_index Column_name
Collation Cardinality Sub_part Packed Null
Index_type Comment Index_Comment
t1 0 PRIMARY 1 a NULL 10 NULL NULL
BTREE
> #-------- Test: UNIQUE --------#
> ALTER ONLINE TABLE t2 ADD UNIQUE INDEX ix_unique_c (c);
> EXPLAIN SELECT * FROM t2 WHERE c < 25 AND c > 20 ORDER BY c;
>
> === modified file 'mysql-test/suite/falcon/t/falcon_online_index.test'
> --- a/mysql-test/suite/falcon/t/falcon_online_index.test 2008-10-03 05:15:40 +0000
> +++ b/mysql-test/suite/falcon/t/falcon_online_index.test 2009-01-14 18:30:01 +0000
> @@ -194,16 +194,10 @@ SHOW INDEXES FROM t1;
>
> --echo #-------- ONLINE: ALTER ADD/DROP PRIMARY KEY --------#
>
> -# Adding/dropping PRIMARY KEY is not supposed to work ONLINE
> ---error ER_NOT_SUPPORTED_YET
> ALTER ONLINE TABLE t1 DROP PRIMARY KEY;
> -# Now drop primary key (offline) on 'a' temporarily in order to try adding one
> online
> -ALTER TABLE t1 DROP PRIMARY KEY;
> ---error ER_NOT_SUPPORTED_YET
> -ALTER ONLINE TABLE t1 ADD PRIMARY KEY (c);
> SHOW INDEXES FROM t1;
> # Re-set primary key on 'a'
> -ALTER TABLE t1 ADD PRIMARY KEY (a);
> +ALTER ONLINE TABLE t1 ADD PRIMARY KEY (a);
Here's where I'd like to see a check to verify that the index was
actually added, for example:
SHOW INDEXES FROM t1;
> ##
> ## Testing some statement variations using ADD/DROP INDEX
>
<snipped code changes>
That's all :)
--
John