Skip to content

Commit cf55c5d

Browse files
committed
fix some tests : only JDBC tests don't work now
1 parent 226d19c commit cf55c5d

File tree

2 files changed

+5
-1
lines changed
  • fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/metadata
  • fdb-relational-jdbc/src/main/java/com/apple/foundationdb/relational/jdbc

2 files changed

+5
-1
lines changed

fdb-relational-api/src/main/java/com/apple/foundationdb/relational/api/metadata/DataType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public abstract class DataType {
7171
typeCodeJdbcTypeMap.put(Code.ENUM, Types.OTHER);
7272
typeCodeJdbcTypeMap.put(Code.UUID, Types.OTHER);
7373
typeCodeJdbcTypeMap.put(Code.BYTES, Types.BINARY);
74+
typeCodeJdbcTypeMap.put(Code.VERSION, Types.BINARY);
7475
typeCodeJdbcTypeMap.put(Code.STRUCT, Types.STRUCT);
7576
typeCodeJdbcTypeMap.put(Code.ARRAY, Types.ARRAY);
7677
typeCodeJdbcTypeMap.put(Code.NULL, Types.NULL);
@@ -199,7 +200,7 @@ public static DataType getDataTypeFromObject(@Nullable Object obj) {
199200
} else if (obj instanceof String) {
200201
return Primitives.STRING.type();
201202
} else if (obj instanceof UUID) {
202-
return Primitives.LONG.type();
203+
return Primitives.UUID.type();
203204
} else if (obj instanceof RelationalStruct) {
204205
return ((RelationalStruct) obj).getMetaData().getRelationalDataType();
205206
} else if (obj instanceof RelationalArray) {

fdb-relational-jdbc/src/main/java/com/apple/foundationdb/relational/jdbc/ParameterHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public static Parameter ofArray(final Array a) throws SQLException {
136136
}
137137

138138
public static Parameter ofObject(Object x) throws SQLException {
139+
if (x instanceof JDBCArrayImpl) {
140+
return ofArray((Array) x);
141+
}
139142
final int typeCodeFromObject = DataType.getDataTypeFromObject(x).getJdbcSqlCode();
140143
switch (typeCodeFromObject) {
141144
case Types.BIGINT:

0 commit comments

Comments
 (0)