From 18851d9ea771499f5e84267d2ed5c16768942f86 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Nov 2007 11:11:22 +0400 Subject: [PATCH 1/2] Fix for bug #30495: optimize table t1,t2,t3 extended errors Problem: we have CHECK TABLE options allowed (by accident?) for ANALYZE/OPTIMIZE TABLE. Fix: disable them. Note: it might require additional fixes in 5.1/6.0 mysql-test/r/analyze.result: Fix for bug #30495: optimize table t1,t2,t3 extended errors - test result. mysql-test/t/analyze.test: Fix for bug #30495: optimize table t1,t2,t3 extended errors - test case. sql/sql_yacc.yy: Fix for bug #30495: optimize table t1,t2,t3 extended errors - opt_mi_check_type (CHECK TABLE options) removed from analyze: and optimize: --- mysql-test/r/analyze.result | 8 ++++++++ mysql-test/t/analyze.test | 14 +++++++++++++- sql/sql_yacc.yy | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result index 7b476c3cca2..c3dbb846402 100644 --- a/mysql-test/r/analyze.result +++ b/mysql-test/r/analyze.result @@ -56,3 +56,11 @@ show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 a 1 a A 5 NULL NULL YES BTREE drop table t1; +End of 4.1 tests +create table t1(a int); +analyze table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +optimize table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test index 7c9830bb468..0903db1eca4 100644 --- a/mysql-test/t/analyze.test +++ b/mysql-test/t/analyze.test @@ -72,4 +72,16 @@ analyze table t1; show index from t1; drop table t1; -# End of 4.1 tests +--echo End of 4.1 tests + +# +# Bug #30495: optimize table t1,t2,t3 extended errors +# +create table t1(a int); +--error 1064 +analyze table t1 extended; +--error 1064 +optimize table t1 extended; +drop table t1; + +--echo End of 5.0 tests diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3401bf739b3..92b8b96378f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3921,7 +3921,7 @@ analyze: lex->no_write_to_binlog= $2; lex->check_opt.init(); } - table_list opt_mi_check_type + table_list {} ; @@ -3966,7 +3966,7 @@ optimize: lex->no_write_to_binlog= $2; lex->check_opt.init(); } - table_list opt_mi_check_type + table_list {} ; From 42853d172c45dc50eaea6b9a4563e96e5515f5bf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Nov 2007 12:28:08 +0400 Subject: [PATCH 2/2] after-merge fix: - archive test/result adjusted. - OPTIMIZE/ANALYZE PARTITION EXTENDED test case added. mysql-test/r/archive.result: after-merge fix: - archive test/result adjusted. mysql-test/r/partition.result: after-merge fix: - test case added. mysql-test/t/archive.test: after-merge fix: - archive test/result adjusted. mysql-test/t/partition.test: after-merge fix: - test case added. --- mysql-test/r/archive.result | 2 +- mysql-test/r/partition.result | 10 ++++++++++ mysql-test/t/archive.test | 2 +- mysql-test/t/partition.test | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 77d3cba63d5..edd49988a5f 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -2619,7 +2619,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6 INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -OPTIMIZE TABLE t2 EXTENDED; +OPTIMIZE TABLE t2; Table Op Msg_type Msg_text test.t2 optimize status OK SELECT * FROM t2; diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 2b8c79b4563..7c25e948d6c 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1297,4 +1297,14 @@ create table t1 partition by key(s1) partitions 3; insert into t1 values (null,null); drop table t1; +CREATE TABLE t1(a int) +PARTITION BY RANGE (a) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +); +ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1 +ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index f8eff10e30a..a1158dbfd3b 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1320,7 +1320,7 @@ SELECT * FROM t2; INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W'); INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring',''); INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily',''); -OPTIMIZE TABLE t2 EXTENDED; +OPTIMIZE TABLE t2; SELECT * FROM t2; REPAIR TABLE t2; SELECT * FROM t2; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 68eff608879..f2fed63c833 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1541,4 +1541,19 @@ while ($cnt) --enable_query_log drop table t1; + +# +# Bug #30495: optimize table t1,t2,t3 extended errors +# +CREATE TABLE t1(a int) +PARTITION BY RANGE (a) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +); +--error 1064 +ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; +--error 1064 +ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; +DROP TABLE t1; + --echo End of 5.1 tests