Skip to content

Commit 9f7ba88

Browse files
committed
Fix two oversights from 9ebe057 which refactored cluster_rel
The recheck option became a no-op as ClusterOption failed to set proper values for each element. There was a second code path where local options got overwritten. Both issues have been spotted by Coverity.
1 parent e09144e commit 9f7ba88

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/backend/commands/vacuum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,17 +1551,17 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
15511551
*/
15521552
if (options & VACOPT_FULL)
15531553
{
1554-
int options = 0;
1554+
int cluster_options = 0;
15551555

15561556
/* close relation before vacuuming, but hold lock until commit */
15571557
relation_close(onerel, NoLock);
15581558
onerel = NULL;
15591559

15601560
if ((options & VACOPT_VERBOSE) != 0)
1561-
options |= CLUOPT_VERBOSE;
1561+
cluster_options |= CLUOPT_VERBOSE;
15621562

15631563
/* VACUUM FULL is now a variant of CLUSTER; see cluster.c */
1564-
cluster_rel(relid, InvalidOid, options);
1564+
cluster_rel(relid, InvalidOid, cluster_options);
15651565
}
15661566
else
15671567
lazy_vacuum_rel(onerel, options, params, vac_strategy);

src/include/nodes/parsenodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3114,8 +3114,8 @@ typedef struct AlterSystemStmt
31143114
*/
31153115
typedef enum ClusterOption
31163116
{
3117-
CLUOPT_RECHECK, /* recheck relation state */
3118-
CLUOPT_VERBOSE /* print progress info */
3117+
CLUOPT_RECHECK = 1 << 0, /* recheck relation state */
3118+
CLUOPT_VERBOSE = 1 << 1 /* print progress info */
31193119
} ClusterOption;
31203120

31213121
typedef struct ClusterStmt

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy