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

ERROR 1032 (HY000): Can't find record when rowid_filter enabled

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      I am using a plugin called Litebans for my spigot Minecraft server, it utilizes a MariaDB 10.11.11-MariaDB-0+deb12u1 database, one of its normal queries, checking if a player is muted, started causing errors out of nowhere, the query in question is this:

      SELECT *
      FROM litebans_mutes WHERE((UUID='2790f6f1-48da-407f-96df-146c8f368578' OR(ipban=1 AND(ip='24.12.104.36' OR(ipban_wildcard=1
                                                                                                                 AND active=1
                                                                                                                 AND '24.12.104.36' LIKE ip)))) AND(server_scope='*'
                                                                                                                                                    OR server_scope='factions'))
      AND active=1 AND(UNTIL<1
                       OR UNTIL>1748198010528)
      LIMIT 1

      I have determined that setting:

      SET optimizer_switch='rowid_filter=off';
      

      causes the query to behave as expected (returning an empty set), but when i turn it back on, the query fails with this error:

      ERROR 1032 (HY000): Can't find record in 'litebans_mutes'
      

      I believe the reason the issue started out of nowhere is because enough players got muted to push the size of the table above a level where the rowid_filter optimization became enabled this is just a theory though

      Table description:
      +-------------------+---------------------+------+-----+---------------------+-------------------------------+
      | Field             | Type                | Null | Key | Default             | Extra                         |
      +-------------------+---------------------+------+-----+---------------------+-------------------------------+
      | id                | bigint(20) unsigned | NO   | PRI | NULL                | auto_increment                |
      | uuid              | varchar(36)         | YES  | MUL | NULL                |                               |
      | ip                | varchar(45)         | YES  | MUL | NULL                |                               |
      | reason            | varchar(2048)       | NO   |     | NULL                |                               |
      | banned_by_uuid    | varchar(36)         | YES  | MUL | NULL                |                               |
      | banned_by_name    | varchar(128)        | YES  |     | NULL                |                               |
      | removed_by_uuid   | varchar(36)         | YES  |     | NULL                |                               |
      | removed_by_name   | varchar(128)        | YES  |     | NULL                |                               |
      | removed_by_date   | timestamp           | NO   |     | current_timestamp() | on update current_timestamp() |
      | time              | bigint(20)          | NO   | MUL | NULL                |                               |
      | until             | bigint(20)          | NO   | MUL | NULL                |                               |
      | server_scope      | varchar(32)         | YES  |     | NULL                |                               |
      | server_origin     | varchar(32)         | YES  |     | NULL                |                               |
      | silent            | bit(1)              | NO   |     | NULL                |                               |
      | ipban             | bit(1)              | NO   | MUL | NULL                |                               |
      | ipban_wildcard    | bit(1)              | NO   | MUL | NULL                |                               |
      | active            | bit(1)              | NO   | MUL | NULL                |                               |
      | removed_by_reason | varchar(2048)       | YES  |     | NULL                |                               |
      | template          | tinyint(3) unsigned | NO   | MUL | 255                 |                               |
      +-------------------+---------------------+------+-----+---------------------+-------------------------------+
      

      Dumping the database and running on a fresh machine determines the bug is easy to replicate, you should be able to see this by downloading the attached SQL file, which is an export of the litebans_mutes table and running the same query on mariadb 10.11.11-MariaDB-0+deb12u1, note the data has been modified from the real data to preserve privacy but the bug still occurs on this modified data

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tinytmp Charles Benett
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.