Fix is_set_transaction_serializable() when
authorpengbo <pengbo@sraoss.co.jp>
Mon, 9 May 2016 05:43:19 +0000 (14:43 +0900)
committerpengbo <pengbo@sraoss.co.jp>
Mon, 9 May 2016 05:45:59 +0000 (14:45 +0900)
SET default_transaction_isolation TO 'serializable'.

SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.

See bug 191 for related info.

src/context/pool_query_context.c

index 3326654b4900ac181e76194696ebaf85f712c012..42786930c108b7f875dc22570ef04d45066bccf4 100644 (file)
@@ -6,7 +6,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL 
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2015     PgPool Global Development Group
+ * Copyright (c) 2003-2016     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -1316,7 +1316,8 @@ bool is_set_transaction_serializable(Node *node)
                return false;
 
        if (((VariableSetStmt *)node)->kind == VAR_SET_VALUE &&
-               !strcmp(((VariableSetStmt *)node)->name, "transaction_isolation"))
+               (!strcmp(((VariableSetStmt *)node)->name, "transaction_isolation") ||
+                 !strcmp(((VariableSetStmt *)node)->name, "default_transaction_isolation")))
        {
                List *options = ((VariableSetStmt *)node)->args;
                foreach(list_item, options)