postgresql/src
Tom Lane 52f21c5882 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
..
backend Fix incorrect handling of lookahead constraints in pg_regprefix(). 2015-10-19 13:54:53 -07:00
bin Fix "pg_ctl start -w" to test child process status directly. 2015-10-12 18:30:36 -04:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
include Improve memory-usage accounting in regular-expression compiler. 2015-10-16 15:36:17 -04:00
interfaces Fix order of arguments in ecpg generated typedef command. 2015-10-18 10:16:36 +02:00
makefiles Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:49:22 -04:00
pl Translation updates 2015-10-05 11:01:04 -04:00
port Stamp 9.4.5. 2015-10-05 15:12:06 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:35 -04:00
test Fix incorrect handling of lookahead constraints in pg_regprefix(). 2015-10-19 13:54:53 -07:00
timezone Update time zone data files to tzdata release 2015g. 2015-10-02 19:15:57 -04:00
tools Turn install.bat into a pure one line wrapper fort he perl script. 2015-07-07 16:31:52 +03:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Make prove_installcheck remove the old log directory, if any. 2015-10-11 20:36:38 -04:00
Makefile.shlib Unlink static libraries before rebuilding them. 2015-03-01 13:06:33 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00