Merge c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19502
into c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19010 sql/ha_partition.cc: Auto merged mysql-test/r/partition.result: manual merge mysql-test/t/partition.test: manual merge
This commit is contained in:
commit
b6bb92a25a
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
****************************************************************************/
|
||||
|
@ -938,17 +938,18 @@ public:
|
||||
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…
x
Reference in New Issue
Block a user