Skip to content

Commit 47a4c8f

Browse files
committed
Fix rebase problems
1 parent e100343 commit 47a4c8f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

jdbc/src/main/java/tech/ydb/jdbc/common/ColumnInfo.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public ColumnInfo(String name, Type type) {
2828
this.isOptional = desc.isOptional();
2929
this.ydbType = desc.ydbType();
3030

31-
this.isTimestamp = type == PrimitiveType.Timestamp;
32-
this.isNumber = type == PrimitiveType.Int8 || type == PrimitiveType.Uint8
33-
|| type == PrimitiveType.Int16 || type == PrimitiveType.Uint16
34-
|| type == PrimitiveType.Int32 || type == PrimitiveType.Uint32
35-
|| type == PrimitiveType.Int64 || type == PrimitiveType.Uint64;
36-
this.isNull = type.getKind() == Type.Kind.NULL || type.getKind() == Type.Kind.VOID;
31+
this.isTimestamp = ydbType == PrimitiveType.Timestamp;
32+
this.isNumber = ydbType == PrimitiveType.Int8 || ydbType == PrimitiveType.Uint8
33+
|| ydbType == PrimitiveType.Int16 || ydbType == PrimitiveType.Uint16
34+
|| ydbType == PrimitiveType.Int32 || ydbType == PrimitiveType.Uint32
35+
|| ydbType == PrimitiveType.Int64 || ydbType == PrimitiveType.Uint64;
36+
this.isNull = ydbType.getKind() == Type.Kind.NULL || ydbType.getKind() == Type.Kind.VOID;
3737
}
3838

3939
public String getName() {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import tech.ydb.jdbc.YdbStatement;
3939
import tech.ydb.jdbc.common.ColumnInfo;
4040
import tech.ydb.table.result.ValueReader;
41+
import tech.ydb.table.values.Type;
4142
import tech.ydb.table.values.Value;
4243

4344
/**
@@ -593,8 +594,9 @@ public Value<?> getNativeColumn(int columnIndex) throws SQLException {
593594
if (wasNull) {
594595
return null;
595596
}
596-
// It's just a bug in implementation - actualValue could be optional, but without flag
597-
// I.e. the optional object looks like empty, not null
597+
while (value.getType().getKind() == Type.Kind.OPTIONAL) {
598+
value = value.getOptionalItem();
599+
}
598600
return value.getValue();
599601
}
600602

0 commit comments

Comments
 (0)