From 06b6ea81cf9c6590b13fdfb373115fa14ca90f67 Mon Sep 17 00:00:00 2001 From: Eric Gao Date: Thu, 13 Jul 2023 16:56:04 +0800 Subject: [PATCH] [Bug][Core] Fix query process instances by trigger code bug (#14528) * Fix query process instances by trigger code bug * Add comment --- .../dao/mapper/ProcessInstanceMapper.xml | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml index 1748468dd5..8d4628d8f0 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml @@ -28,16 +28,6 @@ dry_run, test_flag, next_process_instance_id, restart_time, state_history - - ${alias}.id - , ${alias}.name, ${alias}.process_definition_version, ${alias}.process_definition_code, ${alias}.project_code, ${alias}.state, ${alias}.recovery, ${alias}.start_time, ${alias}.end_time, ${alias}.run_times,host, - command_type, ${alias}.command_param, ${alias}.task_depend_type, ${alias}.max_try_times, ${alias}.failure_strategy, ${alias}.warning_type, - warning_group_id, ${alias}.schedule_time, ${alias}.command_start_time, ${alias}.global_params, ${alias}.flag, - update_time, ${alias}.is_sub_process, ${alias}.executor_id, ${alias}.history_cmd, - process_instance_priority, ${alias}.worker_group,environment_code, ${alias}.timeout, ${alias}.tenant_code, ${alias}.var_pool, - dry_run, ${alias}.test_flag, ${alias}.next_process_instance_id, ${alias}.restart_time, ${alias}.state_history - - select - - - - from t_ds_trigger_relation a - join t_ds_process_instance b on a.job_id = b.id - where a.trigger_type = 0 and a.trigger_code = #{triggerCode} + + from t_ds_process_instance a + join + (select trigger_type, job_id, trigger_code from t_ds_trigger_relation) b + on a.id = b.job_id + where b.trigger_type = 0 and b.trigger_code = #{triggerCode}