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

Deleting a row from Aria table results to 'Index is corrupt'

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Deleting from Aria table could result in a corrupt index on Windows
    • Q4/2025 Server Maintenance

    Description

      FYI:
      Having a unit test that creates an Aria table, populates some rows and then deletes one of the rows, where the DELETE fails in error: '126 "Index is corrupted"'.
      The unit test runs OK on MariaDB (Community Server) V11.4.5 but fails on V11.8.2.
      The table creation clause is:

      CREATE TABLE iccl (
          id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Primary id',
          i_datsetid VARCHAR(100) NOT NULL COMMENT 'Data set ID',
          system_id TINYINT UNSIGNED NOT NULL COMMENT 'Reference to id in SYSTEM table',
          part_id INT NOT NULL COMMENT 'Reference to id in PART table',
          i_dateeffe INT NOT NULL COMMENT 'Date effective',
          i_timeeffe BIGINT(12) NOT NULL COMMENT 'Time effective',
          i_newvalue DECIMAL(20,2) NOT NULL COMMENT 'New value',
          i_usercod1 VARCHAR(16) COMMENT 'User defined code 1',
          i_usercod2 VARCHAR(16) COMMENT 'User defined code 2',
          i_usercod3 VARCHAR(16) COMMENT 'User defined code 3',
          i_usercod4 VARCHAR(16) COMMENT 'User defined code 4',
          i_usercod5 VARCHAR(16) COMMENT 'User defined code 5',
          business_day CHAR(8) NOT NULL COMMENT 'Business day',
          transaction_link_id VARCHAR(100) COMMENT 'Transaction link ID',
          order_type VARCHAR(10) COMMENT 'Type of the iccl order',
          entry_date INT COMMENT 'Entry date',
          entry_time BIGINT(12) COMMENT 'Entry time',
          revocation_date INT COMMENT 'Revocation date',
          revocation_time BIGINT(12) COMMENT 'Revocation time',
          modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Last modified time stamp',
          INDEX idx_iccl_bus_day (business_day),
          UNIQUE unq_iccl (id, i_datsetid, system_id, part_id, business_day)
      ) ENGINE=Aria;

      The DELETE clause is:

      DELETE FROM iccl WHERE system_id = ? AND i_datsetid = ? 

      where the parameters are properly provided. As you can see the DELETE clause does not match with any of the table's indexes, but it should not be a problem.
      The database is not set to use transactionality thus COMMIT clause is not used.

      Attachments

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              harri.engblom@bof.fi Harri Engblom
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 2h 53m
                  1d 2h 53m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5d Time Not Required
                  0.5d

                  Git Integration

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