Commit 99027efd authored by Sergei Golubchik's avatar Sergei Golubchik

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
parent 9927b36e
......@@ -8199,6 +8199,7 @@ ha_partition::check_if_supported_inplace_alter(TABLE *altered_table,
for (index= 0; index <= m_tot_parts; index++)
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++)
{
enum_alter_inplace_result p_result=
......
......@@ -1790,6 +1790,9 @@ class Alter_inplace_info
// Virtual columns changed
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.
......
......@@ -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 */
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
| Alter_inplace_info::ALTER_PARTITIONED
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
| Alter_inplace_info::ALTER_RENAME;
......
......@@ -13,13 +13,13 @@ foo CREATE TABLE `foo` (
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
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;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`)
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
......
......@@ -12,12 +12,12 @@ foo CREATE TABLE `foo` (
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
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;
Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 `compression`='tokudb_zlib'
/*!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;
INSERT INTO foo VALUES (1,0),(2,0);
SHOW CREATE TABLE foo;
--error 1112
ALTER TABLE foo ADD KEY(b);
SHOW CREATE TABLE foo;
......
......@@ -7,6 +7,7 @@ DROP TABLE IF EXISTS foo;
SET SESSION tokudb_disable_slow_alter=1;
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
SHOW CREATE TABLE foo;
--error 1112
ALTER TABLE foo ADD COLUMN c INT;
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 */
static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_INPLACE_IGNORE
= Alter_inplace_info::ALTER_COLUMN_DEFAULT
| Alter_inplace_info::ALTER_PARTITIONED
| Alter_inplace_info::ALTER_COLUMN_COLUMN_FORMAT
| Alter_inplace_info::ALTER_COLUMN_STORAGE_TYPE
| Alter_inplace_info::ALTER_RENAME;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment