parent
f9451a90a9
commit
bf84de2fc4
|
@ -114,7 +114,7 @@ public abstract class ProtoUtils {
|
|||
public static <T> T readValue(DataInput in, int type) throws IOException {
|
||||
Object result;
|
||||
byte hasNext = in.readByte();
|
||||
if (hasNext == 0) {
|
||||
if (hasNext == 0) { // NOCOMMIT feels like a bitmask at the start of the row would be better.
|
||||
return null;
|
||||
}
|
||||
switch (type) {
|
||||
|
|
|
@ -120,7 +120,7 @@ public class HttpJdbcClient implements Closeable {
|
|||
// read the data
|
||||
// allocate columns
|
||||
int rows = in.readInt();
|
||||
page.resize(rows);
|
||||
page.resize(rows); // NOCOMMIT I believe this is duplicated with readData
|
||||
readData(in, page, rows);
|
||||
|
||||
return response.requestId;
|
||||
|
@ -192,6 +192,7 @@ public class HttpJdbcClient implements Closeable {
|
|||
|
||||
Response response = ProtoUtils.readResponse(in, header);
|
||||
|
||||
// NOCOMMIT why not move the throw login into readResponse?
|
||||
if (response instanceof ExceptionResponse) {
|
||||
ExceptionResponse ex = (ExceptionResponse) response;
|
||||
throw SqlExceptionType.asException(ex.asSql, ex.message);
|
||||
|
@ -201,6 +202,7 @@ public class HttpJdbcClient implements Closeable {
|
|||
throw new JdbcException("%s", error.stack);
|
||||
}
|
||||
if (response instanceof Response) {
|
||||
// NOCOMMIT I'd feel more comfortable either returning Response and passing the class in and calling responseClass.cast(response)
|
||||
return (R) response;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue