postgresql/src/backend
Tom Lane 443fd0540e Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples.
The ROW_MARK_COPY path in EvalPlanQualFetchRowMarks() was just setting
tableoid to InvalidOid, I think on the assumption that the referenced
RTE must be a subquery or other case without a meaningful OID.  However,
foreign tables also use this code path, and they do have meaningful
table OIDs; so failure to set the tuple field can lead to user-visible
misbehavior.  Fix that by fetching the appropriate OID from the range
table.

There's still an issue about whether CTID can ever have a meaningful
value in this case; at least with postgres_fdw foreign tables, it does.
But that is a different problem that seems to require a significantly
different patch --- it's debatable whether postgres_fdw really wants to
use this code path at all.

Simplified version of a patch by Etsuro Fujita, who also noted the
problem to begin with.  The issue can be demonstrated in all versions
having FDWs, so back-patch to 9.1.
2015-03-12 13:39:09 -04:00
..
access Fix memory leaks in GIN index vacuum. 2015-03-12 15:34:32 +01:00
bootstrap Change many routines to return ObjectAddress rather than OID 2015-03-03 14:10:50 -03:00
catalog Support default ACLs in get_object_address 2015-03-11 19:23:47 -03:00
commands Support default ACLs in get_object_address 2015-03-11 19:23:47 -03:00
executor Ensure tableoid reads correctly in EvalPlanQual-manufactured tuples. 2015-03-12 13:39:09 -04:00
foreign Update copyright for 2015 2015-01-06 11:43:47 -05:00
lib Fix a bug in pairing heap removal code. 2015-02-17 22:55:53 +02:00
libpq Use FLEXIBLE_ARRAY_MEMBER in a number of other places. 2015-02-21 16:12:14 -05:00
main Don't require users of src/port/gettimeofday.c to initialize it. 2015-02-21 12:17:04 -05:00
nodes Support flattening of empty-FROM subqueries and one-row VALUES tables. 2015-03-11 23:18:03 -04:00
optimizer Support flattening of empty-FROM subqueries and one-row VALUES tables. 2015-03-11 23:18:03 -04:00
parser Require non-NULL pstate for all addRangeTableEntryFor* functions. 2015-03-11 15:26:43 -04:00
po Translation updates 2015-02-01 23:23:40 -05:00
port Remove the option to service interrupts during PGSemaphoreLock(). 2015-02-03 23:25:00 +01:00
postmaster Add macros wrapping all usage of gcc's __attribute__. 2015-03-11 14:30:01 +01:00
regex Replace a bunch more uses of strncpy() with safer coding. 2015-01-24 13:05:42 -05:00
replication Add macros wrapping all usage of gcc's __attribute__. 2015-03-11 14:30:01 +01:00
rewrite Change many routines to return ObjectAddress rather than OID 2015-03-03 14:10:50 -03:00
snowball Update copyright for 2015 2015-01-06 11:43:47 -05:00
storage Guard against spurious signals in LockBufferForCleanup. 2015-02-23 16:14:14 +01:00
tcop Code cleanup for REINDEX DATABASE/SCHEMA/SYSTEM. 2015-03-08 12:18:43 -04:00
tsearch Update copyright for 2015 2015-01-06 11:43:47 -05:00
utils Make operator precedence follow the SQL standard more closely. 2015-03-11 13:22:52 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
nls.mk Translation updates 2015-02-01 23:23:40 -05:00