ProcessVacuumStmt update on names

pull/2121/head
mehmet furkan şahin 2018-04-25 13:41:45 +03:00
parent a4153c6ab1
commit f2555317b6
1 changed files with 6 additions and 8 deletions

View File

@ -128,8 +128,7 @@ static Node * WorkerProcessAlterTableStmt(AlterTableStmt *alterTableStatement,
static List * PlanAlterObjectSchemaStmt(AlterObjectSchemaStmt *alterObjectSchemaStmt, static List * PlanAlterObjectSchemaStmt(AlterObjectSchemaStmt *alterObjectSchemaStmt,
const char *alterObjectSchemaCommand); const char *alterObjectSchemaCommand);
static void ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand); static void ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand);
static bool IsSupportedDistributedVacuumStmt(VacuumStmt *vacuumStmt, static bool IsDistributedVacuumStmt(VacuumStmt *vacuumStmt, List *vacuumRelationIdList);
List *vacuumRelationIdList);
static List * VacuumTaskList(Oid relationId, int vacuumOptions, List *vacuumColumnList); static List * VacuumTaskList(Oid relationId, int vacuumOptions, List *vacuumColumnList);
static StringInfo DeparseVacuumStmtPrefix(int vacuumFlags); static StringInfo DeparseVacuumStmtPrefix(int vacuumFlags);
static char * DeparseVacuumColumnNames(List *columnNameList); static char * DeparseVacuumColumnNames(List *columnNameList);
@ -1609,7 +1608,7 @@ static void
ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand) ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand)
{ {
int relationIndex = 0; int relationIndex = 0;
bool supportedVacuumStmt = false; bool distributedVacuumStmt = false;
List *vacuumRelationList = ExtractVacuumTargetRels(vacuumStmt); List *vacuumRelationList = ExtractVacuumTargetRels(vacuumStmt);
ListCell *vacuumRelationCell = NULL; ListCell *vacuumRelationCell = NULL;
List *relationIdList = NIL; List *relationIdList = NIL;
@ -1625,8 +1624,8 @@ ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand)
relationIdList = lappend_oid(relationIdList, relationId); relationIdList = lappend_oid(relationIdList, relationId);
} }
supportedVacuumStmt = IsSupportedDistributedVacuumStmt(vacuumStmt, relationIdList); distributedVacuumStmt = IsDistributedVacuumStmt(vacuumStmt, relationIdList);
if (!supportedVacuumStmt) if (!distributedVacuumStmt)
{ {
return; return;
} }
@ -1672,11 +1671,10 @@ ProcessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand)
* the list of tables targeted by the provided statement. * the list of tables targeted by the provided statement.
* *
* Returns true if the statement requires distributed execution and returns * Returns true if the statement requires distributed execution and returns
* false otherwise; however, this function will raise errors if the provided * false otherwise.
* statement needs distributed execution but contains unsupported options.
*/ */
static bool static bool
IsSupportedDistributedVacuumStmt(VacuumStmt *vacuumStmt, List *vacuumRelationIdList) IsDistributedVacuumStmt(VacuumStmt *vacuumStmt, List *vacuumRelationIdList)
{ {
const char *stmtName = (vacuumStmt->options & VACOPT_VACUUM) ? "VACUUM" : "ANALYZE"; const char *stmtName = (vacuumStmt->options & VACOPT_VACUUM) ? "VACUUM" : "ANALYZE";
bool distributeStmt = false; bool distributeStmt = false;