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

INSERT..SELECT from DuckDB into InnoDB delivers all NULL records

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Consider the example wher invoice2 is an InnoDB table.

      mariadb > INSERT INTO invoice2 (SELECT * FROM invoice);
      ERROR 1296 (HY000): Got error 122 'Catalog Error: Table with name invoice2 does not exist!
      Did you mean "invoice"?' from DuckDB
      

      The workaround creating invoice2 as DuckDB first delivers NULL records

      mariadb > CREATE TABLE invoice2 ( id INT UNSIGNED PRIMARY KEY, 
                    product VARCHAR(64), 
                    amount DECIMAL(12,2), 
                    sold_at TIMESTAMP ) engine=DuckDB default CHARSET utf8mb4;
      Query OK, 0 rows affected (0.017 sec)
       
      mariadb > INSERT INTO invoice2 (SELECT * FROM invoice);
      Query OK, 1 row affected (0.009 sec)
      Records: 1  Duplicates: 0  Warnings: 0
       
      mariadb > SELECT * FROM invoice2;
      +----+----------------+--------+---------------------+
      | id | product        | amount | sold_at             |
      +----+----------------+--------+---------------------+
      |  1 | MariaDB mug    |  12.00 | 2026-06-12 09:42:25 |
      |  2 | DuckDB sticker |   2.50 | 2026-06-12 09:42:25 |
      |  3 | Sea lion plush |  25.00 | 2026-06-12 09:42:25 |
      |  4 | DuckDB sticker |   2.50 | 2026-06-12 09:42:25 |
      |  4 | NULL           |   NULL | NULL                |
      +----+----------------+--------+---------------------+
      5 rows in set (0.004 sec)
      

      Attachments

        Activity

          People

            drrtuy Roman
            drrtuy Roman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.