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

SET column on ENGINE=DuckDB silently drops any member at ordinal position 9 or higher

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      SET column on ENGINE=DuckDB silently drops any member at ordinal position 9 or higher

      INSTALL SONAME 'ha_duckdb';
      CREATE TABLE t1 (id INT PRIMARY KEY, s SET('a','b','c','d','e','f','g','h','i','k')) ENGINE=DuckDB;
      INSERT INTO t1 VALUES (1,'h'), (2,'i'),( 3, 'k');
      SELECT id, s FROM t1 ORDER BY id;              
      SELECT id, CAST(s AS CHAR) FROM t1 ORDER BY id;          -- id=2 correctly shows 'i'
      SELECT id FROM t1 WHERE s = 'i';                          -- correctly matches id=2
      

      CLI Output

      13.1.0-opt>INSTALL SONAME 'ha_duckdb';
      Query OK, 0 rows affected (0.076 sec)
       
      13.1.0-opt>CREATE TABLE t1 (id INT PRIMARY KEY, s SET('a','b','c','d','e','f','g','h','i','k')) ENGINE=DuckDB;
      Query OK, 0 rows affected (0.008 sec)
       
      13.1.0-opt>
      13.1.0-opt>SELECT id, s FROM t1 ORDER BY id;   
      Empty set (0.003 sec)
       
      13.1.0-opt>INSERT INTO t1 VALUES (1,'h'), (2,'i'), (3, 'k');
      Query OK, 3 rows affected (0.005 sec)
      Records: 3  Duplicates: 0  Warnings: 0
       
      13.1.0-opt>SELECT id, s FROM t1 ORDER BY id;   
      +----+------+
      | id | s    |
      +----+------+
      |  1 | h    |
      |  2 |      |
      |  3 |      |
      +----+------+
      3 rows in set (0.002 sec)
       
      13.1.0-opt>
      

      InnoDB works fine

      13.1.0-opt>CREATE TABLE t2 (id INT PRIMARY KEY, s SET('a','b','c','d','e','f','g','h','i'));
      Query OK, 0 rows affected (0.010 sec)
       
      13.1.0-opt>INSERT INTO t2 VALUES (1,'i'); -- fine on InnoDB
      Query OK, 1 row affected (0.001 sec)
       
      13.1.0-opt>SELECT id, s FROM t2; 
      +----+------+
      | id | s    |
      +----+------+
      |  1 | i    |
      +----+------+
      1 row in set (0.000 sec)
       
      13.1.0-opt>
      13.1.0-opt>INSTALL SONAME 'ha_duckdb';
      Query OK, 0 rows affected (0.072 sec)
       
      13.1.0-opt>ALTER TABLE t2 ENGINE=DuckDB;
      Query OK, 1 row affected (0.016 sec)                       
      Records: 1  Duplicates: 0  Warnings: 0
       
      13.1.0-opt>SELECT id, s FROM t2;    
      +----+------+
      | id | s    |
      +----+------+
      |  1 |      |
      +----+------+
      1 row in set (0.003 sec)
       
      13.1.0-opt>
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.25h
                  0.25h

                  Git Integration

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