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

v10.11.11 introduces bug that breaks production code - INSERT SELECT and triggres not working

    XMLWordPrintable

Details

    Description

      INSERT SELECT not working with triggers.

      To recreate the problem:

      create table a (id bigint not null primary key, name varchar(30))
      insert into parasql_pk_counters values ('a','id',5000) -- our way of managing simple counter - code unchanged for years
       
      insert into a (id, name)
      select parasql_next_val('a'), 'dog'
      from Customers -- just a table with some records
      limit 10
       
      select * from a
      

      The above code works as expected when table a does not have a BEFORE insert nor BEFORE update trigger. Adding either trigger (even if it does nothing) results in:

      ERROR: (conn=50) Column 'id' cannot be null

      Prior to v10.11.11 everything worked as expected for years.
      After updating from 10.11.10 to v10.11.11 the problem is as follows:

      If table a has no triggers - works as expected
      Adding empty triggers (with just a comment):
      BEFORE insert = ERROR: (conn=50) Column 'id' cannot be null
      BEFORE update = ERROR: (conn=80) Column 'id' cannot be null
      AFTER insert = works as expected
      AFTER update = works as expected

      This seems similar to MDEV-36026 - Problem with INSERT SELECT on NOT NULL columns, but I am not sure so submitting as new bug as both BEFORE insert and update cause the problem.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rdyas Robert Dyas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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