You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/09/20 06:42:30 UTC

[dolphinscheduler] branch dev updated: [Bug][ApiServer] When modifying the task definition, inserting the task definition log table will report the bug of primary key conflict #12037

This is an automated email from the ASF dual-hosted git repository.

caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 649015bfff [Bug][ApiServer] When modifying the task definition, inserting the task definition log table will report the bug of primary key conflict #12037
649015bfff is described below

commit 649015bfff69e3922fb9b1059784b3ea2e70eb69
Author: 金鑫 <ji...@qdjinxin.net>
AuthorDate: Tue Sep 20 14:42:21 2022 +0800

    [Bug][ApiServer] When modifying the task definition, inserting the task definition log table will report the bug of primary key conflict #12037
    
    Co-authored-by: 金鑫 <ji...@huansi.net>
---
 .../dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
index d7381f9256..9e30359d76 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
@@ -487,6 +487,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
         taskDefinitionToUpdate.setOperator(loginUser.getId());
         taskDefinitionToUpdate.setOperateTime(now);
         taskDefinitionToUpdate.setCreateTime(now);
+        taskDefinitionToUpdate.setId(null);
         int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate);
         if ((update & insert) != 1) {
             logger.error("Update task definition or definitionLog error, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskCode);