]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Replace deprecated StaticAssertStmt() with StaticAssertDecl()
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 14 Apr 2026 09:03:30 +0000 (12:03 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 14 Apr 2026 09:03:30 +0000 (12:03 +0300)
Commit 6f5ad00ab763 added another use of StaticAssertStmt(), but it
was marked as deprecated in commit d50c86e74375.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://www.postgresql.org/message-id/adeNWH5pDawDvvR2@ip-10-97-1-34.eu-west-3.compute.internal

src/backend/access/gin/ginutil.c

index d3351fbe8a313a1fe3a9acace6367917f157fee3..e7cba81d47709e37f5e3da3fa653af47b18bf105 100644 (file)
@@ -534,8 +534,11 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum,
        /*
         * Create GinNullCategory representation.
         */
-       StaticAssertStmt(GIN_CAT_NORM_KEY == 0, "Assuming GIN_CAT_NORM_KEY=0");
-       categories = palloc0_array(GinNullCategory, nentries + (hasNull ? 1 : 0));
+       {
+               /* palloc0 sets all entries to GIN_CAT_NORM_KEY */
+               StaticAssertDecl(GIN_CAT_NORM_KEY == 0, "Assuming GIN_CAT_NORM_KEY == 0");
+               categories = palloc0_array(GinNullCategory, nentries + (hasNull ? 1 : 0));
+       }
 
        /* Put back a NULL entry, if there were any */
        if (hasNull)