1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-13847 Allow ALTER TABLE…ADD SPATIAL INDEX…ALGORITHM=INPLACE

MDEV-13851 Always check table options in ALTER TABLE…ALGORITHM=INPLACE

In the merge of MySQL 5.7.9 to MariaDB 10.2.2, some code was included
that prevents ADD SPATIAL INDEX from being executed with ALGORITHM=INPLACE.

Also, the constant ADD_SPATIAL_INDEX was introduced as an alias
to ADD_INDEX. We will remove that alias now, and properly implement
the same ADD SPATIAL INDEX restrictions as MySQL 5.7 does:

1. table-rebuilding operations are not allowed if SPATIAL INDEX survive it
2. ALTER TABLE…ADD SPATIAL INDEX…LOCK=NONE is not allowed

ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE
requires actions within InnoDB, enforce the table options (MDEV-13851).
In this way, we will keep denying ADD SPATIAL INDEX for tables
that use encryption (MDEV-11974), even if ALGORITHM=INPLACE is used.
This commit is contained in:
Marko Mäkelä
2017-09-20 16:52:11 +03:00
parent e53e58d4e4
commit 96f06f952d
9 changed files with 158 additions and 115 deletions

View File

@ -325,19 +325,17 @@ SET GLOBAL innodb_file_format=Antelope;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
ALTER TABLE t1 ADD COLUMN f1 INT;
Warnings:
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS;
Level Code Message
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL,
`f1` int(11) DEFAULT NULL
`i` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4
SHOW WARNINGS;
Level Code Message
ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
Level Code Message