Make regress function make_tuple_indirect() able to handle plain attributes
authorMichael Paquier <[email protected]>
Mon, 17 Jun 2024 05:26:27 +0000 (14:26 +0900)
committerMichael Paquier <[email protected]>
Mon, 17 Jun 2024 05:26:27 +0000 (14:26 +0900)
The function has been introduced in 368202501539 to test at a low level
the new kinds of external toast datums, and would fail on OOM when
dealing with a plain storage attribute.  The existing tests of
indirect_toast do not test this case, still the error generated was
confusing.

Author: Alexander Lakhin
Discussion: https://postgr.es/m/250a21e5-d677-6b2a-2692-cd4233785e37@gmail.com

src/test/regress/regress.c

index deffaea578bfb7ecb07409c35303f0bf547e8d8d..45a6ad3c49ee540b6262397f12a41aad4fa3b483 100644 (file)
@@ -595,7 +595,8 @@ make_tuple_indirect(PG_FUNCTION_ARGS)
        /* only work on existing, not-null varlenas */
        if (TupleDescAttr(tupdesc, i)->attisdropped ||
            nulls[i] ||
-           TupleDescAttr(tupdesc, i)->attlen != -1)
+           TupleDescAttr(tupdesc, i)->attlen != -1 ||
+           TupleDescAttr(tupdesc, i)->attstorage == TYPSTORAGE_PLAIN)
            continue;
 
        attr = (struct varlena *) DatumGetPointer(values[i]);