Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion java/client/src/main/java/io/vitess/client/Proto.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,13 @@ protected static class TypedValue {
this.type = Query.Type.VARBINARY;
this.value = ByteString.copyFrom((byte[]) value);
} else if (value instanceof Integer || value instanceof Long || value instanceof Short
|| value instanceof Byte || value instanceof BigInteger) {
|| value instanceof Byte ) {
// Int32, Int64, Short, Byte
this.type = Query.Type.INT64;
this.value = ByteString.copyFromUtf8(value.toString());
} else if (value instanceof BigInteger) {
this.type = Query.Type.VARCHAR;
this.value = ByteString.copyFromUtf8(value.toString());
} else if (value instanceof UnsignedLong) {
// Uint64
this.type = Query.Type.UINT64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static Collection<Object[]> testParams() {
BindVariable.newBuilder().setType(Query.Type.DECIMAL)
.setValue(ByteString.copyFromUtf8("0.000000000123456789123456789")).build()},
{new BigInteger("123456789123456789"),
BindVariable.newBuilder().setType(Query.Type.INT64)
BindVariable.newBuilder().setType(Query.Type.VARCHAR)
.setValue(ByteString.copyFromUtf8("123456789123456789")).build()},
// List of Int
{Arrays.asList(1, 2, 3),
Expand Down