Bug #120128 When explicit_defaults_for_timestamp is off, inserting a null value causes replication exceptions.
Submitted: 23 Mar 8:14 Modified: 8 Apr 9:03
Reporter: nanzhou lin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.* OS:Any
Assigned to: CPU Architecture:Any

[23 Mar 8:14] nanzhou lin
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:40] Jean-François Gagné
Bug#120135 looks like a duplicate of this one.