Invalid InnoDB FTS Doc ID during INSERT

Bug #1541698 reported by monty solomon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Unassigned
5.7
Fix Released
Medium
Unassigned

Bug Description

Attempts to insert into an InnoDB table that contains a FULLTEXT KEY and a FTS_DOC_ID column fail when the FTS_DOC_ID is not specified.

CREATE TABLE `fts` (
  `id` varchar(36) NOT NULL,
  `reason` varchar(500) NOT NULL,
  `FTS_DOC_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
  FULLTEXT KEY `reason` (`reason`)
) ENGINE=InnoDB AUTO_INCREMENT=128012416 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8

mysql> INSERT IGNORE INTO fts (id, reason) VALUES (UUID(), 'unknown');
ERROR 182 (HY000): Invalid InnoDB FTS Doc ID

mysql> INSERT INTO fts (id, reason) VALUES (UUID(), 'unknown');
ERROR 182 (HY000): Invalid InnoDB FTS Doc ID

Revision history for this message
monty solomon (monty+launchpad) wrote :

mysql Ver 14.14 Distrib 5.6.25-73.1, for Linux (x86_64) using 6.0

Server version: 5.6.25-73.1-log Percona Server (GPL), Release 73.1, Revision 07b797f

CentOS release 6.7 (Final)

Revision history for this message
monty solomon (monty+launchpad) wrote :
tags: added: innodb upstream
Revision history for this message
monty solomon (monty+launchpad) wrote :

Upstream was unable to reproduce the bug.

It may be specific to Percona Server or related to my my.cnf settings.

Are you able to reproduce the bug using the example I provided?

Revision history for this message
monty solomon (monty+launchpad) wrote :

The problem occurs when there is a large auto_increment specified on the table creation.

Revision history for this message
monty solomon (monty+launchpad) wrote :

On a slave I converted a large MyISAM FTS table to InnoDB add added the FTS_DOC_ID column and index. The slave SQL failed trying to insert a row.

InnoDB: Doc ID 128012412 is too big. Its difference with largest used Doc ID 127998061 cannot exceed or equal to 10000
2016-02-04 05:21:42 18349 [ERROR] Slave SQL: Error 'Invalid InnoDB FTS Doc ID' on query. Error_code: 182
2016-02-04 05:21:42 18349 [Warning] Slave: Invalid InnoDB FTS Doc ID Error_code: 182
2016-02-04 05:21:42 18349 [Warning] Slave: Got error 182 from storage engine Error_code: 1030
2016-02-04 05:21:42 18349 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'bin.012487' position 6505648

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Upstream documented fixed in 5.6.31/5.7.13/5.8.0.

Revision history for this message
monty solomon (monty+launchpad) wrote :

https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html

Before MySQL 5.6.31, the permitted gap between the largest used FTS_DOC_ID value and new FTS_DOC_ID value is 10000. In MySQL 5.6.31 and later, the permitted gap is 65535.

https://dev.mysql.com/doc/refman/5.7/en/innodb-fulltext-index.html

Before MySQL 5.7.13, the permitted gap between the largest used FTS_DOC_ID value and new FTS_DOC_ID value is 10000. In MySQL 5.7.13 and later, the permitted gap is 65535.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1694

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.