Only DISCARD ALL should be in the command_no_begin list.
We allowes DISCARD PLANS and TEMP in a transaction.
This commit is contained in:
parent
b66c4fb322
commit
2dc2ea81f6
@ -1369,8 +1369,20 @@ command_no_begin(const char *query)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DISCARD ALL isn't allowed in xacts, but other variants are allowed. */
|
||||||
if (wordlen == 7 && pg_strncasecmp(query, "discard", 7) == 0)
|
if (wordlen == 7 && pg_strncasecmp(query, "discard", 7) == 0)
|
||||||
|
{
|
||||||
|
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 true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user