Fix another small oversight in command_no_begin patch.
authorTom Lane <[email protected]>
Tue, 28 Sep 2010 18:47:25 +0000 (14:47 -0400)
committerTom Lane <[email protected]>
Tue, 28 Sep 2010 18:48:32 +0000 (14:48 -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 81a633a3d01f21ab3777985d3defb7fe6c0aca9e..76cba901e0c9d1d89b4d54e9b90ccd099169394c 100644 (file)
@@ -1367,6 +1367,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. */
@@ -1382,6 +1383,7 @@ command_no_begin(const char *query)
 
        if (wordlen == 3 && pg_strncasecmp(query, "all", 3) == 0)
            return true;
+       return false;
    }
 
    return false;