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

AUTO_INCREMENT or equvivalent sequence DEFAULT column value support for DuckDB

    XMLWordPrintable

Details

    Description

      Consider the example that affects existing MDB schema migration to DuckDB.

      mariab > CREATE TABLE invoice ( 
                 id BIGINT AUTO_INCREMENT PRIMARY KEY, 
                 product VARCHAR(64), 
                 amount DECIMAL(12,2), 
                 sold_at TIMESTAMP ) ENGINE=DuckDB DEFAULT CHARSET utf8mb4;
      ERROR 1164 (42000): Storage engine DUCKDB doesn't support AUTO_INCREMENT columns
       
      mariadb > CREATE SEQUENCE primary_key_seq START WITH 1 INCREMENT BY 1 CACHE 100;
      Query OK, 0 rows affected (0.014 sec)
       
      mariadb > CREATE TABLE invoice ( 
                  id BIGINT PRIMARY KEY DEFAULT(NEXT VALUE FOR primary_key_seq),
                  product VARCHAR(64), 
                  amount DECIMAL(12,2), 
                  sold_at TIMESTAMP ) ENGINE=DuckDB DEFAULT CHARSET utf8mb4;
      ERROR 1296 (HY000): Got error 168 'Binder Error: DEFAULT value cannot contain column names
       
      LINE 1: ...(nextval("ducktest"."primary_key_seq")),"product" VARCHAR COLLATE NOCASE.NOACCENT,"amount" DECIMAL(12,2),"sold_at" TIMESTA...
            ' from DuckDB
      

      Attachments

        Activity

          People

            drrtuy Roman
            drrtuy Roman
            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.