]> git.ipfire.org Git - thirdparty/postgresql.git/commit
In predtest.c, install a limit on the number of branches we will process in
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Nov 2008 23:08:50 +0000 (23:08 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Nov 2008 23:08:50 +0000 (23:08 +0000)
commit734b27dd777f014f5aa40cb5e7097be2ec0e1d88
treec7e223324398bf82e35f278e13e4e0413dafecf4
parentdc1b318d13eb56d729a7e6fcd2cd12295ea810dd
In predtest.c, install a limit on the number of branches we will process in
AND, OR, or equivalent clauses: if there are too many (more than 100) just
exit without proving anything.  This ensures that we don't spend O(N^2) time
trying (and most likely failing) to prove anything about very long IN lists
and similar cases.

Also, install a couple of CHECK_FOR_INTERRUPTS calls to ensure that a long
proof attempt can be interrupted.

Per gripe from Sergey Konoplev.

Back-patch the whole patch to 8.2 and just the CHECK_FOR_INTERRUPTS addition
to 8.1.  (The rest of the patch doesn't apply cleanly, and since 8.1 doesn't
show the complained-of behavior anyway, it doesn't seem necessary to work
hard on it.)
src/backend/optimizer/util/predtest.c