]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Update JIT tuple deforming code for virtual generated columns master github/master
authorDavid Rowley <drowley@postgresql.org>
Fri, 19 Jun 2026 03:26:18 +0000 (15:26 +1200)
committerDavid Rowley <drowley@postgresql.org>
Fri, 19 Jun 2026 03:26:18 +0000 (15:26 +1200)
commitdc5116780846951a409d788479a9e9fa6edd9f07
tree3962a4bdcf44ccd79f167b828276ec04cf12939f
parent8d22f5232458278aa62a1769758a8aa6b1dfe290
Update JIT tuple deforming code for virtual generated columns

The JIT deforming code contains an optimization that determines which
columns are guaranteed to exist in the tuple.  That's used to allow
skipping of reading the tuple's natts when the code only needs to deform
attributes that are guaranteed to always exist in all tuples.  83ea6c540
missed updating this code to account for VIRTUAL generated columns.
These are stored as NULLs in the tuple, but may be defined as NOT NULL.
This could result in the code thinking more columns are guaranteed to
exist than actually do.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Backpatch-through: 18
Discussion: https://postgr.es/m/1151393.1781734980@sss.pgh.pa.us
src/backend/jit/llvm/llvmjit_deform.c
src/test/regress/expected/generated_stored.out
src/test/regress/expected/generated_virtual.out
src/test/regress/sql/generated_stored.sql
src/test/regress/sql/generated_virtual.sql