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

AUTO_INCREMENT is silently dropped on a pluggable data type column

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.1
    • 13.1
    • Plugins
    • None
    • Can result in unexpected behaviour

    Description

      AUTO_INCREMENT is silently DROPPED on a column declared with a pluggable data type (test_int8/test_double)

      INSTALL SONAME 'type_test';
      CREATE TABLE t1 (i TEST_INT8 NOT NULL AUTO_INCREMENT, a INT, KEY(i));
      INSERT INTO t1 (a) VALUES (1),(2),(3);
      SELECT i, a FROM t1 ORDER BY a;
      

      CLI Output

      13.1.0-opt>    INSTALL SONAME 'type_test';
      Query OK, 0 rows affected (0.008 sec)
       
      13.1.0-opt>    CREATE TABLE t1 (i TEST_INT8 NOT NULL AUTO_INCREMENT, a INT, KEY(i));
      Query OK, 0 rows affected (0.011 sec)
       
      13.1.0-opt>    INSERT INTO t1 (a) VALUES (1),(2),(3);
      Query OK, 3 rows affected (0.001 sec)
      Records: 3  Duplicates: 0  Warnings: 0
       
      13.1.0-opt>    SELECT i, a FROM t1 ORDER BY a;
      +---+------+
      | i | a    |
      +---+------+
      | 0 |    1 |
      | 0 |    2 |
      | 0 |    3 |
      +---+------+
      3 rows in set (0.000 sec)
       
      13.1.0-opt>
      13.1.0-opt>show create table t1\G
      *************************** 1. row ***************************
             Table: t1
      Create Table: CREATE TABLE `t1` (
        `i` test_int8(20) NOT NULL DEFAULT 0,
        `a` int(11) DEFAULT NULL,
        KEY `i` (`i`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      1 row in set (0.000 sec)
       
      13.1.0-opt>
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h

                Git Integration

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