-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: escape characters for column and table names #2126
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2126 +/- ##
=============================================
- Coverage 53.72% 53.21% -0.52%
- Complexity 2626 2646 +20
=============================================
Files 492 505 +13
Lines 15420 15882 +462
Branches 1772 1829 +57
=============================================
+ Hits 8284 8451 +167
- Misses 6344 6631 +287
- Partials 792 800 +8
|
rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java
Outdated
Show resolved
Hide resolved
undo_log.tableName 表名是按 schema.tableName保存的情况加上引号后同样会找不到表 @jsbxyyx |
OK |
rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoInsertExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java
Outdated
Show resolved
Hide resolved
...atasource/src/main/java/io/seata/rm/datasource/undo/oracle/keyword/OracleKeywordChecker.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/ColumnUtils.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java
Outdated
Show resolved
Hide resolved
rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rm-datasource/src/main/java/io/seata/rm/datasource/exec/BaseTransactionalExecutor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test passed. Test case below:
Insert:
insert into account_tbl(user_id, money, information) values (?, ?, ?)
insert into `account_tbl`(user_id, money, information) values (?, ?, ?)
insert into seata.account_tbl(user_id, money, information) values (?, ?, ?)
insert into seata.`account_tbl`(user_id, money, information) values (?, ?, ?)
insert into `table`(name) values (?)
insert into seata.`table`(name) values (?)
Delete:
delete from account_tbl where user_id = ?
delete from `account_tbl` where user_id = ?
delete from seata.account_tbl where user_id = ?
delete from seata.`account_tbl` where user_id = ?
Update:
update account_tbl set money = money - ? where user_id = ?
update `account_tbl` set money = money - ? where user_id = ?
update seata.account_tbl set money = money - ? where user_id = ?
update seata.`account_tbl` set money = money - ? where user_id = ?
Select:
select * from account_tbl where id = ? for update
select * from `account_tbl` where id = ? for update
select * from seata.account_tbl where id = ? for update
select * from seata.`account_tbl` where id = ? for update
Ⅰ. Describe what this PR did
oracle table name lowercase escape.
Ⅱ. Does this pull request fix one issue?
fixes: #2123 #2163
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews