123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- # Test portal max rows. Note that even though there are two rows returned,
- # even after the second execute a portal suspended is returned, not
- # command complete.
- send
- Query {"query": "BEGIN"}
- Parse {"query": "VALUES (1), (2)"}
- Bind
- Execute {"max_rows": 1}
- Execute {"max_rows": 1}
- Execute {"max_rows": 1}
- Execute {"max_rows": 1}
- Query {"query": "COMMIT"}
- Sync
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"BEGIN"}
- ReadyForQuery {"status":"T"}
- ParseComplete
- BindComplete
- DataRow {"fields":["1"]}
- PortalSuspended
- DataRow {"fields":["2"]}
- PortalSuspended
- CommandComplete {"tag":"SELECT 0"}
- CommandComplete {"tag":"SELECT 0"}
- CommandComplete {"tag":"COMMIT"}
- ReadyForQuery {"status":"I"}
- ReadyForQuery {"status":"I"}
- # Test when max rows > number of total rows.
- send
- Query {"query": "BEGIN"}
- Parse {"query": "VALUES (1), (2)"}
- Bind
- Execute {"max_rows": 3}
- Execute {"max_rows": 3}
- Execute {"max_rows": 3}
- Query {"query": "COMMIT"}
- Sync
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"BEGIN"}
- ReadyForQuery {"status":"T"}
- ParseComplete
- BindComplete
- DataRow {"fields":["1"]}
- DataRow {"fields":["2"]}
- CommandComplete {"tag":"SELECT 2"}
- CommandComplete {"tag":"SELECT 0"}
- CommandComplete {"tag":"SELECT 0"}
- CommandComplete {"tag":"COMMIT"}
- ReadyForQuery {"status":"I"}
- ReadyForQuery {"status":"I"}
- # Verify correct Close error.
- send
- Query {"query": "CLOSE c"}
- ----
- until
- ReadyForQuery
- ----
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"34000"},{"typ":"M","value":"cursor \"c\" does not exist"}]}
- ReadyForQuery {"status":"I"}
- # Verify portal reuse errors.
- send
- Query {"query": "BEGIN; DECLARE c CURSOR FOR SELECT 1; DECLARE c CURSOR FOR SELECT 1"}
- Query {"query": "ROLLBACK"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"BEGIN"}
- CommandComplete {"tag":"DECLARE CURSOR"}
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"42P03"},{"typ":"M","value":"cursor \"c\" already exists"}]}
- ReadyForQuery {"status":"E"}
- CommandComplete {"tag":"ROLLBACK"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "BEGIN; DECLARE c CURSOR FOR SELECT 1"}
- Parse {"query": "VALUES (1), (2)"}
- Bind {"portal": "c"}
- Sync
- Query {"query": "ROLLBACK"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"BEGIN"}
- CommandComplete {"tag":"DECLARE CURSOR"}
- ReadyForQuery {"status":"T"}
- ParseComplete
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"42P03"},{"typ":"M","value":"cursor \"c\" already exists"}]}
- ReadyForQuery {"status":"E"}
- CommandComplete {"tag":"ROLLBACK"}
- ReadyForQuery {"status":"I"}
- send
- Query {"query": "BEGIN"}
- Parse {"query": "VALUES (1), (2)"}
- Bind {"portal": "c"}
- Sync
- Query {"query": "DECLARE c CURSOR FOR SELECT 1"}
- Query {"query": "ROLLBACK"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ReadyForQuery
- ----
- CommandComplete {"tag":"BEGIN"}
- ReadyForQuery {"status":"T"}
- ParseComplete
- BindComplete
- ReadyForQuery {"status":"T"}
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"42P03"},{"typ":"M","value":"cursor \"c\" already exists"}]}
- ReadyForQuery {"status":"E"}
- CommandComplete {"tag":"ROLLBACK"}
- ReadyForQuery {"status":"I"}
- # Test that multiple execute commands are permitted in the same implicit
- # transaction.
- send
- Parse {"query": "VALUES (1), (2)"}
- Bind {"portal": "c"}
- Execute {"portal": "c", "max_rows": 1}
- Execute {"portal": "c", "max_rows": 1}
- Sync
- ----
- until
- ReadyForQuery
- ----
- ParseComplete
- BindComplete
- DataRow {"fields":["1"]}
- PortalSuspended
- DataRow {"fields":["2"]}
- PortalSuspended
- ReadyForQuery {"status":"I"}
- # Verify that portals (cursors) are destroyed after a Sync command commits
- # the implicit transaction.
- send
- Parse {"query": "VALUES (1), (2)"}
- Bind {"portal": "c"}
- Execute {"portal": "c", "max_rows": 1}
- Sync
- Query {"query": "FETCH c"}
- ----
- until
- ReadyForQuery
- ReadyForQuery
- ----
- ParseComplete
- BindComplete
- DataRow {"fields":["1"]}
- PortalSuspended
- ReadyForQuery {"status":"I"}
- ErrorResponse {"fields":[{"typ":"S","value":"ERROR"},{"typ":"C","value":"34000"},{"typ":"M","value":"cursor \"c\" does not exist"}]}
- ReadyForQuery {"status":"I"}
|