diff --git a/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java b/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java index 5764737793da20b490561cbdfc7d75f51cb13526..b03294ac4e8dac9acd7406ccb5ebdde258ab6eca 100644 --- a/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java +++ b/sharding-core/sharding-core-execute/src/main/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtil.java @@ -52,9 +52,7 @@ public final class QueryResultUtil { case Types.BOOLEAN: return resultSet.getBoolean(columnIndex); case Types.TINYINT: - return resultSet.getByte(columnIndex); case Types.SMALLINT: - return resultSet.getShort(columnIndex); case Types.INTEGER: return resultSet.getInt(columnIndex); case Types.BIGINT: diff --git a/sharding-core/sharding-core-execute/src/test/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtilTest.java b/sharding-core/sharding-core-execute/src/test/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtilTest.java index b17519d57745c5533c40bfdd4f803489443777a5..7ce0b72cbbe67dfb760698b822deee97097f90b4 100644 --- a/sharding-core/sharding-core-execute/src/test/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtilTest.java +++ b/sharding-core/sharding-core-execute/src/test/java/org/apache/shardingsphere/core/execute/sql/execute/result/QueryResultUtilTest.java @@ -74,15 +74,15 @@ public final class QueryResultUtilTest { @Test public void assertGetValueByTinyint() throws SQLException { when(resultSetMetaData.getColumnType(1)).thenReturn(Types.TINYINT); - when(resultSet.getByte(1)).thenReturn(Byte.MAX_VALUE); - assertThat((byte) QueryResultUtil.getValue(resultSet, 1), is(Byte.MAX_VALUE)); + when(resultSet.getInt(1)).thenReturn(Integer.MAX_VALUE); + assertThat((int) QueryResultUtil.getValue(resultSet, 1), is(Integer.MAX_VALUE)); } @Test public void assertGetValueBySmallint() throws SQLException { when(resultSetMetaData.getColumnType(1)).thenReturn(Types.SMALLINT); - when(resultSet.getShort(1)).thenReturn(Short.MAX_VALUE); - assertThat((short) QueryResultUtil.getValue(resultSet, 1), is(Short.MAX_VALUE)); + when(resultSet.getInt(1)).thenReturn(Integer.MAX_VALUE); + assertThat((int) QueryResultUtil.getValue(resultSet, 1), is(Integer.MAX_VALUE)); } @Test