File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
jdbc/src/main/java/tech/ydb/jdbc Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff 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 () {
Original file line number Diff line number Diff line change 3838import tech .ydb .jdbc .YdbStatement ;
3939import tech .ydb .jdbc .common .ColumnInfo ;
4040import tech .ydb .table .result .ValueReader ;
41+ import tech .ydb .table .values .Type ;
4142import 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
You can’t perform that action at this time.
0 commit comments