在 DB2 数据库 INTERVAL 表达式输出时,将 VALUE 用括号包装 #4838
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复打印 DB2 的 SQL 时,INTERVAL 输出不正确的问题。
以原始 SQL 为说明:
INSERT INTO test VALUES (1, CURRENT TIMESTAMP + (10 * 60) SECONDS)
修复前输出:
INSERT INTO test VALUES (1, CURRENT TIMESTAMP + 10 * 60 SECONDS)
这个语句是不能用的,会报“SQLCODE=-182, SQLSTATE=42816”。
修复后输出为:
INSERT INTO test VALUES (1, CURRENT TIMESTAMP + (10 * 60) SECONDS)
可使用 IBM 官方的 DB2 Docker 镜像进行快速验证。(https://hub.docker.com/r/ibmcom/db2)