1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-8605 MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column

NOT NULL constraint must be checked *after* the BEFORE triggers.
That is for INSERT and UPDATE statements even NOT NULL fields
must be able to store a NULL temporarily at least while
BEFORE INSERT/UPDATE triggers are running.
This commit is contained in:
Sergei Golubchik
2015-11-14 22:51:54 +01:00
parent ad5db17e88
commit 0686c34d22
22 changed files with 898 additions and 85 deletions

View File

@@ -214,12 +214,14 @@ end if;
end|
insert into t3 values (1);
insert into t1 values (4, "four", 1), (5, "five", 2);
ERROR 23000: Column 'id' cannot be null
Warnings:
Warning 1048 Column 'id' cannot be null
select * from t1;
id data fk
1 one NULL
2 two NULL
4 four 1
0 five 2
select * from t2;
event
INSERT INTO t1 id=1 data='one'