diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-05-07 14:54:58 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2018-05-07 14:58:11 +0530 |
commit | 85cc6b70bd7e5db2c96c4f58344bab269343cf85 (patch) | |
tree | ffa0ab7a6a75996497ce75b65fe9d5d3b02c9bd0 /mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test | |
parent | a0bc3b7eeef6a3bfd0e7eae1cceabcc73071a61a (diff) | |
download | mariadb-git-85cc6b70bd7e5db2c96c4f58344bab269343cf85.tar.gz |
MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
Introduced new alter algorithm type called NOCOPY & INSTANT for
inplace alter operation.
NOCOPY - Algorithm refuses any alter operation that would
rebuild the clustered index. It is a subset of INPLACE algorithm.
INSTANT - Algorithm allow any alter operation that would
modify only meta data. It is a subset of NOCOPY algorithm.
Introduce new variable called alter_algorithm. The values are
DEFAULT(0), COPY(1), INPLACE(2), NOCOPY(3), INSTANT(4)
Message to deprecate old_alter_table variable and make it alias
for alter_algorithm variable.
alter_algorithm variable for slave is always set to default.
Diffstat (limited to 'mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test')
-rw-r--r-- | mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test | 20 |
1 files changed, 9 insertions, 11 deletions
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 58282809083..ddd92556772 100644 --- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test +++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test @@ -18,14 +18,17 @@ INSERT INTO fts_test (title,body) VALUES ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); +# Table does rebuild when fts index builds for the first time +--error ER_ALTER_OPERATION_NOT_SUPPORTED +ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY; + # Create the FTS index -CREATE FULLTEXT INDEX idx on fts_test (title, body); +ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=INPLACE; # Select word "tutorial" in the table SELECT * FROM fts_test WHERE MATCH (title, body) AGAINST ('Tutorial' IN NATURAL LANGUAGE MODE); - # Drop the FTS idx DROP INDEX idx ON fts_test; @@ -38,9 +41,8 @@ INSERT INTO fts_test (title,body) VALUES ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); - -# Recreate the FTS index -CREATE FULLTEXT INDEX idx on fts_test (title, body); +# FTS_DOC_ID hidden column and FTS_DOC_ID index exist +ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY; # Select word "tutorial" in the table SELECT * FROM fts_test WHERE MATCH (title, body) @@ -81,8 +83,6 @@ CREATE TABLE fts_test ( body TEXT ) ENGINE=InnoDB; -create unique index FTS_DOC_ID_INDEX on fts_test(FTS_DOC_ID); - # Insert six rows INSERT INTO fts_test (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...') , @@ -97,7 +97,7 @@ INSERT INTO fts_test (title,body) VALUES # column already exists. This has not been implemented yet. --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE; -CREATE FULLTEXT INDEX idx on fts_test (title, body); +ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE; @@ -117,8 +117,6 @@ SELECT * FROM fts_test WHERE MATCH (title, body) # Drop the FTS_DOC_ID_INDEX and try again drop index idx on fts_test; -drop index FTS_DOC_ID_INDEX on fts_test; - CREATE FULLTEXT INDEX idx on fts_test (title, body); SELECT * FROM fts_test WHERE MATCH (title, body) @@ -232,7 +230,7 @@ DROP TABLE articles; create table articles(`FTS_DOC_ID` serial, `col32` timestamp not null,`col115` text) engine=innodb; -create fulltext index `idx5` on articles(`col115`) ; +create fulltext index `idx5` on articles(`col115`) ; alter ignore table articles add primary key (`col32`) ; |