postgresql/src
Tom Lane 462bd95705 Fix planning of SELECT FOR UPDATE on child table with partial index.
Ordinarily we can omit checking of a WHERE condition that matches a partial
index's condition, when we are using an indexscan on that partial index.
However, in SELECT FOR UPDATE we must include the "redundant" filter
condition in the plan so that it gets checked properly in an EvalPlanQual
recheck.  The planner got this mostly right, but improperly omitted the
filter condition if the index in question was on an inheritance child
table.  In READ COMMITTED mode, this could result in incorrectly returning
just-updated rows that no longer satisfy the filter condition.

The cause of the error is using get_parse_rowmark() when get_plan_rowmark()
is what should be used during planning.  In 9.3 and up, also fix the same
mistake in contrib/postgres_fdw.  It's currently harmless there (for lack
of inheritance support) but wrong is wrong, and the incorrect code might
get copied to someplace where it's more significant.

Report and fix by Kyotaro Horiguchi.  Back-patch to all supported branches.
2014-12-11 21:02:25 -05:00
..
backend Fix planning of SELECT FOR UPDATE on child table with partial index. 2014-12-11 21:02:25 -05:00
bin Fix assorted confusion between Oid and int32. 2014-12-11 15:41:15 -05:00
common Small message fixes 2014-08-09 00:07:00 -04:00
include REINDEX SCHEMA 2014-12-09 00:28:00 +09:00
interfaces Put SSL_pending() call behind the new internal SSL API. 2014-12-01 17:45:04 +02:00
makefiles Revert haphazard pgxs makefile changes 2014-12-04 08:07:59 -05:00
pl Improve error messages for malformed array input strings. 2014-12-02 18:23:27 -05:00
port Windows: use GetSystemTimePreciseAsFileTime if available 2014-12-08 23:36:06 +09:00
template Remove Alpha and Tru64 support. 2014-06-28 21:46:15 +02:00
test Fix corner case where SELECT FOR UPDATE could return a row twice. 2014-12-11 19:37:36 -05:00
timezone Update time zone data files to tzdata release 2014j. 2014-11-17 12:09:12 -05:00
tools Update comments in find_typedef. 2014-11-18 15:51:45 -05:00
tutorial Adjust blank lines around PG_MODULE_MAGIC defines, for consistency 2014-07-10 14:02:08 -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 Fix PGXS vpath build when PostgreSQL is built with vpath 2014-12-04 17:02:02 -05:00
Makefile.shlib Clarify .def file comments. 2014-11-02 21:43: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