aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_error.cpp
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-21 18:30:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-21 18:30:46 -0400
commit0f0deb71948321efc89cf4e3e8cbd9750cc9e566 (patch)
tree6ef66b85878cb9c9791460d6c4fbbb8d30556ef1 /src/backend/jit/llvm/llvmjit_error.cpp
parent27ba260c739e4e10e28688993208c3ffa1b469ab (diff)
downloadpostgresql-0f0deb71948321efc89cf4e3e8cbd9750cc9e566.tar.gz
postgresql-0f0deb71948321efc89cf4e3e8cbd9750cc9e566.zip
Improve predtest.c's handling of cases with NULL-constant inputs.
Currently, if operator_predicate_proof() is given an operator clause like "something op NULL", it just throws up its hands and reports it can't prove anything. But we can often do better than that, if the operator is strict, because then we know that the clause returns NULL overall. Depending on whether we're trying to prove or refute something, and whether we need weak or strong semantics for NULL, this may be enough to prove the implication, especially when we rely on the standard rule that "false implies anything". In particular, this lets us do something useful with questions like "does X IN (1,3,5,NULL) imply X <= 5?" The null entry in the IN list can effectively be ignored for this purpose, but the proof rules were not previously smart enough to deduce that. This patch is by me, but it owes something to previous work by Amit Langote to try to solve problems of the form mentioned. Thanks also to Emre Hasegeli and Ashutosh Bapat for review. Discussion: https://postgr.es/m/3bad48fc-f257-c445-feeb-8a2b2fb622ba@lab.ntt.co.jp
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_error.cpp')
0 files changed, 0 insertions, 0 deletions