1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Fix tab completion of ANALYZE VERBOSE <tab>. It was previously confused

with EXPLAIN ANALYZE VERBOSE.

Greg Sabino Mullane, reformatted by myself. Backpatch to 8.1, where the
bug was introduced.
This commit is contained in:
Heikki Linnakangas
2009-03-27 14:58:54 +00:00
parent 9c7908b189
commit f14ce2124d

View File

@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2008, PostgreSQL Global Development Group * Copyright (c) 2000-2008, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.169 2008/01/01 19:45:56 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.169.2.1 2009/03/27 14:58:54 heikki Exp $
*/ */
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -1500,11 +1500,11 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_LIST(list_EXPLAIN); COMPLETE_WITH_LIST(list_EXPLAIN);
} }
else if (pg_strcasecmp(prev_wd, "VERBOSE") == 0 && else if ((pg_strcasecmp(prev2_wd, "EXPLAIN") == 0 &&
pg_strcasecmp(prev3_wd, "VACUUM") != 0 && pg_strcasecmp(prev_wd, "VERBOSE") == 0) ||
pg_strcasecmp(prev4_wd, "VACUUM") != 0 && (pg_strcasecmp(prev3_wd, "EXPLAIN") == 0 &&
(pg_strcasecmp(prev2_wd, "ANALYZE") == 0 || pg_strcasecmp(prev2_wd, "ANALYZE") == 0 &&
pg_strcasecmp(prev2_wd, "EXPLAIN") == 0)) pg_strcasecmp(prev_wd, "VERBOSE") == 0))
{ {
static const char *const list_EXPLAIN[] = static const char *const list_EXPLAIN[] =
{"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", NULL}; {"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", NULL};