This is an automated email from the ASF dual-hosted git repository.
wenjun 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 36f72056a9 [Bug] Fix TriggerRelationMapper cannot work due to miss
DatabaseIdProvider (#15153)
36f72056a9 is described below
commit 36f72056a9b692ffdc0a57acc0a20690a8b02de9
Author: destroydestiny <[email protected]>
AuthorDate: Fri Nov 17 21:32:22 2023 +0800
[Bug] Fix TriggerRelationMapper cannot work due to miss DatabaseIdProvider
(#15153)
---
.../java/org/apache/dolphinscheduler/dao/DaoConfiguration.java | 8 ++++++++
.../apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java
index 2587bf0dc2..985f5b56b4 100644
---
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java
+++
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/DaoConfiguration.java
@@ -24,6 +24,9 @@ import
org.apache.dolphinscheduler.dao.plugin.api.DaoPluginConfiguration;
import org.apache.dolphinscheduler.dao.plugin.api.dialect.DatabaseDialect;
import org.apache.dolphinscheduler.dao.plugin.api.monitor.DatabaseMonitor;
+import org.apache.ibatis.mapping.DatabaseIdProvider;
+import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
+
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -61,6 +64,11 @@ public class DaoConfiguration {
return interceptor;
}
+ @Bean
+ public DatabaseIdProvider databaseIdProvider() {
+ return new VendorDatabaseIdProvider();
+ }
+
@Bean
public DbType dbType() {
return daoPluginConfiguration.dbType();
diff --git
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml
index 3408af21e3..0cb90a768d 100644
---
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml
+++
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TriggerRelationMapper.xml
@@ -53,7 +53,7 @@
ON DUPLICATE KEY UPDATE update_time = #{triggerRelation.updateTime};
</insert>
- <insert id="upsert" databaseId="pg">
+ <insert id="upsert" databaseId="PostgreSQL">
INSERT INTO t_ds_trigger_relation (trigger_code, trigger_type, job_id,
create_time, update_time) VALUES(
#{triggerRelation.triggerCode},#{triggerRelation.triggerType},#{triggerRelation.jobId},#{triggerRelation.createTime},#{triggerRelation.updateTime})
ON CONFLICT(trigger_type,job_id,trigger_code) DO UPDATE SET
update_time = #{triggerRelation.updateTime};