There were two reasons why the test fails.
1) when disable_load_balance_on_write = off, parse_before_bind should
have not be called at all. So fix this.
2) the test data tests/disable-load-balance-off.data did not set
disable_load_balance_on_write = off.
* primary node.
*/
if (pool_config->load_balance_mode && pool_is_writing_transaction() &&
- TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T')
+ TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T' &&
+ pool_config->disable_load_balance_on_write != DLBOW_OFF)
{
if (!SL_MODE)
{
# Force load balance node to 1.
##backend_weight0 = 0
##backend_weight1 = 1
-
-# Disable load balance in current transaction only.
-# (default behavior)
+##disable_load_balance_on_write = 'off'
# Create test table
'Q' "DROP TABLE IF EXISTS pgproto_test1"