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

Column cannot be null if trigger exists

    XMLWordPrintable

Details

    Description

      if the before insert trigger exists this script give an error "Column 'k' cannot be null", but Column k not null.

      I tested lot of mariadb version and config, there were some servers got good results.
      When I tested a fresh ubuntu 24.04 with 11.11-MariaDB-ubu2404 got error (this from mariadb repo).
      When I tested with ubuntu with own mariadb repo (10.11.11-MariaDB), was good result.
      Maybe it was good in 10.11.10.

      DROP TABLE if exists tmp;
      CREATE TABLE tmp (
        `k` bigint(20) unsigned NOT NULL,
        `rowid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        PRIMARY KEY (rowid)
      ) ENGINE=innodb ;
      DELIMITER //
      CREATE  TRIGGER `tmp_before_insert` BEFORE INSERT ON `tmp` FOR EACH ROW BEGIN
       
      END;
      //
      DELIMITER ;
      TRUNCATE tmp;
      INSERT INTO tmp (k)
      SELECT 1
      UNION
      SELECT 2
      UNION
      SELECT 3;
       
      SELECT * FROM tmp;
       
      DROP TABLE if exists tmp;
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bulepage bulepage
              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.