aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-05-24 16:30:47 -0400
committerRobert Haas <rhaas@postgresql.org>2017-05-24 16:45:58 -0400
commit85c2b9a15a1d667b1e2cd580da8c1d9fef0af1e8 (patch)
tree60285e850e3b8d24df71a7a4ccd214bd65ed99a1
parent9ae2661fe1fef6b3242ecb39a2f7ffcffb2a4f70 (diff)
downloadpostgresql-85c2b9a15a1d667b1e2cd580da8c1d9fef0af1e8.tar.gz
postgresql-85c2b9a15a1d667b1e2cd580da8c1d9fef0af1e8.zip
Code review of get_qual_for_list.
We need not consider the case where both nulltest1 and nulltest2 are NULL; the partition either accepts nulls or it does not. Jeevan Ladhe. I added an assertion.
-rw-r--r--src/backend/catalog/partition.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/catalog/partition.c b/src/backend/catalog/partition.c
index 7304f6c29ab..7f2fd58462d 100644
--- a/src/backend/catalog/partition.c
+++ b/src/backend/catalog/partition.c
@@ -1383,15 +1383,14 @@ get_qual_for_list(PartitionKey key, PartitionBoundSpec *spec)
if (nulltest1)
result = list_make2(nulltest1, opexpr);
- else if (nulltest2)
+ else
{
Expr *or;
+ Assert(nulltest2 != NULL);
or = makeBoolExpr(OR_EXPR, list_make2(nulltest2, opexpr), -1);
result = list_make1(or);
}
- else
- result = list_make1(opexpr);
return result;
}