Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-27582

Fulltext search DDL decrements FTS_DOC_ID

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (id INT, f VARCHAR(64), PRIMARY KEY (id DESC), FULLTEXT ft(f)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
      DELETE FROM t1 WHERE id = 2;
      ALTER TABLE t1 DROP INDEX ft;
      ALTER TABLE t1 ADD FULLTEXT INDEX ft (f);
      INSERT INTO t1 values (3,'innodb ft search');
      ANALYZE TABLE t1;
      SELECT * FROM t1 WHERE MATCH(f) AGAINST("+innodb +search" IN BOOLEAN MODE);
       
      DROP TABLE t1;
      

      SELECT returns an empty result set

      preview-10.8-MDEV-13756-desc-indexes c10e10c6

      SELECT * FROM t1 WHERE MATCH(f) AGAINST("+innodb +search" IN BOOLEAN MODE);
      id	f
      

      Normally it should return a row:

      SELECT * FROM t1 WHERE MATCH(f) AGAINST("+innodb +search" IN BOOLEAN MODE);
      id	f
      3	innodb ft search
      

      Not reproducible with an ascending PK.
      Not reproducible with otherwise the same test case without re-creating the key.
      Not reproducible on MySQL 8.0.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.