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

NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined

    XMLWordPrintable

Details

    • 10.1.11

    Description

      set session sql_mode ='NO_AUTO_VALUE_ON_ZERO';
       
      drop table if exists test;
                  
      create table test (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,  PRIMARY KEY (`id`));
       
      insert into test (id) values (0);
       
      select id from test;
       
      #+----+
      # | id |
      # +----+
      # |  0 |
      # +----+
       
      drop table if exists test;
                  
      create table test (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,  PRIMARY KEY (`id`));
       
      drop trigger if exists test_before_insert;
                    
      delimiter ;;
          
      CREATE TRIGGER `test_before_insert` 
      BEFORE INSERT ON `test` 
      FOR EACH ROW 
      BEGIN
      END ;;
       
      delimiter ;
       
      insert into test (id) values (0);
       
      select id from test;
       
      # +----+
      # | id |
      # +----+
      # |  1 |
      # +----+
       

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Rich Rich Theobald
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.