mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
Two-phase commit. Original patch by Heikki Linnakangas, with additional
hacking by Alvaro Herrera and Tom Lane.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.102 2005/06/14 02:57:41 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.103 2005/06/17 22:32:47 tgl Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "common.h"
|
||||
@@ -1216,6 +1216,21 @@ command_no_begin(const char *query)
|
||||
return true;
|
||||
if (wordlen == 8 && pg_strncasecmp(query, "rollback", 8) == 0)
|
||||
return true;
|
||||
if (wordlen == 7 && pg_strncasecmp(query, "prepare", 7) == 0)
|
||||
{
|
||||
/* PREPARE TRANSACTION is a TC command, PREPARE foo is not */
|
||||
query += wordlen;
|
||||
|
||||
query = skip_white_space(query);
|
||||
|
||||
wordlen = 0;
|
||||
while (isalpha((unsigned char) query[wordlen]))
|
||||
wordlen += PQmblen(&query[wordlen], pset.encoding);
|
||||
|
||||
if (wordlen == 11 && pg_strncasecmp(query, "transaction", 11) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Commands not allowed within transactions. The statements checked
|
||||
|
||||
Reference in New Issue
Block a user