-FE=> Query (query="DROP TABLE IF EXISTS pgproto_test1")
-<= BE NoticeResponse(S NOTICE V NOTICE C 00000 M table "pgproto_test1" does not exist, skipping F tablecmds.c L 914 R DropErrorMsgNonExistent )
-<= BE CommandComplete(DROP TABLE)
-<= BE ReadyForQuery(I)
-FE=> Query (query="CREATE TABLE pgproto_test1(i INT)")
-<= BE CommandComplete(CREATE TABLE)
-<= BE ReadyForQuery(I)
FE=> Parse(stmt="", query="BEGIN")
FE=> Bind(stmt="", portal="")
FE=> Execute(portal="")
FE=> Parse(stmt="S1", query="SELECT 1")
-FE=> Parse(stmt="", query="INSERT INTO pgproto_test1 VALUES(1)")
+FE=> Parse(stmt="", query="SET debug_print_parse = off")
FE=> Bind(stmt="", portal="")
FE=> Execute(portal="")
FE=> Bind(stmt="S1", portal="")
<= BE ParseComplete
<= BE ParseComplete
<= BE BindComplete
-<= BE CommandComplete(INSERT 0 1)
+<= BE CommandComplete(SET)
<= BE BindComplete
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE DataRow
<= BE CommandComplete(SELECT 1)
<= BE ReadyForQuery(T)
-FE=> Query (query="INSERT INTO pgproto_test1 VALUES(1)")
-<= BE CommandComplete(INSERT 0 1)
-<= BE ReadyForQuery(T)
FE=> Query (query="SELECT 2")
<= BE RowDescription
<= BE DataRow
FE=> Query (query="COMMIT")
<= BE CommandComplete(COMMIT)
<= BE ReadyForQuery(I)
-FE=> Query (query="DROP TABLE pgproto_test1")
-<= BE CommandComplete(DROP TABLE)
-<= BE ReadyForQuery(I)
FE=> Terminate
# Force load balance node to 1.
##backend_weight0 = 0
##backend_weight1 = 1
+##disable_load_balance_on_write = 'always'
-# Disable load balance in current transaction only.
-# (default behavior)
-
-# Create test table
-'Q' "DROP TABLE IF EXISTS pgproto_test1"
-'Y'
-'Q' "CREATE TABLE pgproto_test1(i INT)"
-'Y'
+# Always disable load balance.
# Start a transaction
'P' "" "BEGIN" 0
# Issue Parse SELECT. This should be sent to node 1.
'P' "S1" "SELECT 1" 0
-# Issue INSERT
-'P' "" "INSERT INTO pgproto_test1 VALUES(1)" 0
+# Issue query treaed as write query
+'P' "" "SET debug_print_parse = off" 0
'B' "" "" 0 0 0
'E' "" 0
'Q' "SELECT 1"
'Y'
-# Issue INSERT
-'Q' "INSERT INTO pgproto_test1 VALUES(1)"
-'Y'
-
# Issue another SELECT. This should be sent to primary node.
'Q' "SELECT 2"
'Y'
'Q' "COMMIT"
'Y'
-# DROP test table
-'Q' "DROP TABLE pgproto_test1"
-'Y'
-
'X'