| From: | David Rowley <drowley(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix tuple deforming with virtual generated columns |
| Date: | 2026-06-06 04:46:44 |
| Message-ID: | E1wVivk-001Htm-16@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix tuple deforming with virtual generated columns
TupleDescFinalize() failed to take into account virtual generated
columns, which are always stored as NULL in tuples. TupleDescFinalize()
didn't check for this, and that could result in attcacheoff being set for
and beyond virtual generated columns. Also, the TupleDesc's
firstNonGuaranteedAttr could also be set incorrectly, which could result
in the tuple deformation function deforming without checking for NULLs,
and deforming using incorrectly cached offsets.
This could result in tuples being deformed incorrectly, which could
result in incorrect results, ERRORs or possibly a crash.
This has been broken since c456e39113.
Author: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reported-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: ChangAo Chen <cca5507(at)qq(dot)com>
Reviewed-by: David Rowley <dgrowleyml(at)gmail(dot)com>
Discussion: https://postgr.es/m/A4BC563C-0CA3-4EF3-952A-EA41F9E5BF1E%40gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/89eafad297a9b01ad77cfc1ab93a433e0af894b0
Modified Files
--------------
src/backend/access/common/tupdesc.c | 13 +++++++++++--
src/backend/executor/execTuples.c | 7 +++++++
2 files changed, 18 insertions(+), 2 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Michael Paquier | 2026-06-05 23:53:35 | pgsql: Lift shutdown assertion in pgstats for WAL senders |