Skip to content

Commit 8e3c0ee

Browse files
hanahmilygaohongtao
authored and
gaohongtao
committed
fix #176 ResultSet's state of wasNull mismatch the actual situation
1 parent aee7517 commit 8e3c0ee

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/merger/resultset/memory/AbstractMemoryResultSet.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ public Object getObject(final int columnIndex) throws SQLException {
102102
Preconditions.checkState(null != currentRow, "After end of result set");
103103
Preconditions.checkArgument(currentRow.inRange(columnIndex), String.format("Column Index %d out of range", columnIndex));
104104
Object result = currentRow.getCell(columnIndex);
105-
if (null == result) {
106-
wasNull = true;
107-
}
105+
wasNull = null == result;
108106
return result;
109107
}
110108

@@ -127,7 +125,6 @@ public String getString(final String columnLabel) throws SQLException {
127125
public boolean getBoolean(final int columnIndex) throws SQLException {
128126
Object cell = getObject(columnIndex);
129127
if (null == cell) {
130-
wasNull = true;
131128
return false;
132129
}
133130
return (cell instanceof Boolean) ? (Boolean) cell : Boolean.valueOf(cell.toString());
@@ -223,7 +220,6 @@ public BigDecimal getBigDecimal(final String columnLabel) throws SQLException {
223220
public byte[] getBytes(final int columnIndex) throws SQLException {
224221
String value = getString(columnIndex);
225222
if (null == value) {
226-
wasNull = true;
227223
return null;
228224
}
229225
return value.getBytes();
@@ -299,7 +295,6 @@ public Timestamp getTimestamp(final String columnLabel, final Calendar cal) thro
299295
public URL getURL(final int columnIndex) throws SQLException {
300296
String value = getString(columnIndex);
301297
if (null == value) {
302-
wasNull = true;
303298
return null;
304299
}
305300
try {

sharding-jdbc-doc/content/post/release_notes.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
2-
3-
4-
51
+++
62
date = "2016-02-05T17:03:18+08:00"
73
title = "Release Notes"
@@ -19,12 +15,12 @@ weight = 1
1915
[ISSUE #163](https://github.com/dangdangdotcom/sharding-jdbc/issues/163)
2016
[ISSUE #171](https://github.com/dangdangdotcom/sharding-jdbc/issues/171)
2117
[ISSUE #172](https://github.com/dangdangdotcom/sharding-jdbc/issues/172)
22-
23-
## 1.3.3
24-
18+
2519
### 缺陷修正
20+
21+
1. [ISSUE #176](https://github.com/dangdangdotcom/sharding-jdbc/issues/176) AbstractMemoryResultSet对SQL的wasNull实现有问题
2622

27-
1. [ISSUE #166](https://github.com/dangdangdotcom/sharding-jdbc/issues/166) druid数据源stat过滤器多线程报错
23+
## 1.3.3
2824

2925
### 功能提升
3026

@@ -37,6 +33,7 @@ weight = 1
3733
1. [ISSUE #122](https://github.com/dangdangdotcom/sharding-jdbc/issues/122) bed的fail重试问题
3834
1. [ISSUE #152](https://github.com/dangdangdotcom/sharding-jdbc/issues/152) 可能同一个connection多线程导致问题
3935
1. [ISSUE #150](https://github.com/dangdangdotcom/sharding-jdbc/issues/150) 与最新SQLserver jdbc驱动兼容问题
36+
1. [ISSUE #166](https://github.com/dangdangdotcom/sharding-jdbc/issues/166) druid数据源stat过滤器多线程报错
4037

4138
## 1.3.2
4239

0 commit comments

Comments
 (0)