Loading mysql-test/r/partition.result +3 −0 Original line number Diff line number Diff line Loading @@ -908,5 +908,8 @@ 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 CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; DROP TABLE t1; End of 5.1 tests mysql-test/t/partition.test +8 −0 Original line number Diff line number Diff line Loading @@ -1034,4 +1034,12 @@ ALTER TABLE t1 OPTIMIZE PARTITION p0; SHOW TABLE STATUS; DROP TABLE t1; # # BUG 19502: ENABLE/DISABLE Keys don't work for partitioned tables # CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; DROP TABLE t1; --echo End of 5.1 tests sql/ha_partition.cc +76 −0 Original line number Diff line number Diff line Loading @@ -5322,6 +5322,82 @@ void ha_partition::init_table_handle_for_HANDLER() } /**************************************************************************** MODULE enable/disable indexes ****************************************************************************/ /* Disable indexes for a while SYNOPSIS disable_indexes() mode Mode RETURN VALUES 0 Success != 0 Error */ int ha_partition::disable_indexes(uint mode) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->disable_indexes(mode))) break; } return error; } /* Enable indexes again SYNOPSIS enable_indexes() mode Mode RETURN VALUES 0 Success != 0 Error */ int ha_partition::enable_indexes(uint mode) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->enable_indexes(mode))) break; } return error; } /* Check if indexes are disabled SYNOPSIS indexes_are_disabled() RETURN VALUES 0 Indexes are enabled != 0 Indexes are disabled */ int ha_partition::indexes_are_disabled(void) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->indexes_are_disabled())) break; } return error; } /**************************************************************************** MODULE Partition Share ****************************************************************************/ Loading sql/ha_partition.h +4 −3 Original line number Diff line number Diff line Loading @@ -938,17 +938,18 @@ class ha_partition :public handler virtual uint checksum() const; virtual bool is_crashed() const; virtual bool auto_repair() const; */ /* ------------------------------------------------------------------------- MODULE enable/disable indexes ------------------------------------------------------------------------- Enable/Disable Indexes are not supported currently (Heap, MyISAM) This means that the following methods are not implemented: Enable/Disable Indexes are only supported by HEAP and MyISAM. ------------------------------------------------------------------------- */ virtual int disable_indexes(uint mode); virtual int enable_indexes(uint mode); virtual int indexes_are_disabled(void); */ /* ------------------------------------------------------------------------- Loading Loading
mysql-test/r/partition.result +3 −0 Original line number Diff line number Diff line Loading @@ -908,5 +908,8 @@ 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 CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; DROP TABLE t1; End of 5.1 tests
mysql-test/t/partition.test +8 −0 Original line number Diff line number Diff line Loading @@ -1034,4 +1034,12 @@ ALTER TABLE t1 OPTIMIZE PARTITION p0; SHOW TABLE STATUS; DROP TABLE t1; # # BUG 19502: ENABLE/DISABLE Keys don't work for partitioned tables # CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; DROP TABLE t1; --echo End of 5.1 tests
sql/ha_partition.cc +76 −0 Original line number Diff line number Diff line Loading @@ -5322,6 +5322,82 @@ void ha_partition::init_table_handle_for_HANDLER() } /**************************************************************************** MODULE enable/disable indexes ****************************************************************************/ /* Disable indexes for a while SYNOPSIS disable_indexes() mode Mode RETURN VALUES 0 Success != 0 Error */ int ha_partition::disable_indexes(uint mode) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->disable_indexes(mode))) break; } return error; } /* Enable indexes again SYNOPSIS enable_indexes() mode Mode RETURN VALUES 0 Success != 0 Error */ int ha_partition::enable_indexes(uint mode) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->enable_indexes(mode))) break; } return error; } /* Check if indexes are disabled SYNOPSIS indexes_are_disabled() RETURN VALUES 0 Indexes are enabled != 0 Indexes are disabled */ int ha_partition::indexes_are_disabled(void) { handler **file; int error= 0; for (file= m_file; *file; file++) { if ((error= (*file)->indexes_are_disabled())) break; } return error; } /**************************************************************************** MODULE Partition Share ****************************************************************************/ Loading
sql/ha_partition.h +4 −3 Original line number Diff line number Diff line Loading @@ -938,17 +938,18 @@ class ha_partition :public handler virtual uint checksum() const; virtual bool is_crashed() const; virtual bool auto_repair() const; */ /* ------------------------------------------------------------------------- MODULE enable/disable indexes ------------------------------------------------------------------------- Enable/Disable Indexes are not supported currently (Heap, MyISAM) This means that the following methods are not implemented: Enable/Disable Indexes are only supported by HEAP and MyISAM. ------------------------------------------------------------------------- */ virtual int disable_indexes(uint mode); virtual int enable_indexes(uint mode); virtual int indexes_are_disabled(void); */ /* ------------------------------------------------------------------------- Loading