Skip to content
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

Merged
merged 38 commits into from
Feb 13, 2020
Merged

bugfix: escape characters for column and table names #2126

merged 38 commits into from
Feb 13, 2020

Conversation

jsbxyyx
Copy link
Member

@jsbxyyx jsbxyyx commented Jan 3, 2020

Ⅰ. 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

@codecov-io
Copy link

codecov-io commented Jan 3, 2020

Codecov Report

Merging #2126 into develop will decrease coverage by 0.51%.
The diff coverage is 35.45%.

Impacted file tree graph

@@              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
Impacted Files Coverage Δ Complexity Δ
...o/seata/rm/datasource/sql/struct/TableRecords.java 92.85% <ø> (ø) 19 <0> (ø) ⬇️
.../rm/datasource/exec/BaseTransactionalExecutor.java 48.48% <ø> (ø) 19 <0> (ø) ⬇️
.../main/java/io/seata/rm/datasource/ColumnUtils.java 75.47% <ø> (+8.8%) 18 <0> (ø) ⬇️
.../undo/postgresql/PostgresqlUndoUpdateExecutor.java 0% <0%> (ø) 0 <0> (?)
.../undo/postgresql/PostgresqlUndoInsertExecutor.java 0% <0%> (ø) 0 <0> (?)
...ain/java/io/seata/core/store/db/LockStoreSqls.java 18.75% <0%> (-2.68%) 3 <0> (ø)
...r/druid/postgresql/PostgresqlInsertRecognizer.java 0% <0%> (ø) 0 <0> (?)
...ata/rm/datasource/undo/AbstractUndoLogManager.java 57.86% <0%> (+0.36%) 17 <0> (ø) ⬇️
.../main/java/io/seata/rm/datasource/AsyncWorker.java 15.18% <0%> (-1.72%) 5 <0> (ø)
...main/java/io/seata/core/store/db/LogStoreSqls.java 15.38% <0%> (-3.49%) 10 <0> (ø)
... and 25 more

@zjinlei
Copy link
Contributor

zjinlei commented Jan 3, 2020

image

@zjinlei zjinlei added this to the 1.1.0 milestone Jan 3, 2020
@luoc101
Copy link

luoc101 commented Jan 16, 2020

undo_log.tableName 表名是按 schema.tableName保存的情况加上引号后同样会找不到表 @jsbxyyx

@jsbxyyx
Copy link
Member Author

jsbxyyx commented Jan 16, 2020

undo_log.tableName 表名是按 schema.tableName保存的情况加上引号后同样会找不到表 @jsbxyyx

OK

@zjinlei zjinlei closed this Jan 23, 2020
@zjinlei zjinlei reopened this Jan 23, 2020
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jsbxyyx jsbxyyx closed this Feb 12, 2020
@jsbxyyx jsbxyyx reopened this Feb 12, 2020
@zjinlei zjinlei added the Do Not Merge Do not merge into develop label Feb 12, 2020
@l81893521
Copy link
Contributor

l81893521 commented Feb 13, 2020

Test failed. Error Sql:

insert into seata.`account_tbl`(user_id, money, information) values (?, ?, ?)

image

Copy link
Contributor

@l81893521 l81893521 left a 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

@slievrly slievrly removed the Do Not Merge Do not merge into develop label Feb 13, 2020
@slievrly slievrly changed the title bugfix: oracle table name lowercase escape bugfix: escape characters for column and table names Feb 13, 2020
@slievrly slievrly merged commit a9cc606 into apache:develop Feb 13, 2020
@jsbxyyx jsbxyyx deleted the fix_2123 branch February 13, 2020 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpringBoot集成JPA,使用Oracle数据库,在回滚的时候一直报表和视图找不到的错误
7 participants