Skip to content

Commit

Permalink
pgtest: add test for multiple DDL statements in one extended req
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Loiselle committed Sep 20, 2022
1 parent e22af70 commit caa665b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/pgtest/ddl-extended.pt
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Test that multiple DDL statements in the same extended request are supported
send
Parse {"query": "CREATE TABLE a (a int)"}
Bind
Execute
Parse {"query": "ROLLBACK"}
Bind
Execute
Parse {"query": "CREATE TABLE b (a int)"}
Bind
Execute
Parse {"query": "SELECT * FROM a"}
Bind
Execute
Parse {"query": "SELECT * FROM b"}
Bind
Execute
Sync
----

until
ReadyForQuery
----
ParseComplete
BindComplete
CommandComplete {"tag":"CREATE TABLE"}
ParseComplete
BindComplete
NoticeResponse {"fields":[{"typ":"S","value":"WARNING"},{"typ":"C","value":"25P01"},{"typ":"M","value":"there is no transaction in progress"}]}
CommandComplete {"tag":"ROLLBACK"}
ParseComplete
BindComplete
CommandComplete {"tag":"CREATE TABLE"}
ParseComplete
BindComplete
CommandComplete {"tag":"SELECT 0"}
ParseComplete
BindComplete
CommandComplete {"tag":"SELECT 0"}
ReadyForQuery {"status":"I"}

# Test what happens with rollback'd DDLs in extended protocol.
#
# Note: This only works in versions of Postgres with
Expand Down

0 comments on commit caa665b

Please sign in to comment.