Commit 62b6aaa4 authored by Itagaki Takahiro's avatar Itagaki Takahiro

Only DISCARD ALL should be in the command_no_begin list.

We allowes DISCARD PLANS and TEMP in a transaction.
parent d08c698d
......@@ -1388,8 +1388,20 @@ command_no_begin(const char *query)
return true;
}
/* DISCARD ALL isn't allowed in xacts, but other variants are allowed. */
if (wordlen == 7 && pg_strncasecmp(query, "discard", 7) == 0)
return true;
{
query += wordlen;
query = skip_white_space(query);
wordlen = 0;
while (isalpha((unsigned char) query[wordlen]))
wordlen += PQmblen(&query[wordlen], pset.encoding);
if (wordlen == 3 && pg_strncasecmp(query, "all", 3) == 0)
return true;
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment