Re: fast defaults in heap_getattr vs heap_deform_tuple
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2019-02-06T01:44:38Z
Lists: pgsql-hackers
On 2019-Feb-05, Andres Freund wrote: > @@ -82,7 +80,7 @@ static Datum getmissingattr(TupleDesc tupleDesc, int attnum, bool *isnull); > /* > * Return the missing value of an attribute, or NULL if there isn't one. > */ > -static Datum > +Datum > getmissingattr(TupleDesc tupleDesc, > int attnum, bool *isnull) This is a terrible name for an exported function -- let's change it before it gets exported. Heck, even heap_getmissingattr() would be better. I notice that with this patch, heap_getattr() obtains a new Assert() that the attr being fetched is no further than tupledesc->natts. It previously just returned null for that case. Maybe we should change it so that it returns null if an attr beyond end-of-array is fetched? (I think in non-assert builds, it would dereference past the AttrMissing array.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix heap_getattr() handling of fast defaults.
- 297d627e074a 11.2 landed
- 171e0418b03d 12.0 landed
-
Fast default trigger and expand_tuple fixes
- 7636e5c60fea 12.0 cited