Skip to content

Commit

Permalink
fixed at 2.0.0.m1
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 9, 2017
1 parent b4dd329 commit bb22fa3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.0.0.M1

### 缺陷修正

1. [ISSUE #387](https://github.com/shardingjdbc/sharding-jdbc/issues/387) 当函数+列名中存在'`'防止关键字时处理出错

## 1.5.4.1

### 缺陷修正
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package io.shardingjdbc.core.merger.common;

import io.shardingjdbc.core.merger.ResultSetMerger;
import io.shardingjdbc.core.util.SQLUtil;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

Expand Down Expand Up @@ -61,7 +62,7 @@ public Object getValue(final String columnLabel, final Class<?> type) throws SQL
if (Blob.class == type || Clob.class == type || Reader.class == type || InputStream.class == type || SQLXML.class == type) {
throw new SQLFeatureNotSupportedException();
}
Object result = currentResultSetRow.getCell(labelAndIndexMap.get(columnLabel));
Object result = currentResultSetRow.getCell(labelAndIndexMap.containsKey(columnLabel) ? labelAndIndexMap.get(columnLabel) : labelAndIndexMap.get(SQLUtil.getExactlyValue(columnLabel)));
wasNull = null == result;
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@
<data expected="select_aggregate/SelectAvg.xml" />
</sharding-rule>
</sql>
<sql id="assertSelectCountForSpecialSymbol">
<sharding-rule>
<data expected="select_aggregate/SelectCount.xml" />
</sharding-rule>
</sql>
</sqls>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<sql id="assertSelectMax" value="SELECT MAX(user_id) AS max_user_id FROM t_order" />
<sql id="assertSelectMin" value="SELECT MIN(user_id) AS min_user_id FROM t_order" />
<sql id="assertSelectAvg" value="SELECT AVG(user_id) AS user_id_avg FROM t_order" />
<sql id="assertSelectCountForSpecialSymbol" value="SELECT COUNT(`user_id`) AS orders_count FROM t_order" type="MySQL" />
</sqls>

0 comments on commit bb22fa3

Please sign in to comment.