Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.1.21
-
Centos 6.8, GCL
-
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
- duplicates
-
MDEV-11886 Trigger prevents insert after update to 10.1.21-MariaDB-1~trusty
-
- Closed
-
-
MDEV-11951 Triggers doesn't work
-
- Closed
-
-
MDEV-12100 INSERT silently ignored
-
- Closed
-
- relates to
-
MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Priority | Major [ 3 ] | Blocker [ 1 ] |
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. |
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. {code:sql} 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'); {code} The above works for about 20 inserts then fails without error. setting a default for vendor_name allows the query to work again. |
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. {code:sql} 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'); {code} The above works for about 20 inserts then fails without error. setting a default for vendor_name allows the query to work again. |
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. {code:sql} 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'); {code} The above works for about 20 inserts then fails without error. setting a default for vendor_name allows the query to work again. |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Assignee | Sergei Golubchik [ serg ] |
Component/s | Triggers [ 10109 ] |
Labels | innodb insert | innodb insert regression |
Link |
This issue duplicates |
Labels | innodb insert regression | 10.2-ga innodb insert regression |
Link |
This issue duplicates |
Link |
This issue duplicates |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Component/s | Data Manipulation - Update [ 10805 ] | |
Fix Version/s | 10.1.22 [ 22502 ] | |
Fix Version/s | 10.2.5 [ 22117 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Sprint | 10.1.22 [ 143 ] |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 79278 ] | MariaDB v4 [ 151561 ] |
I see the same issue, but only when BEFORE INSERT trigger exists. For example:
Now lets create test table
Insert without default value generates a warning message:
MariaDB [test]> insert into `test` (`data2`) values ('x');
Query OK, 1 row affected, 1 warning (0.17 sec)
MariaDB [test]> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1364 | Field 'data1' doesn't have a default value |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
This is OK - 1 row inserted. And now try to create BEFORE INSERT trigger:
And repeat the same insert:
MariaDB [test]> insert into `test` (`data2`) values ('x');
Query OK, 0 rows affected (0.00 sec)
0 rows affected!!!!