Bug #120135 When explicit_defaults_for_timestamp is off, replication exceptions when insert a null value.
Submitted: 24 Mar 2:02 Modified: 31 Mar 6:47
Reporter: Alice Alice Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.* OS:Any
Assigned to: CPU Architecture:Any

[24 Mar 2:02] Alice Alice
Description:
When explicit_defaults_for_timestamp is off, inserting a null value causes replication exceptions.

ERROR log: Could not execute Write_rows event on table test.t; Column 'timestamp_col2' cannot be null, Error_code: 1048; handler error No Error!; the event's source log master-bin.000001, end_log_pos 792>) COORDINATORS:(CHANNEL:<> ERROR:<Coordinator stopped because there were error(s) in the worker(s). 

How to repeat:
CREATE TABLE `t` (
 `id_col` int NOT NULL AUTO_INCREMENT,
 `datetime_col` datetime(6) DEFAULT NULL,
 `timestamp_col2` timestamp(6) GENERATED ALWAYS AS (`datetime_col`) STORED NOT NULL,
 PRIMARY KEY (`id_col`)
);
 insert ignore into t(datetime_col) values(NULL);
[24 Mar 12:39] Jean-François Gagné
Looks like a duplicate of Bug#120128.
[31 Mar 6:50] Harin Vadodaria
Yes, this is a duplicate of https://bugs.mysql.com/bug.php?id=120128.