post-fix for the merge of "Bug#16216513 INPLACE ALTER DISABLED FOR PARTITIONED TABLES"
make this innodb-only patch work for other engines as well
This commit is contained in:
parent
9927b36e87
commit
99027efd14
@ -8199,6 +8199,7 @@ ha_partition::check_if_supported_inplace_alter(TABLE *altered_table,
|
|||||||
for (index= 0; index <= m_tot_parts; index++)
|
for (index= 0; index <= m_tot_parts; index++)
|
||||||
part_inplace_ctx->handler_ctx_array[index]= NULL;
|
part_inplace_ctx->handler_ctx_array[index]= NULL;
|
||||||
|
|
||||||
|
ha_alter_info->handler_flags |= Alter_inplace_info::ALTER_PARTITIONED;
|
||||||
for (index= 0; index < m_tot_parts; index++)
|
for (index= 0; index < m_tot_parts; index++)
|
||||||
{
|
{
|
||||||
enum_alter_inplace_result p_result=
|
enum_alter_inplace_result p_result=
|
||||||
|
@ -1790,6 +1790,9 @@ public:
|
|||||||
// Virtual columns changed
|
// Virtual columns changed
|
||||||
static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1L << 30;
|
static const HA_ALTER_FLAGS ALTER_COLUMN_VCOL = 1L << 30;
|
||||||
|
|
||||||
|
// ALTER TABLE for a partitioned table
|
||||||
|
static const HA_ALTER_FLAGS ALTER_PARTITIONED = 1L << 31;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Create options (like MAX_ROWS) for the new version of table.
|
Create options (like MAX_ROWS) for the new version of table.
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_DATA
|
|||||||
/** Operations for altering a table that InnoDB does not care about */
|
/** Operations for altering a table that InnoDB does not care about */
|
||||||
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
|
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
|
||||||
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
|
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
|
||||||
|
| Alter_inplace_info::ALTER_PARTITIONED
|
||||||
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
|
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
|
||||||
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
|
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
|
||||||
| Alter_inplace_info::ALTER_RENAME;
|
| Alter_inplace_info::ALTER_RENAME;
|
||||||
|
@ -13,13 +13,13 @@ foo CREATE TABLE `foo` (
|
|||||||
/*!50100 PARTITION BY HASH (a)
|
/*!50100 PARTITION BY HASH (a)
|
||||||
PARTITIONS 2 */
|
PARTITIONS 2 */
|
||||||
ALTER TABLE foo ADD KEY(b);
|
ALTER TABLE foo ADD KEY(b);
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MariaDB version
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
foo CREATE TABLE `foo` (
|
foo CREATE TABLE `foo` (
|
||||||
`a` int(11) NOT NULL DEFAULT '0',
|
`a` int(11) NOT NULL DEFAULT '0',
|
||||||
`b` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`a`),
|
PRIMARY KEY (`a`)
|
||||||
KEY `b` (`b`)
|
|
||||||
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
|
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
|
||||||
/*!50100 PARTITION BY HASH (a)
|
/*!50100 PARTITION BY HASH (a)
|
||||||
PARTITIONS 2 */
|
PARTITIONS 2 */
|
||||||
|
@ -12,12 +12,12 @@ foo CREATE TABLE `foo` (
|
|||||||
/*!50100 PARTITION BY HASH (a)
|
/*!50100 PARTITION BY HASH (a)
|
||||||
PARTITIONS 2 */
|
PARTITIONS 2 */
|
||||||
ALTER TABLE foo ADD COLUMN c INT;
|
ALTER TABLE foo ADD COLUMN c INT;
|
||||||
|
ERROR 42000: Table 'foo' uses an extension that doesn't exist in this MariaDB version
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
foo CREATE TABLE `foo` (
|
foo CREATE TABLE `foo` (
|
||||||
`a` int(11) NOT NULL DEFAULT '0',
|
`a` int(11) NOT NULL DEFAULT '0',
|
||||||
`b` int(11) DEFAULT NULL,
|
`b` int(11) DEFAULT NULL,
|
||||||
`c` int(11) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`a`)
|
PRIMARY KEY (`a`)
|
||||||
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
|
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
|
||||||
/*!50100 PARTITION BY HASH (a)
|
/*!50100 PARTITION BY HASH (a)
|
||||||
|
@ -8,6 +8,7 @@ SET SESSION tokudb_disable_slow_alter=1;
|
|||||||
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
|
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
INSERT INTO foo VALUES (1,0),(2,0);
|
INSERT INTO foo VALUES (1,0),(2,0);
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
|
--error 1112
|
||||||
ALTER TABLE foo ADD KEY(b);
|
ALTER TABLE foo ADD KEY(b);
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ DROP TABLE IF EXISTS foo;
|
|||||||
SET SESSION tokudb_disable_slow_alter=1;
|
SET SESSION tokudb_disable_slow_alter=1;
|
||||||
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
|
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
|
--error 1112
|
||||||
ALTER TABLE foo ADD COLUMN c INT;
|
ALTER TABLE foo ADD COLUMN c INT;
|
||||||
SHOW CREATE TABLE foo;
|
SHOW CREATE TABLE foo;
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_DATA
|
|||||||
/** Operations for altering a table that InnoDB does not care about */
|
/** Operations for altering a table that InnoDB does not care about */
|
||||||
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
|
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
|
||||||
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
|
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
|
||||||
|
| Alter_inplace_info::ALTER_PARTITIONED
|
||||||
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
|
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
|
||||||
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
|
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
|
||||||
| Alter_inplace_info::ALTER_RENAME;
|
| Alter_inplace_info::ALTER_RENAME;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user