# Test data for bug271.
# In an explicit transaction, SELECT is parsed, DML issued, same SELECT/bind issued.
# In this case Pgpool-II should parse resend to primary node.
# Also weight must 0 for primary and 1 for standby.
#

##backend_weight0 = 0
##backend_weight1 = 1

# Create test table
'Q'	"DROP TABLE IF EXISTS pgproto_test1"
'Y'
'Q'	"CREATE TABLE pgproto_test1(i INT)"
'Y'

# Start a transaction
'P'	"S1"	"BEGIN"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"

# Issue SELECT
'P'	"S2"	"SELECT 1"	0

# Issue INSERT
'P'	"S1"	"INSERT INTO pgproto_test1 VALUES(1)"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"

# Issue SELECT. This should be sent to primary node.
'B'	""	"S2"	0	0	0
'E'	""	0
'C'	'S'	"S2"

# Issue COMMIT
'P'	"S1"	"COMMIT"	0
'B'	""	"S1"	0	0	0
'E'	""	0
'C'	'S'	"S1"
'S'
'Y'

# DROP test table
'Q'	"DROP TABLE pgproto_test1"
'Y'

'X'
