aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeMemoize.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2024-07-02 13:41:47 +1200
committerDavid Rowley <drowley@postgresql.org>2024-07-02 13:41:47 +1200
commit65b71dec2d577e9ef7423773a88fdd075f3eb97f (patch)
tree29eb2dbbbb577b2c2ad64b4a21fdc0f660aa5347 /src/backend/executor/nodeMemoize.c
parent0c1aca461481216ff5a0e65538c4880bcf346433 (diff)
downloadpostgresql-65b71dec2d577e9ef7423773a88fdd075f3eb97f.tar.gz
postgresql-65b71dec2d577e9ef7423773a88fdd075f3eb97f.zip
Use TupleDescAttr macro consistently
A few places were directly accessing the attrs[] array. This goes against the standards set by 2cd708452. Fix that. Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeMemoize.c')
-rw-r--r--src/backend/executor/nodeMemoize.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeMemoize.c b/src/backend/executor/nodeMemoize.c
index 45157ffb9c7..df8e3fff082 100644
--- a/src/backend/executor/nodeMemoize.c
+++ b/src/backend/executor/nodeMemoize.c
@@ -175,10 +175,10 @@ MemoizeHash_hash(struct memoize_hash *tb, const MemoizeKey *key)
if (!pslot->tts_isnull[i]) /* treat nulls as having hash key 0 */
{
- FormData_pg_attribute *attr;
+ Form_pg_attribute attr;
uint32 hkey;
- attr = &pslot->tts_tupleDescriptor->attrs[i];
+ attr = TupleDescAttr(pslot->tts_tupleDescriptor, i);
hkey = datum_image_hash(pslot->tts_values[i], attr->attbyval, attr->attlen);
@@ -242,7 +242,7 @@ MemoizeHash_equal(struct memoize_hash *tb, const MemoizeKey *key1,
for (int i = 0; i < numkeys; i++)
{
- FormData_pg_attribute *attr;
+ Form_pg_attribute attr;
if (tslot->tts_isnull[i] != pslot->tts_isnull[i])
{
@@ -255,7 +255,7 @@ MemoizeHash_equal(struct memoize_hash *tb, const MemoizeKey *key1,
continue;
/* perform binary comparison on the two datums */
- attr = &tslot->tts_tupleDescriptor->attrs[i];
+ attr = TupleDescAttr(tslot->tts_tupleDescriptor, i);
if (!datum_image_eq(tslot->tts_values[i], pslot->tts_values[i],
attr->attbyval, attr->attlen))
{