MDEV-32017 Auto-increment no longer works for explicit FTS_DOC_ID

- InnoDB should avoid the sync commit operation when
there is nothing in fulltext cache. This is caused by
commit 1248fe72 (MDEV-27582)
parent 156bf529
......@@ -318,3 +318,16 @@ DROP TABLE t1;
disconnect con1;
SET GLOBAL innodb_optimize_fulltext_only=OFF;
SET GLOBAL innodb_ft_aux_table = default;
#
# MDEV-32017 Auto-increment no longer works for
# explicit FTS_DOC_ID
#
CREATE TABLE t (
FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
f1 char(255), f2 char(255), f3 char(255), fulltext key (f3)
) ENGINE=InnoDB;
INSERT INTO t (f1,f2,f3) VALUES ('foo','bar','baz');
ALTER TABLE t ADD FULLTEXT INDEX ft1(f1);
ALTER TABLE t ADD FULLTEXT INDEX ft2(f2);
INSERT INTO t (f1,f2,f3) VALUES ('bar','baz','qux');
DROP TABLE t;
......@@ -397,3 +397,17 @@ DROP TABLE t1;
disconnect con1;
SET GLOBAL innodb_optimize_fulltext_only=OFF;
SET GLOBAL innodb_ft_aux_table = default;
--echo #
--echo # MDEV-32017 Auto-increment no longer works for
--echo # explicit FTS_DOC_ID
--echo #
CREATE TABLE t (
FTS_DOC_ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
f1 char(255), f2 char(255), f3 char(255), fulltext key (f3)
) ENGINE=InnoDB;
INSERT INTO t (f1,f2,f3) VALUES ('foo','bar','baz');
ALTER TABLE t ADD FULLTEXT INDEX ft1(f1);
ALTER TABLE t ADD FULLTEXT INDEX ft2(f2);
INSERT INTO t (f1,f2,f3) VALUES ('bar','baz','qux');
DROP TABLE t;
......@@ -4304,6 +4304,11 @@ fts_sync(
size_t fts_cache_size= 0;
rw_lock_x_lock(&cache->lock);
if (cache->total_size == 0) {
rw_lock_x_unlock(&cache->lock);
return DB_SUCCESS;
}
/* Check if cache is being synced.
Note: we release cache lock in fts_sync_write_words() to
avoid long wait for the lock by other threads. */
......
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