#1926 - Postgres (Multi value bind) fix related to empty idIn() expression

This commit is contained in:
rob bygrave
2020-02-01 14:05:12 +13:00
parent 61ed4a5a74
commit 9ad14c5306
3 changed files with 3 additions and 5 deletions
@@ -123,7 +123,7 @@ public class IdInExpression extends NonPrepareExpression {
@Override
public void queryPlanHash(StringBuilder builder) {
builder.append("IdIn[?");
if (!multiValueIdSupported) {
if (!multiValueIdSupported || idCollection.isEmpty()) {
// query plan specific to the number of parameters in the IN clause
builder.append(idCollection.size());
}
@@ -17,8 +17,6 @@ import java.util.List;
class InExpression extends AbstractExpression {
private final boolean not;
/**
@@ -169,7 +167,7 @@ class InExpression extends AbstractExpression {
builder.append("empty");
} else {
builder.append(" ?");
if (!multiValueSupported) {
if (!multiValueSupported || bindValues.isEmpty()) {
// query plan specific to the number of parameters in the IN clause
builder.append(bindValues.size());
}
@@ -116,7 +116,7 @@ class InPairsExpression extends AbstractExpression {
builder.append(property1).append("-");
builder.append(separator).append("-");
builder.append(suffix).append(" ?");
if (!multiValueSupported) {
if (!multiValueSupported || entries.isEmpty()) {
// query plan specific to the number of parameters in the IN clause
builder.append(entries.size());
}