]> granicus.if.org Git - postgresql/commitdiff
Fix another small oversight in command_no_begin patch.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Sep 2010 18:47:25 +0000 (14:47 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Sep 2010 18:51:04 +0000 (14:51 -0400)
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

index 72115f8ae65a57688c9d8f3a9e0c5dc5268d2780..877d6f7cdbc8a1f653d3939f291e05657607683a 100644 (file)
@@ -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;