postgresql/src/include/executor
Tom Lane 5b8728cd7f Fix NULLIF()'s handling of read-write expanded objects.
If passed a read-write expanded object pointer, the EEOP_NULLIF
code would hand that same pointer to the equality function
and then (unless equality was reported) also return the same
pointer as its value.  This is no good, because a function that
receives a read-write expanded object pointer is fully entitled
to scribble on or even delete the object, thus corrupting the
NULLIF output.  (This problem is likely unobservable with the
equality functions provided in core Postgres, but it's easy to
demonstrate with one coded in plpgsql.)

To fix, make sure the pointer passed to the equality function
is read-only.  We can still return the original read-write
pointer as the NULLIF result, allowing optimization of later
operations.

Per bug #18722 from Alexander Lakhin.  This has been wrong
since we invented expanded objects, so back-patch to all
supported branches.

Discussion: https://postgr.es/m/18722-fd9e645448cc78b4@postgresql.org
2024-11-25 18:09:09 -05:00
..
execAsync.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execdebug.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execdesc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execExpr.h Fix NULLIF()'s handling of read-write expanded objects. 2024-11-25 18:09:09 -05:00
execParallel.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
execPartition.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor.h Log the conflicts while applying changes in logical replication. 2024-08-20 08:35:11 +05:30
functions.h Fix confusion about the return rowtype of SQL-language procedures. 2024-03-12 18:16:25 -04:00
hashjoin.h Speed up Hash Join by making ExprStates support hashing 2024-08-20 13:38:22 +12:00
instrument.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeAgg.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeAppend.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapAnd.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapHeapscan.h Show Parallel Bitmap Heap Scan worker stats in EXPLAIN ANALYZE 2024-07-09 12:15:47 +12:00
nodeBitmapIndexscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeBitmapOr.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeCtescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeCustom.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeForeignscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeFunctionscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGather.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGatherMerge.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeGroup.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeHash.h Speed up Hash Join by making ExprStates support hashing 2024-08-20 13:38:22 +12:00
nodeHashjoin.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIncrementalSort.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIndexonlyscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeIndexscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeLimit.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeLockRows.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMaterial.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMemoize.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMergeAppend.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeMergejoin.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeModifyTable.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeNamedtuplestorescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeNestloop.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeProjectSet.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeRecursiveunion.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeResult.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSamplescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSeqscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSetOp.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSort.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSubplan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeSubqueryscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTableFuncscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTidrangescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeTidscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeUnique.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeValuesscan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeWindowAgg.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeWorktablescan.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
spi.h Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
spi_priv.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tablefunc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tqueue.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tstoreReceiver.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tuptable.h Add TupleTableSlotOps.is_current_xact_tuple() method 2024-03-21 23:00:43 +02:00