apache / apache/incubator-seata

Seata(2.0.0)update语句表名不支持加别名-oracle数据库

Open
#6,448 4 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

如果sql为:update mallcard.qst_mallcard_info t set t.amount = t.amount + 10 where t.card_no = '';加了别名t,在回滚时会报标识符无效,发现Seata的for update 语句在amount字段上加了双引号,如下图
![0094126a7af4bc02e30a67167a56f502](https://github.com/apache/incubator-seata/assets/31722378/b6ca6a9c-dd52-4363-a579-ad3b091d4574)

如果sql为:update mallcard.qst_mallcard_info t set amount = amount + 10 where t.card_no = '';,则可以正常回滚

Environment:
JDK version(e.g. java -version): 1.8
Seata client/server version: 2.0.0
Database version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
OS(e.g. uname -a): Linux
Others:

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two UPDATE forms against Oracle Database 11g with Seata client/server 2.0.0, then compare the generated for-update SQL and rollback behavior. Done means the aliased UPDATE rolls back without an invalid-identifier error while the existing non-aliased form continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.