Skip to content

Commit 786cabe

Browse files
committed
Fixed Int8/Int16 detecting
1 parent 142cdcd commit 786cabe

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

jdbc/src/main/java/tech/ydb/jdbc/impl/YdbTypesImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private YdbTypesImpl() {
5555
typeBySqlType = new IntObjectHashMap<>(16);
5656
typeBySqlType.put(Types.VARCHAR, PrimitiveType.Text);
5757
typeBySqlType.put(Types.BIGINT, PrimitiveType.Int64);
58-
typeBySqlType.put(Types.TINYINT, PrimitiveType.Int32);
59-
typeBySqlType.put(Types.SMALLINT, PrimitiveType.Int32);
58+
typeBySqlType.put(Types.TINYINT, PrimitiveType.Int8);
59+
typeBySqlType.put(Types.SMALLINT, PrimitiveType.Int16);
6060
typeBySqlType.put(Types.INTEGER, PrimitiveType.Int32);
6161
typeBySqlType.put(Types.REAL, PrimitiveType.Float);
6262
typeBySqlType.put(Types.FLOAT, PrimitiveType.Float);
@@ -77,10 +77,10 @@ private YdbTypesImpl() {
7777
typeByClass.put(long.class, PrimitiveType.Int64);
7878
typeByClass.put(Long.class, PrimitiveType.Int64);
7979
typeByClass.put(BigInteger.class, PrimitiveType.Int64);
80-
typeByClass.put(byte.class, PrimitiveType.Int32);
81-
typeByClass.put(Byte.class, PrimitiveType.Int32);
82-
typeByClass.put(short.class, PrimitiveType.Int32);
83-
typeByClass.put(Short.class, PrimitiveType.Int32);
80+
typeByClass.put(byte.class, PrimitiveType.Int8);
81+
typeByClass.put(Byte.class, PrimitiveType.Int8);
82+
typeByClass.put(short.class, PrimitiveType.Int16);
83+
typeByClass.put(Short.class, PrimitiveType.Int16);
8484
typeByClass.put(int.class, PrimitiveType.Int32);
8585
typeByClass.put(Integer.class, PrimitiveType.Int32);
8686
typeByClass.put(float.class, PrimitiveType.Float);

jdbc/src/test/resources/sql/upsert/simple.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ UPSERT INTO #tableName (
3232
?, -- key
3333
?, -- c_Bool
3434

35-
CAST(? AS Int8), -- c_Int8
36-
CAST(? AS Int16), -- c_Int16
35+
?, -- c_Int8
36+
?, -- c_Int16
3737
?, -- c_Int32
3838
?, -- c_Int64
3939

0 commit comments

Comments
 (0)