postgresql/src/backend
Tom Lane 9f1e642d50 Fix incorrect handling of lookahead constraints in pg_regprefix().
pg_regprefix was doing nothing with lookahead constraints, which would
be fine if it were the right kind of nothing, but it isn't: we have to
terminate our search for a fixed prefix, not just pretend the LACON arc
isn't there.  Otherwise, if the current state has both a LACON outarc and a
single plain-color outarc, we'd falsely conclude that the color represents
an addition to the fixed prefix, and generate an extracted index condition
that restricts the indexscan too much.  (See added regression test case.)

Terminating the search is conservative: we could traverse the LACON arc
(thus assuming that the constraint can be satisfied at runtime) and then
examine the outarcs of the linked-to state.  But that would be a lot more
work than it seems worth, because writing a LACON followed by a single
plain character is a pretty silly thing to do.

This makes a difference only in rather contrived cases, but it's a bug,
so back-patch to all supported branches.
2015-10-19 13:54:53 -07:00
..
access Add a C API for parallel heap scans. 2015-10-16 17:33:18 -04:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog ALTER TABLE .. FORCE ROW LEVEL SECURITY 2015-10-04 21:05:08 -04:00
commands Mark more functions parallel-restricted or parallel-unsafe. 2015-10-16 11:49:31 -04:00
executor Rewrite interaction of parallel mode with parallel executor support. 2015-10-16 11:56:02 -04:00
foreign Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
lib Avoid use of float arithmetic in bipartite_match.c. 2015-08-23 13:02:18 -04:00
libpq Don't send protocol messages to a shm_mq that no longer exists. 2015-10-16 09:42:33 -04:00
main Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:21 -04:00
nodes Allow FDWs to push down quals without breaking EvalPlanQual rechecks. 2015-10-15 13:00:40 -04:00
optimizer Prohibit parallel query when the isolation level is serializable. 2015-10-16 11:58:27 -04:00
parser Have CREATE TABLE LIKE add OID column if any LIKEd table has one 2015-10-05 21:19:16 -04:00
po Translation updates 2015-06-28 23:56:55 -04:00
port On Windows, ensure shared memory handle gets closed if not being used. 2015-10-13 11:21:33 -04:00
postmaster On Windows, ensure shared memory handle gets closed if not being used. 2015-10-13 11:21:33 -04:00
regex Fix incorrect handling of lookahead constraints in pg_regprefix(). 2015-10-19 13:54:53 -07:00
replication Remove more volatile qualifiers. 2015-10-06 15:45:02 -04:00
rewrite Apply SELECT policies in INSERT/UPDATE+RETURNING 2015-10-05 07:55:13 -04:00
snowball Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
storage Remove volatile qualifiers from proc.c and procarray.c 2015-10-16 14:20:36 -04:00
tcop Remove set_latch_on_sigusr1 flag. 2015-10-09 14:31:04 -04:00
tsearch pgindent run for 9.5 2015-05-23 21:35:49 -04:00
utils Remove volatile qualifiers from dynahash.c, shmem.c, and sinvaladt.c 2015-10-16 14:14:15 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Revert "Have dtrace depend on object files directly, not objfiles.txt" 2015-10-15 13:16:03 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00