postgres.git / summary / log / commit / refs
commit 3fe9f0e5c734c79b604abfdfd3766e85c1e4b2b7
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Sep 28 18:47:25 2010 +0000
First released in: 9.1.0, 8.3.12, 8.4.5, 9.0.1
Fix another small oversight in command_no_begin patch.
Need a "return false" to prevent tests from continuing after we've moved
the "query" pointer. As it stood, it'd accept "DROP DISCARD ALL" as a
match.
src/bin/psql/common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 72115f8ae65..877d6f7cdbc 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -1386,6 +1386,7 @@ command_no_begin(const char *query)
return true;
if (wordlen == 10 && pg_strncasecmp(query, "tablespace", 10) == 0)
return true;
+ return false;
}
/* DISCARD ALL isn't allowed in xacts, but other variants are allowed. */
@@ -1401,6 +1402,7 @@ command_no_begin(const char *query)
if (wordlen == 3 && pg_strncasecmp(query, "all", 3) == 0)
return true;
+ return false;
}
return false;
[parent: 798cbc015b65]