summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_fts
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-01-15 10:49:03 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-01-15 10:57:16 +0200
commit3d798be1d481835b60a811148a10ea14c37d5674 (patch)
tree69c605d6daa8442522aedd78eba875afb315bf98 /mysql-test/suite/innodb_fts
parent2750a0206510456f9242ee1a7343a28de81159c0 (diff)
downloadmariadb-git-3d798be1d481835b60a811148a10ea14c37d5674.tar.gz
MDEV-14655 Assertion `!fts_index' failed in prepare_inplace_alter_table_dict
MariaDB inherits the MySQL limitation that ALGORITHM=INPLACE cannot create more than one FULLTEXT INDEX at a time. As part of the MDEV-11369 Instant ADD COLUMN refactoring, MariaDB 10.3.2 accidentally stopped enforcing the restriction. Actually, it is a bug in MySQL 5.6 and MariaDB 10.0 that an ALTER TABLE statement with multiple ADD FULLTEXT INDEX but without explicit ALGORITHM=INPLACE would return in an error message, rather than executing the operation with ALGORITHM=COPY. ha_innobase::check_if_supported_inplace_alter(): Enforce the restriction on multiple FULLTEXT INDEX. prepare_inplace_alter_table_dict(): Replace some code with debug assertions. A "goto error_handled" at this point would result in another error, because the reference count of ctx->new_table would be 0.
Diffstat (limited to 'mysql-test/suite/innodb_fts')
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result14
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test13
2 files changed, 16 insertions, 11 deletions
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
index 983f254cf90..cd7d8f03923 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
@@ -162,11 +162,15 @@ INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
(14,'1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
(19, 'MySQL vs. YourSQL','In the following database comparison ...'),
(20, 'MySQL Security','When configured properly, MySQL ...');
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title),
-ADD FULLTEXT INDEX idx5 (title);
-ERROR HY000: InnoDB presently supports one FULLTEXT index creation at a time
-CREATE FULLTEXT INDEX idx on articles (title);
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title);
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ADD FULLTEXT INDEX idx3 (title), ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ADD FULLTEXT INDEX idx3 (title);
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release
ALTER TABLE articles ADD INDEX t20 (title(20)), LOCK=NONE;
ALTER TABLE articles DROP INDEX t20;
INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
index 10dc1462c98..23065a97002 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
@@ -195,12 +195,13 @@ INSERT INTO articles (FTS_DOC_ID, title, body) VALUES
(19, 'MySQL vs. YourSQL','In the following database comparison ...'),
(20, 'MySQL Security','When configured properly, MySQL ...');
---error ER_INNODB_FT_LIMIT
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title),
- ADD FULLTEXT INDEX idx5 (title);
-
-CREATE FULLTEXT INDEX idx on articles (title);
-ALTER TABLE articles ADD FULLTEXT INDEX idx3 (title);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ ADD FULLTEXT INDEX idx3 (title), ALGORITHM=INPLACE;
+--enable_info
+ALTER TABLE articles ADD FULLTEXT INDEX idx (title),
+ ADD FULLTEXT INDEX idx3 (title);
+--disable_info
ALTER TABLE articles ADD INDEX t20 (title(20)), LOCK=NONE;
ALTER TABLE articles DROP INDEX t20;