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

Unexpected ER_DUP_KEY (1022): Can't write; duplicate key in table '(temporary)'

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 11.8, 12.3, 13.0
    • 11.8, 12.3, 13.1
    • Server
    • None

    Description

      Important: I could only reproduce it on builds with CMAKE_BUILD_TYPE=RelWithDebInfo, but not with Debug. There might be some other factors that would make it not reproducible on some builds. For example, since the test case depends on the number of tables in I_S.TABLES, it may be not reproducible on builds which disable some plugins usually present in standard MTR runs.

      The test case uses the extremely low value of max_heap_table_size=16K, so it may be considered an edge case unless it turns out to be scalable.

      The use of a new database db is not important there, it's just for a more convenient cleanup.

      SET max_heap_table_size = 16*1024;
       
      CREATE DATABASE db;
      USE db;
       
      --let $run = 17
      while ($run)
      {
        --eval CREATE TEMPORARY TABLE t$run (a INT) ENGINE=MEMORY
        --dec $run
      }
       
      SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES
        WHERE engine NOT IN ( SELECT 'x' UNION SELECT 'xx' );
       
      DROP DATABASE db;
      

      bb-blob-main-monty dc6a897961c311f981b150e4207ffc1390a219ef

      mysqltest: At line 13: query 'SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES
      WHERE engine NOT IN ( SELECT 'x' UNION SELECT 'xx' )' failed: ER_DUP_KEY (1022): Can't write; duplicate key in table '(temporary)'
      

      Attachments

        Activity

          People

            monty Michael Widenius
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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