# Test for load_balance_on_write function feature. disable_load_balance_on_write = 'transaction' # # Force load balance node to 1. ##backend_weight0 = 0 ##backend_weight1 = 1 ##write_function_list = 'f1' # Disable load balance in current transaction only. (disable_load_balance_on_write = 'transaction') # (default behavior) # Create test read_only function 'Q' "DROP FUNCTION IF EXISTS f1" 'Y' 'Q' "CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT $1' LANGUAGE SQL" 'Y' # Start a transaction 'P' "" "BEGIN" 0 'B' "" "" 0 0 0 'E' "" 0 # Issue Parse SELECT. This should be sent to node 1. 'P' "S1" "SELECT 1" 0 # Execute function f1. This should be sent to primary node. 'P' "" "SELECT f1(1)" 0 'B' "" "" 0 0 0 'E' "" 0 # Issue Bind/Execute SELECT. This should be sent to primary node. 'B' "" "S1" 0 0 0 'E' "" 0 # Issue another SELECT. This should be sent to primary node. 'P' "" "SELECT 2" 'B' "" "" 0 0 0 'E' "" 0 # Issue COMMIT 'P' "" "COMMIT" 0 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Issue another SELECT. This should be sent to node 1 because outside a transaction. 'P' "" "SELECT 3" 'B' "" "" 0 0 0 'E' "" 0 'S' 'Y' # Start a transaction 'P' "" "BEGIN" 0 'B' "" "" 0 0 0 'E' "" 0 # Issue Bind/Execute SELECT. This should be sent to node 1 because # disable_load_balance_on_write = 'transaction'. 'B' "" "S1" 0 0 0 'E' "" 0 # Issue another SELECT. This should be sent to node 1. 'P' "" "SELECT 4" 'B' "" "" 0 0 0 'E' "" 0 # Issue COMMIT 'P' "" "COMMIT" 0 'B' "" "" 0 0 0 'E' "" 0 'C' 'S' "S1" 'S' 'Y' # DROP test table 'Q' "DROP FUNCTION f1" 'Y' 'X'