Skip to content

Commit

Permalink
bugfix: fix oracle column alias cannot find (#6086)
Browse files Browse the repository at this point in the history
  • Loading branch information
slievrly authored Nov 27, 2023
1 parent 3702ff8 commit 2122c6d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Add changes here for all PR submitted to the 2.x branch.

### bugfix:
- [[#6075](https://github.com/seata/seata/pull/6075)] fix missing table alias for on update column of image SQL
- [[#6086](https://github.com/seata/seata/pull/6086)] fix oracle column alias cannot find
- [[#6085](https://github.com/seata/seata/pull/6085)] fix jdk9+ compile error

### optimize:
- [[#6061](https://github.com/seata/seata/pull/6061)] merge the rpcMergeMessageSend threads of rm and tm and increase the thread hibernation duration
Expand All @@ -26,5 +28,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [ptyin](https://github.com/ptyin)
- [laywin](https://github.com/laywin)
- [imcmai](https://github.com/imcmai)
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)
- [funky-eyes](https://github.com/funky-eyes)

Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
4 changes: 4 additions & 0 deletions changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

### bugfix:
- [[#6075](https://github.com/seata/seata/pull/6075)] 修复镜像SQL对于on update列没有添加表别名的问题
- [[#6086](https://github.com/seata/seata/pull/6086)] 修复oracle alias 解析异常
- [[#6085](https://github.com/seata/seata/pull/6085)] 修复jdk9+版本编译后,引入后ByteBuffer#flip NoSuchMethodError的问题

### optimize:
- [[#6061](https://github.com/seata/seata/pull/6061)] 合并rm和tm的rpcMergeMessageSend线程,增加线程休眠时长
Expand All @@ -27,6 +29,8 @@
- [ptyin](https://github.com/ptyin)
- [laywin](https://github.com/laywin)
- [imcmai](https://github.com/imcmai)
- [DroidEye2ONGU](https://github.com/DroidEye2ONGU)
- [funky-eyes](https://github.com/funky-eyes)


同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,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 @@ -255,7 +255,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 @@ -76,7 +76,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

0 comments on commit 2122c6d

Please sign in to comment.