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

Server crash caused by concurrent inserts into table with sequence default

    XMLWordPrintable

    Details

      Description

      Our company has experienced server crashes due to this reproducible bug. Follow the steps below to reproduce it.

      ```
      create sequence foo;
      create table bar (x int primary key default (next value for foo), y int);
      ```

      On two different sessions, run the following. For me, this caused a DB server crash within about two minutes:

      ```
      while 1=1 do
      insert into bar ( y )
      select <<<something>>> from <<<something>>>;
      rollback;
      end while;
      ```

      This version of the insert does not appear to cause the server crash:
      ```
      while 1=1 do
      insert into bar (x,y)
      select next value for foo, <<<something>>> from <<<something>>>;
      rollback;
      end while;
      ```

      The core dump for this crash indicated this as the failure:
      Item_func_nextval::val_int (this=0x7f1e78cca8a8) at /usr/src/debug/MariaDB-10.4.24/src_0/sql/item_func.cc:6877

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jonheffley Jon Heffley
              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.