[MDEV-32017] Auto-increment no longer works for explicit FTS_DOC_ID Created: 2023-08-26  Updated: 2023-10-17  Resolved: 2023-10-12

Status: Closed
Project: MariaDB Server
Component/s: Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.4, 10.5, 10.6, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: None


 Description   

Note: I've seen intermediate test cases occasionally pass, even though there is no obvious non-determinism there. Please try --repeat=N if it happens.

--source include/have_innodb.inc
 
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');
 
# Cleanup
DROP TABLE t;

10.4 900c4d69

mysqltest: At line 13: query 'INSERT INTO t (f1,f2,f3) VALUES ('bar','baz','qux')' failed: 182: Invalid InnoDB FTS Doc ID

2023-08-26  1:42:14 9 [ERROR] InnoDB: FTS_DOC_ID must be larger than 2 for table `test`.`t`

The failure started happening on 10.4 after this merge

commit 7b97020d402ae96b1da84396c172bdfdc1bccb37
Merge: 5172f132bfc 02da00a98ce
Author: Marko Mäkelä
Date:   Mon Mar 7 09:05:36 2022 +0200
 
    Merge 10.3 into 10.4

I didn't bisect 10.3, but it's a small merge with only one clear suspect

commit 1248fe727784bb6be73f70163353cf8457cfde69
Author: Thirunarayanan Balathandayuthapani
Date:   Thu Feb 3 12:57:32 2022 +0530
 
    MDEV-27582 Fulltext DDL decrements the FTS_DOC_ID value



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2023-10-04 ]

Patch is in bb-10.4-thiru

Comment by Marko Mäkelä [ 2023-10-11 ]

Looks OK to me.

Generated at Thu Feb 08 10:28:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.