You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/02/06 07:10:22 UTC
[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #13517: [Bug] [DAO] error pgsql sql syntax `ON DUPLICATE KEY` causes the process to execute failed
github-actions[bot] commented on issue #13517:
URL: https://github.com/apache/dolphinscheduler/issues/13517#issuecomment-1418613977
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
When DS's DB is PostgreSQL, I execute the process, it executes fail and throws the exception as follows:

### What you expected to happen
DS executes the process successfully without any errors.
### How to reproduce
- DS uses PostgreSQL DB;
- execute process;
### Anything else
- `ON DUPLICATE KEY` is MySQL syntax,and in PostgreSQL is `ON CONFLICT`. **Similar incompatible syntax should be avoided**.
- I am very confused about this SQL that cause the issue - **It seems to cause another bug** because it will update the recorder as long as the `updateTime` is same; In my view, when two recorders insert at the same time, there will only be one recorder insert.
```sql
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 DUPLICATE KEY UPDATE update_time = #{triggerRelation.updateTime};
```
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org