Browse Source

Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION

Problem was that it did not work with corrupted/crashed tables.

Solution is to disable these commands until WL#4176 is completed


mysql-test/r/partition.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/inc/partition_alter4.inc:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  copy-paste error, changed from REBUILT to REPAIR, as the heading says
mysql-test/suite/parts/r/partition_alter1_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter1_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter2_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_engine_innodb.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/r/partition_engine_myisam.result:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Test result
mysql-test/suite/parts/t/disabled.def:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Disabled test since the tested feature is not longer supported
mysql-test/t/partition.test:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  OPTIMIZE PARTITION is not longer supported, waiting for WL#4176
sql/ha_partition.cc:
  Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
  
  Problem was that it did not work with corrupted/crashed tables.
  
  Solution is to disable these commands until WL#4176 is completed
  (returning HA_ADMIN_NOT_IMPLEMENTED and
  #ifdef'ed the non-reachable code)
pull/374/head
unknown 18 years ago
parent
commit
6a15453640
  1. 6
      mysql-test/r/partition.result
  2. 16
      mysql-test/suite/parts/inc/partition_alter4.inc
  3. 1008
      mysql-test/suite/parts/r/partition_alter1_innodb.result
  4. 512
      mysql-test/suite/parts/r/partition_alter1_myisam.result
  5. 1440
      mysql-test/suite/parts/r/partition_alter2_innodb.result
  6. 1152
      mysql-test/suite/parts/r/partition_alter2_myisam.result
  7. 474
      mysql-test/suite/parts/r/partition_basic_innodb.result
  8. 376
      mysql-test/suite/parts/r/partition_basic_myisam.result
  9. 84
      mysql-test/suite/parts/r/partition_engine_innodb.result
  10. 112
      mysql-test/suite/parts/r/partition_engine_myisam.result
  11. 2
      mysql-test/suite/parts/t/disabled.def
  12. 12
      mysql-test/t/partition.test
  13. 15
      sql/ha_partition.cc
  14. 14
      sql/sql_partition.cc

6
mysql-test/r/partition.result

@ -342,7 +342,7 @@ PARTITION BY LIST (a)
(PARTITION x1 VALUES IN (10), PARTITION x2 VALUES IN (20));
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
drop table t1;
create table t1
(a int)
@ -1045,9 +1045,7 @@ SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 14 14 0 0 7 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ALTER TABLE t1 OPTIMIZE PARTITION p0;
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 1 7 7 0 1024 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ERROR 42000: The storage engine for the table doesn't support optimize partition
DROP TABLE t1;
CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a);
ALTER TABLE t1 DISABLE KEYS;

16
mysql-test/suite/parts/inc/partition_alter4.inc

@ -83,17 +83,17 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
--echo #------------------------------------------------------------------------
--echo # 5 ALTER ... REPAIR PARTITION
--echo #------------------------------------------------------------------------
--echo # 5.1 ALTER ... REBUILD PARTITION part_1;
let $alter= ALTER TABLE t1 REBUILD PARTITION part_1;
--echo # 5.1 ALTER ... REPAIR PARTITION part_1;
let $alter= ALTER TABLE t1 REPAIR PARTITION part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 5.2 ALTER ... REBUILD PARTITION part_1,part_2;
let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2;
--echo # 5.2 ALTER ... REPAIR PARTITION part_1,part_2;
let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2;
--source suite/parts/inc/partition_alter_41.inc
--echo # 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10;
--echo # 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
--source suite/parts/inc/partition_alter_41.inc
--echo # 5.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
--echo # 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------

1008
mysql-test/suite/parts/r/partition_alter1_innodb.result
File diff suppressed because it is too large
View File

512
mysql-test/suite/parts/r/partition_alter1_myisam.result
File diff suppressed because it is too large
View File

1440
mysql-test/suite/parts/r/partition_alter2_innodb.result
File diff suppressed because it is too large
View File

1152
mysql-test/suite/parts/r/partition_alter2_myisam.result
File diff suppressed because it is too large
View File

474
mysql-test/suite/parts/r/partition_basic_innodb.result
File diff suppressed because it is too large
View File

376
mysql-test/suite/parts/r/partition_basic_myisam.result
File diff suppressed because it is too large
View File

84
mysql-test/suite/parts/r/partition_engine_innodb.result

@ -473,16 +473,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -927,16 +927,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -1380,16 +1380,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -1834,16 +1834,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -2284,16 +2284,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -2737,16 +2737,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -3190,16 +3190,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -3647,16 +3647,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -4100,16 +4100,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -4555,16 +4555,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -5008,16 +5008,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -5463,16 +5463,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -5914,16 +5914,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
@ -6363,16 +6363,16 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text

112
mysql-test/suite/parts/r/partition_engine_myisam.result

@ -483,20 +483,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -947,20 +947,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -1414,20 +1414,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -1878,20 +1878,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -2338,20 +2338,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -2805,20 +2805,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -3272,20 +3272,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -3743,20 +3743,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -4210,20 +4210,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -4675,20 +4675,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -5142,20 +5142,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -5611,20 +5611,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -6070,20 +6070,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;
@ -6529,20 +6529,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check note The storage engine for the table doesn't support check
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t1 optimize note The storage engine for the table doesn't support optimize
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t1 repair note The storage engine for the table doesn't support repair
# check layout success: 1
TRUNCATE t1;

2
mysql-test/suite/parts/t/disabled.def

@ -16,3 +16,5 @@ partition_sessions : needs system_3_init.inc
partition_engine_ndb : cannot create t1
part_supported_sql_func_ndb : cannot create t1
rpl_ndb_dd_partitions : cannot create t1
partition_alter4_myisam : Bug#20129 / WL#4176
partition_alter4_innodb : Bug#20129 / WL#4176

12
mysql-test/t/partition.test

@ -35,7 +35,7 @@ PARTITION `p5` VALUES LESS THAN (2010)
COMMENT 'APSTART \' APEND'
);
#--exec sed 's/APSTART \\/APSTART /' var/master-data/test/t1.frm > tmpt1.frm && mv tmpt1.frm var/master-data/test/t1.frm
#--error 1064
#--error ER_PARSE_ERROR
SELECT * FROM t1 LIMIT 1;
DROP TABLE t1;
@ -1208,9 +1208,11 @@ SHOW TABLE STATUS;
DELETE from t1 where a = 1;
--replace_column 9 0 12 NULL 13 NULL 14 NULL
SHOW TABLE STATUS;
# restore this after WL#4176 is completed
-- error ER_CHECK_NOT_IMPLEMENTED
ALTER TABLE t1 OPTIMIZE PARTITION p0;
--replace_column 12 NULL 13 NULL 14 NULL
SHOW TABLE STATUS;
#--replace_column 12 NULL 13 NULL 14 NULL
#SHOW TABLE STATUS;
DROP TABLE t1;
#
@ -1568,9 +1570,9 @@ PARTITION BY RANGE (a) (
PARTITION p1 VALUES LESS THAN (10),
PARTITION p2 VALUES LESS THAN (20)
);
--error 1064
--error ER_PARSE_ERROR
ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED;
--error 1064
--error ER_PARSE_ERROR
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
DROP TABLE t1;

15
sql/ha_partition.cc

@ -1035,6 +1035,13 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
DBUG_ENTER("handle_opt_part");
DBUG_PRINT("enter", ("flag = %u", flag));
/*
TODO:
Rewrite the code for ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION WL4176
*/
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
#ifdef WL4176_IS_DONE
if (flag == OPTIMIZE_PARTS)
error= file->ha_optimize(thd, check_opt);
else if (flag == ANALYZE_PARTS)
@ -1051,6 +1058,7 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
if (error == HA_ADMIN_ALREADY_DONE)
error= 0;
DBUG_RETURN(error);
#endif
}
@ -1080,6 +1088,12 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
DBUG_ENTER("ha_partition::handle_opt_partitions");
DBUG_PRINT("enter", ("all_parts %u, flag= %u", all_parts, flag));
/*
TODO:
Rewrite the code for ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION WL4176
*/
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
#ifdef WL4176_IS_DONE
do
{
partition_element *part_elem= part_it++;
@ -1110,6 +1124,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
}
} while (++i < no_parts);
DBUG_RETURN(FALSE);
#endif
}
/*

14
sql/sql_partition.cc

@ -6113,7 +6113,19 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
((alter_info->flags & ALTER_REPAIR_PARTITION) &&
(error= table->file->ha_repair_partitions(thd))))
{
table->file->print_error(error, MYF(0));
if (error == HA_ADMIN_NOT_IMPLEMENTED) {
if (alter_info->flags & ALTER_OPTIMIZE_PARTITION)
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "optimize partition");
else if (alter_info->flags & ALTER_ANALYZE_PARTITION)
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "analyze partition");
else if (alter_info->flags & ALTER_CHECK_PARTITION)
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "check partition");
else if (alter_info->flags & ALTER_REPAIR_PARTITION)
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "repair partition");
else
table->file->print_error(error, MYF(0));
} else
table->file->print_error(error, MYF(0));
goto err;
}
}

Loading…
Cancel
Save