diff --git a/expected/trigger_on_view.out b/expected/trigger_on_view.out index 295a7fdc..aad47370 100644 --- a/expected/trigger_on_view.out +++ b/expected/trigger_on_view.out @@ -157,8 +157,7 @@ CONTEXT: PL/pgSQL function city_update() line 9 at RAISE city_id | city_name | population | country_name | continent ---------+-----------+------------+--------------+----------- 1 | Tokyo | 13010279 | Japan | Asia - 1 | Tokyo | 13010279 | | -(2 rows) +(1 row) UPDATE city_view SET country_name = 'UK' WHERE city_name = 'New York' RETURNING *; city_id | city_name | population | country_name | continent @@ -170,23 +169,20 @@ CONTEXT: PL/pgSQL function city_update() line 9 at RAISE city_id | city_name | population | country_name | continent ---------+-----------+------------+--------------+--------------- 123456 | New York | 8391881 | USA | North America - 123456 | New York | 8391881 | USA | North America -(2 rows) +(1 row) UPDATE city_view SET continent = 'EU' WHERE continent = 'Europe' RETURNING *; city_id | city_name | population | country_name | continent ---------+------------+------------+--------------+----------- 234567 | Birmingham | 1016800 | UK | Europe - 123456 | New York | | UK | Europe -(2 rows) +(1 row) UPDATE city_view v1 SET country_name = v2.country_name FROM city_view v2 WHERE v2.city_name = 'Birmingham' AND v1.city_name = 'London' RETURNING *; city_id | city_name | population | country_name | continent | city_id | city_name | population | country_name | continent ---------+-----------+------------+--------------+-----------+---------+------------+------------+--------------+----------- 2 | London | 7556900 | UK | Europe | 234567 | Birmingham | 1016800 | UK | Europe - 2 | London | 7556900 | UK | Europe | 234567 | Birmingham | 1016800 | UK | Europe -(2 rows) +(1 row) -- DELETE .. RETURNING diff --git a/src/access/pg_tdeam.c b/src/access/pg_tdeam.c index 888ace94..f40b9b78 100644 --- a/src/access/pg_tdeam.c +++ b/src/access/pg_tdeam.c @@ -3012,6 +3012,7 @@ pg_tde_update(Relation relation, ItemPointer otid, HeapTuple newtup, ItemId lp; HeapTupleData oldtup; HeapTupleData oldtup2; + void* oldtupptr; HeapTuple heaptup; HeapTuple old_key_tuple = NULL; bool old_key_copied = false; @@ -3111,6 +3112,7 @@ pg_tde_update(Relation relation, ItemPointer otid, HeapTuple newtup, */ oldtup.t_tableOid = RelationGetRelid(relation); oldtup.t_data = (HeapTupleHeader) PageGetItem(page, lp); + oldtupptr = oldtup.t_data; oldtup.t_len = ItemIdGetLength(lp); oldtup.t_self = *otid; /* decrypt the old tuple */ @@ -3186,6 +3188,8 @@ pg_tde_update(Relation relation, ItemPointer otid, HeapTuple newtup, * use otid anymore. */ + oldtup.t_data = oldtupptr; + l2: checked_lockers = false; locker_remains = false;