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 <[email protected]> Reported-by: Chao Li <[email protected]> Reviewed-by: ChangAo Chen <[email protected]> Reviewed-by: David Rowley <[email protected]> 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(-)
