-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
Hi,
I have met an issue:
envionment
pgpool 4.6.2 + three backend nodes(one primary and two standby nodes, weight=0:1:1)
reproduce
- start pgpool
- run following command:
begin;
set transaction_read_only = 0;
commit; - 'set transaction_read_only = 0;' would be routed to standby node and execute failed.
analyze
when node is VariableSetStmt and the value is integer, it should be 'if (!v->val.ival.ival)' but not 'if (v->val.ival.ival)'
in function static POOL_DEST send_to_where(Node *node)
{
......
else if (IsA(node, VariableSetStmt))
{
ListCell *list_item;
bool ret = POOL_BOTH;
/*
* SET transaction_read_only TO off
*/
if (((VariableSetStmt *) node)->kind == VAR_SET_VALUE &&
!strcmp(((VariableSetStmt *) node)->name, "transaction_read_only"))
{
List *options = ((VariableSetStmt *) node)->args;
foreach(list_item, options)
{
A_Const *v = (A_Const *) lfirst(list_item);
switch (nodeTag(&v->val))
{
case T_String:
if (!strcasecmp(v->val.sval.sval, "off") ||
!strcasecmp(v->val.sval.sval, "f") ||
!strcasecmp(v->val.sval.sval, "false"))
ret = POOL_PRIMARY;
break;
case T_Integer:
if (v->val.ival.ival)
ret = POOL_PRIMARY;
default:
break;
}
}
return ret;
}
}
}
- attachment is the patch , verified has been passed.
0001-fix-issue-set-transaction_read_only-0-was-routed-to-.patch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels