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: fix oracle column alias cannot find #5819

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#5762](https://github.com/seata/seata/pull/5762)] change some fields type of TableMetaCache to avoid integer overflow
- [[#5769](https://github.com/seata/seata/pull/5769)] fix the problem that the parameter prefix requirement of the setAttachment method in sofa-rpc is not met
- [[#5814](https://github.com/seata/seata/pull/5814)] fix XA transaction start exception and rollback failure
- [[#5819](https://github.com/seata/seata/pull/5814)] fix oracle column alias cannot find

### optimize:
- [[#5804](https://github.com/seata/seata/pull/5804)] optimize docker default timezone
Expand All @@ -31,6 +32,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [dmego](https://github.com/dmego)
- [xingfudeshi](https://github.com/xingfudeshi)
- [hadoop835](https://github.com/hadoop835)
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)


Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
2 changes: 2 additions & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [[#5762](https://github.com/seata/seata/pull/5762)] 修复TableMetaCache的一些字段类型,避免溢出
- [[#5769](https://github.com/seata/seata/pull/5769)] 修复不满足 sofa-rpc 中 setAttachment 方法的参数前缀要求问题
- [[#5814](https://github.com/seata/seata/pull/5814)] 修复druid依赖冲突导致的XA事务开始异常与回滚失败
- [[#5819](https://github.com/seata/seata/pull/5814)] 修复oracle alias 解析异常

### optimize:
- [[#5804](https://github.com/seata/seata/pull/5804)] 优化docker镜像的默认时区
Expand All @@ -31,5 +32,6 @@
- [dmego](https://github.com/dmego)
- [xingfudeshi](https://github.com/xingfudeshi)
- [hadoop835](https://github.com/hadoop835)
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void test_addEscape_byDbType() throws Exception {
cols = new ArrayList<>();
cols.add("SCHEME.\"ID\"");
cols = ColumnUtils.addEscape(cols, JdbcConstants.POSTGRESQL);
Assertions.assertEquals("\"SCHEME\".\"ID\"", cols.get(0));
Assertions.assertEquals("SCHEME.\"ID\"", cols.get(0));

cols = new ArrayList<>();
cols.add("\"SCHEME\".ID");
Expand All @@ -225,7 +225,7 @@ public void test_addEscape_byDbType() throws Exception {
cols = new ArrayList<>();
cols.add("schEme.id");
cols = ColumnUtils.addEscape(cols, JdbcConstants.POSTGRESQL);
Assertions.assertEquals("\"schEme\".\"id\"", cols.get(0));
Assertions.assertEquals("schEme.id", cols.get(0));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ default String addColNameEscape(String colName) {
* @return colName
*/
default String addColNameEscape(String colName, TableMeta tableMeta) {
boolean needEscape = checkIfNeedEscape(colName, tableMeta);
String colNameToCheck = colName;
if (colName.contains(DOT)) {
colNameToCheck = colName.substring(colName.lastIndexOf(DOT) + 1);
}

boolean needEscape = checkIfNeedEscape(colNameToCheck, tableMeta);
if (!needEscape) {
return colName;
}
Expand Down