From a827d90017b55a32521be401da1dbb27d66fc59c Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Wed, 8 Jul 2026 13:01:12 +0300 Subject: [PATCH] =?utf8?q?-=20use=20fallthrough=20attribute=20instead=20of?= =?utf8?q?=20comment=20for=20PG=2019=20-=20use=20resultRelationRelids=20in?= =?utf8?q?stead=20of=20resultRelations=20for=20PG=2019=20-=20fix=20"unanno?= =?utf8?q?tated=20fall-through=20between=20switch=20labels"=20-=20fix=20"f?= =?utf8?q?unction=20declaration=20isn=E2=80=99t=20a=20prototype"=20-=20pas?= =?utf8?q?s=20VacuumParams=20as=20pointer=20(per=20Since=20upstream=20comm?= =?utf8?q?it=20771fe0948ca)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Marina Polyakova, Anton Voloshin --- online_analyze.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/online_analyze.c b/online_analyze.c index 89c9e24..ba967af 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -314,7 +314,7 @@ includeTablesAssign(const char * newval, bool doit, GucSource source) #endif static void -lateInit() +lateInit(void) { TableList *tl[] = {&includeTables, &excludeTables}; int i; @@ -651,11 +651,7 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected) #if PG_VERSION_NUM < 120000 flags, #endif -#if PG_VERSION_NUM >= 190000 - vacstmt, -#else &vacstmt, -#endif NULL, true, GetAccessStrategy(BAS_VACUUM) #endif ); @@ -684,6 +680,9 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected) case CK_INSERT: case CK_UPDATE: rstat->n_tuples += naffected; +#if PG_VERSION_NUM >= 190000 + pg_fallthrough; +#endif /* FALLTHROUGH */ case CK_DELETE: rstat->rereadStat = (reltype == OATT_PERSISTENT); @@ -851,14 +850,25 @@ onlineAnalyzeHooker(QueryDesc *queryDesc) } else #endif +#if PG_VERSION_NUM >= 190000 + if (!bms_is_empty(queryDesc->plannedstmt->resultRelationRelids) && +#else if (queryDesc->plannedstmt->resultRelations && +#endif queryDesc->plannedstmt->rtable) { +#if PG_VERSION_NUM >= 190000 + int n = -1; + + while ((n = bms_next_member(queryDesc->plannedstmt->resultRelationRelids, n)) >= 0) + { +#else ListCell *l; foreach(l, queryDesc->plannedstmt->resultRelations) { int n = lfirst_int(l); +#endif RangeTblEntry *rte = list_nth(queryDesc->plannedstmt->rtable, n-1); if (rte->rtekind == RTE_RELATION) @@ -889,6 +899,10 @@ removeTable(XactEvent event, void *arg) break; case XACT_EVENT_ABORT: toremove = NIL; +#if PG_VERSION_NUM >= 190000 + pg_fallthrough; +#endif + /* FALLTHROUGH */ default: return; } -- 2.49.0