From b08df9cab777427fdafe633ca7b8abf29817aa55 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 14 Jun 2017 13:13:11 -0400 Subject: Teach predtest.c about CHECK clauses to fix partitioning bugs. In a CHECK clause, a null result means true, whereas in a WHERE clause it means false. predtest.c provided different functions depending on which set of semantics applied to the predicate being proved, but had no option to control what a null meant in the clauses provided as axioms. Add one. Use that in the partitioning code when figuring out whether the validation scan on a new partition can be skipped. Rip out the old logic that attempted (not very successfully) to compensate for the absence of the necessary support in predtest.c. Ashutosh Bapat and Robert Haas, reviewed by Amit Langote and incorporating feedback from Tom Lane. Discussion: http://postgr.es/m/CAFjFpReT_kq_uwU_B8aWDxR7jNGE=P0iELycdq5oupi=xSQTOw@mail.gmail.com --- src/include/optimizer/predtest.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/include/optimizer') diff --git a/src/include/optimizer/predtest.h b/src/include/optimizer/predtest.h index 658a86cc15a..748cd356112 100644 --- a/src/include/optimizer/predtest.h +++ b/src/include/optimizer/predtest.h @@ -17,9 +17,9 @@ #include "nodes/primnodes.h" -extern bool predicate_implied_by(List *predicate_list, - List *restrictinfo_list); -extern bool predicate_refuted_by(List *predicate_list, - List *restrictinfo_list); +extern bool predicate_implied_by(List *predicate_list, List *clause_list, + bool clause_is_check); +extern bool predicate_refuted_by(List *predicate_list, List *clause_list, + bool clause_is_check); #endif /* PREDTEST_H */ -- cgit v1.2.3