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

Partition PAGE_COMPRESSED accepts an invalid boolean that table-level validation rejects

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 12.3.3
    • N/A
    • Partitioning
    • None
    • Linux x86_64
    • Not for Release Notes

    Description

      MariaDB accepts and persists PAGE_COMPRESSED='not_a_boolean' when the option is placed on a partition, although the same value at table scope is rejected with ERROR 1912. No IGNORE_BAD_TABLE_OPTIONS mode is enabled.

      Steps to reproduce

      1. Save the database setup as setup.sql:

      CREATE DATABASE validation;

      2. Save the table-level control as control.sql:

      USE validation;
      SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';
      CREATE TABLE control (id INT) ENGINE=InnoDB PAGE_COMPRESSED='not_a_boolean';

      3. Save the partition-level case as case.sql:

      USE validation;
      SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';
      CREATE TABLE partitioned (id INT) ENGINE=InnoDB
      PARTITION BY HASH(id)
      (PARTITION p PAGE_COMPRESSED='not_a_boolean');
      SHOW WARNINGS;
      SELECT 'ACCEPTED_INVALID_OPTION', COUNT(*) FROM information_schema.TABLES
      WHERE TABLE_SCHEMA='validation' AND TABLE_NAME='partitioned';
      SHOW CREATE TABLE partitioned;

      4. Execute the files in order with separate MariaDB client invocations:

      mariadb --batch --raw < setup.sql
      mariadb --batch --raw < control.sql
      mariadb --batch --raw < case.sql

      The control invocation is expected to report an error; continue with case.sql afterward.

      Actual result

      The table-level control rejects the value:

      ERROR 1912 (HY000): Incorrect value 'not_a_boolean' for option 'PAGE_COMPRESSED'

      The partition-level statement succeeds without a warning. The table exists, and SHOW CREATE TABLE retains the invalid value:

      ACCEPTED_INVALID_OPTION  COUNT(*)
      ACCEPTED_INVALID_OPTION  1
      Table        Create Table
      partitioned  CREATE TABLE `partitioned` (
        `id` int(11) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
       PARTITION BY HASH (`id`)
      (PARTITION `p` ENGINE = InnoDB `PAGE_COMPRESSED`='not_a_boolean')

      Expected result

      PAGE_COMPRESSED is a boolean option, so 'not_a_boolean' should be rejected at partition scope with the same bad-option diagnostic produced at table scope. The partition definition should not be created or persisted with that value.

      This occurs when a boolean engine option is supplied on a partition definition rather than at table scope.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Milo liu
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.