OSDN Git Service

Fix ExecEvalArrayRef to pass down the old value of the array element or slice
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 18:41:47 +0000 (18:41 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 18:41:47 +0000 (18:41 +0000)
commit11d5ba97f83037b8f69887f6d387f7da7276f991
treec3cd41836c21a0be699c362c69c2ea15358781c9
parent3e87ba6ef7ee381c46af6fa3871c366b947d87da
Fix ExecEvalArrayRef to pass down the old value of the array element or slice
being assigned to, in case the expression to be assigned is a FieldStore that
would need to modify that value.  The need for this was foreseen some time
ago, but not implemented then because we did not have arrays of composites.
Now we do, but the point evidently got overlooked in that patch.  Net result
is that updating a field of an array element doesn't work right, as
illustrated if you try the new regression test on an unpatched backend.
Noted while experimenting with EXPLAIN VERBOSE, which has also got some issues
in this area.

Backpatch to 8.3, where arrays of composites were introduced.
src/backend/executor/execQual.c
src/test/regress/expected/arrays.out
src/test/regress/sql/arrays.sql