Skip to content

Commit 9f09e7d

Browse files
committed
remove UInt from JDBC type mapping
1 parent c3bec5f commit 9f09e7d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/JdbcUtils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ public class JdbcUtils {
4040
private static Map<ClickHouseDataType, SQLType> generateTypeMap() {
4141
Map<ClickHouseDataType, SQLType> map = new TreeMap<>(); // TreeMap is used to sort the keys in natural order so FixedString will be before String :-) (type match should be more accurate)
4242
map.put(ClickHouseDataType.Int8, JDBCType.TINYINT);
43-
map.put(ClickHouseDataType.UInt8, JDBCType.TINYINT);
4443
map.put(ClickHouseDataType.Int16, JDBCType.SMALLINT);
45-
map.put(ClickHouseDataType.UInt16, JDBCType.SMALLINT);
4644
map.put(ClickHouseDataType.Int32, JDBCType.INTEGER);
47-
map.put(ClickHouseDataType.UInt32, JDBCType.BIGINT);
4845
map.put(ClickHouseDataType.Int64, JDBCType.BIGINT);
4946
map.put(ClickHouseDataType.Float32, JDBCType.FLOAT);
5047
map.put(ClickHouseDataType.Float64, JDBCType.DOUBLE);

jdbc-v2/src/test/java/com/clickhouse/jdbc/DataTypeTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void testIntegerTypes() throws SQLException {
9292
long int64 = rand.nextLong();
9393
BigInteger int128 = new BigInteger(127, rand);
9494
BigInteger int256 = new BigInteger(255, rand);
95-
int uint8 = rand.nextInt(256);
95+
Short uint8 = Integer.valueOf(rand.nextInt(256)).shortValue();
9696
int uint16 = rand.nextInt(65536);
9797
long uint32 = rand.nextInt() & 0xFFFFFFFFL;
9898
BigInteger uint64 = BigInteger.valueOf(rand.nextLong(Long.MAX_VALUE));
@@ -179,7 +179,7 @@ public void testIntegerTypes() throws SQLException {
179179
assertEquals(rs.getObject("int64"), -9223372036854775808L);
180180
assertEquals(rs.getObject("int128"), new BigInteger("-170141183460469231731687303715884105728"));
181181
assertEquals(rs.getObject("int256"), new BigInteger("-57896044618658097711785492504343953926634992332820282019728792003956564819968"));
182-
assertEquals(rs.getObject("uint8"), 0);
182+
assertEquals(rs.getObject("uint8"), Short.valueOf("0"));
183183
assertEquals(rs.getObject("uint16"), 0);
184184
assertEquals(rs.getObject("uint32"), 0L);
185185
assertEquals(rs.getObject("uint64"), new BigInteger("0"));
@@ -193,7 +193,7 @@ public void testIntegerTypes() throws SQLException {
193193
assertEquals(rs.getObject("int64"), 9223372036854775807L);
194194
assertEquals(rs.getObject("int128"), new BigInteger("170141183460469231731687303715884105727"));
195195
assertEquals(rs.getObject("int256"), new BigInteger("57896044618658097711785492504343953926634992332820282019728792003956564819967"));
196-
assertEquals(rs.getObject("uint8"), 255);
196+
assertEquals(rs.getObject("uint8"), Short.valueOf("255"));
197197
assertEquals(rs.getObject("uint16"), 65535);
198198
assertEquals(rs.getObject("uint32"), 4294967295L);
199199
assertEquals(rs.getObject("uint64"), new BigInteger("18446744073709551615"));

0 commit comments

Comments
 (0)