Skip to content

Commit

Permalink
#30 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
doom369 committed Sep 1, 2019
1 parent bce4d0b commit cfc6dae
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public int executeUpdate() throws SQLException {
}

private void setBind(int parameterIndex, String bind, boolean quote) {
binds[parameterIndex - 1] = new ClickHousePreparedStatementParameter(bind, quote);
setBind(parameterIndex, new ClickHousePreparedStatementParameter(bind, quote));
}

private void setBind(int parameterIndex, ClickHousePreparedStatementParameter parameter) {
Expand Down Expand Up @@ -310,16 +310,16 @@ private byte[][] buildBatch() throws SQLException {
String[] batchParams = parameterList[i];
int batchParamsLength = batchParams.length;
for (int j = 0; j < batchParamsLength; j++) {
String pValue = batchParams[j];
if (PARAM_MARKER.equals(pValue)) {
String batchVal = batchParams[j];
if (PARAM_MARKER.equals(batchVal)) {
ClickHousePreparedStatementParameter param = binds[p++];
if (insertBatchMode) {
sb.append(binds[p++].getBatchValue());
batchVal = param.getBatchValue();
} else {
sb.append(binds[p++].getRegularValue());
batchVal = param.getRegularValue();
}
} else {
sb.append(pValue);
}
sb.append(batchVal);
char appendChar = j < batchParamsLength - 1 ? '\t' : '\n';
sb.append(appendChar);
}
Expand Down

0 comments on commit cfc6dae

Please sign in to comment.