1# $column1_type_name must be set.
2# $column2_type_name must be set.
3# $column2_value must be set.
4
5--echo # t1 column type name: $column1_type_name
6--echo # t2 column type name: $column2_type_name
7--echo # t2 column value: $column2_value
8
9eval CREATE TABLE t1(a INT, b $column1_type_name);
10eval CREATE TABLE t2(a INT, b $column2_type_name NOT NULL);
11
12INSERT INTO t1 VALUES (1, NULL);
13eval INSERT INTO t2 VALUES (1, $column2_value);
14
15CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 FOR EACH ROW SET @b = 1;
16
17--error ER_BAD_NULL_ERROR
18UPDATE t1, t2 SET t2.b = t1.b;
19
20DROP TABLE t1, t2;
21