2
pk INT NOT NULL AUTO_INCREMENT,
5
col_int_not_null INT NOT NULL,
8
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
9
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
10
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
12
SET GLOBAL transaction_log_truncate_debug= true;
14
--test with no previous Statement message
16
--ERROR ER_BAD_NULL_ERROR
17
UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
18
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (5,5,5);
22
--echo We should have a Transaction with a single insert Statement
23
--replace_regex /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
25
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
28
UPDATE t1 SET col_int1 = (col_int1 + 1) WHERE col_int2 = 1;
29
--ERROR ER_BAD_NULL_ERROR
30
UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
31
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (6,6,6);
35
--echo We should have a Transaction with 1 update and 1 insert Statement
36
--replace_regex /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
38
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
40
CREATE TABLE t2 (pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a INT);
41
INSERT INTO t2 (a) VALUES (1),(2), (NULL);
44
--ERROR ER_BAD_NULL_ERROR
45
INSERT INTO t1 (col_int_not_null) SELECT a FROM t2;
46
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (7,7,7);
50
--echo We should have a Transaction with 1 insert Statement
51
--replace_regex /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/
53
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
58
SET GLOBAL transaction_log_truncate_debug= true;