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

Fail to insert on a table where a field has no default

    XMLWordPrintable

Details

    • 10.1.22

    Description

      Mariadb updated this morning from 10.1.20 to 10.1.21

      After the update if inserting a few fields into the table where there are other fields that have not been set and do not have defaults, The insert fails without any error. Setting default values on all fields resolves the error.

      CREATE TABLE `vendors` (
      	`id` INT(11) NOT NULL AUTO_INCREMENT,
      	`vendor_name` VARCHAR(100) NOT NULL,
      	`address1` VARCHAR(128) NOT NULL DEFAULT '',
      	`address2` VARCHAR(40) NOT NULL DEFAULT '',
      	`regionId` INT(11) NULL DEFAULT NULL,
      	`areaId` INT(11) NULL DEFAULT NULL,
      	`cityId` INT(11) NULL DEFAULT NULL,
      	`townId` INT(11) NULL DEFAULT NULL,
      	`city_code` VARCHAR(5) NOT NULL DEFAULT '',
      	`post_code` VARCHAR(15) NOT NULL DEFAULT '',
      	PRIMARY KEY (`id`)
      ) COLLATE='utf8_general_ci' ENGINE=InnoDB;
       
      insert into vendors (`post_code`) VALUES ('CR0 1NN');
      

      The above works for about 20 inserts then fails without error.

      setting a default for vendor_name allows the query to work again.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Vyspa Habib
              Votes:
              8 Vote for this issue
              Watchers:
              12 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.