Bug #119828 UPDATE error = 1048,column ‘work_record_id’ cannot be null
Submitted: 1 Feb 20:42 Modified: 3 Feb 12:14
Reporter: wenxiang wang Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:n: 5.7.29 OS:Any
Assigned to: CPU Architecture:Any

[1 Feb 20:42] wenxiang wang
Description:
CREATE TABLE `seven_fresh_wms_picker_di` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `ord_num` bigint(20) NOT NULL DEFAULT '0' COMMENT '拣货订单数',
  `pick_num` bigint(20) NOT NULL DEFAULT '0' COMMENT '拣货件数',
  `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户ID',
  `work_record_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '工作量记录ID',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_valid` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1-有效、0-无效',
  PRIMARY KEY (`id`),
  KEY `idx_create_time` (`create_time`) USING BTREE,
  KEY `idx_update_time` (`update_time`) USING BTREE,
  KEY `idx_work_record_id` (`work_record_id`) USING BTREE,
) ENGINE=InnoDB AUTO_INCREMENT=1DEFAULT CHARSET=utf8mb4 COMMENT='xxxxxxx'
序号	Trigger	Event	Table	Statement	Timing	Created	sql_mode	Definer	character_set_client	collation_connection	Database Collation	
1	
No trigger

"_source": {
    
    "Tables": "seven_fresh_wms_picker_di",
    "ThreadId": 0,
    "SqlType": "UPDATE",
    "SqlFinger": "UPDATE `seven_fresh_wms_picker_di` SET `work_record_id`=? WHERE `id`=? AND `work_record_id`=? AND `is_valid`=?",
    "SqlHash": "5427cf742460b40316e9ce12e0368b9c5ea4fc23",
    "SqlInfo": "UPDATE seven_fresh_wms_picker_di\n        SET work_record_id = 10214613\n        WHERE id = 802749\n          AND work_record_id = 0\n          AND is_valid = 1",
    "CreateTime": "2026-01-31T05:53:00.979912528+08:00",
    "ExecuteTime": 0,
    "AffectedRows": 0,
    "ReturnCode": "1048",
    "ExecuteTotal": 242,
    "ValueCount": 0
  },

sql_mode
STRICT_TRANS_TABLES
	
transaction_isolation
READ-COMMITTED

My Java program takes 10 milliseconds to execute. It still fails after three attempts.

How to repeat:
i do not known,Occasionally occurred!
In a relatively large MySQL transaction
[3 Feb 12:14] Roy Lyseng
Thank you for the bug report.
However, I am closing this as it seems to be a duplicate of bug#119827.