1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Remove variable "concurrent" from ReindexStmt

This node already handles multiple options using a bitmask, so having a
separate boolean flag is not necessary.  This simplifies the code a bit
with less arguments to give to the reindex routines, by replacing the
boolean with an equivalent bitmask value.

Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/20200902110326.GA14963@paquier.xyz
This commit is contained in:
Michael Paquier
2020-09-04 10:36:35 +09:00
parent 67a472d71c
commit 844c05abc3
7 changed files with 36 additions and 27 deletions

View File

@@ -8177,40 +8177,44 @@ ReindexStmt:
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = $2;
n->concurrent = $3;
n->relation = $4;
n->name = NULL;
n->options = 0;
if ($3)
n->options |= REINDEXOPT_CONCURRENTLY;
$$ = (Node *)n;
}
| REINDEX reindex_target_multitable opt_concurrently name
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = $2;
n->concurrent = $3;
n->name = $4;
n->relation = NULL;
n->options = 0;
if ($3)
n->options |= REINDEXOPT_CONCURRENTLY;
$$ = (Node *)n;
}
| REINDEX '(' reindex_option_list ')' reindex_target_type opt_concurrently qualified_name
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = $5;
n->concurrent = $6;
n->relation = $7;
n->name = NULL;
n->options = $3;
if ($6)
n->options |= REINDEXOPT_CONCURRENTLY;
$$ = (Node *)n;
}
| REINDEX '(' reindex_option_list ')' reindex_target_multitable opt_concurrently name
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = $5;
n->concurrent = $6;
n->name = $7;
n->relation = NULL;
n->options = $3;
if ($6)
n->options |= REINDEXOPT_CONCURRENTLY;
$$ = (Node *)n;
}
;