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

Improve error handling for LOCK IN SHARE MODE on ENGINE=DuckDB instead of returning an internal DuckDB parser error

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      Please improve error handling for LOCK IN SHARE MODE for DuckDB: instead of returning an internal DuckDB parser error, a “not supported by this storage engine” error would be good.

      INSTALL SONAME 'ha_duckdb';
      CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=DuckDB;
      INSERT INTO t1 VALUES (1),(2),(3);
      SELECT * FROM t1 FOR UPDATE;
      SELECT * FROM t1 LOCK IN SHARE MODE;
      

      CLI output

      11.4.13-dbg>INSTALL SONAME 'ha_duckdb';
       
      Query OK, 0 rows affected (1.055 sec)
       
      11.4.13-dbg>CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=DuckDB;
      Query OK, 0 rows affected (0.033 sec)
       
      11.4.13-dbg>INSERT INTO t1 VALUES (1),(2),(3);
      Query OK, 3 rows affected (0.040 sec)
      Records: 3  Duplicates: 0  Warnings: 0
       
      11.4.13-dbg>SELECT * FROM t1 LOCK IN SHARE MODE;
      ERROR 1296 (HY000): Got error 122 'Parser Error: syntax error at or near "IN"
       
      LINE 1: SELECT * FROM t1 LOCK IN SHARE MODE
                                    ^' from DuckDB
      11.4.13-dbg>
      11.4.13-dbg>SELECT * FROM t1 FOR UPDATE;
      ERROR 1296 (HY000): Got error 122 'Parser Error: SELECT locking clause is not supported!' from DuckDB
      11.4.13-dbg>
      

      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 - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 20m
                  20m

                  Git Integration

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