If a client drops a table within a transaction that is rolled back, the client stops being able to see that table for the remainder of the session.
Steps to reproduce
Setup server:
CREATE TABLE t (v INT);
CALL quack_serve('quack:localhost',token:='1234');
On client:
ATTACH 'quack:localhost' AS peer (TOKEN '1234');
FROM peer.t; -- OK: table is visible
-- ┌────────┐
-- │ v │
-- │ int32 │
-- └────────┘
-- 0 rows
BEGIN;
DROP TABLE peer.t;
FROM peer.t; -- OK: Error expected: table doesn't exist in this transaction anymore
-- Catalog Error:
-- Table with name t does not exist!
-- Did you mean "information_schema.tables"?
--
-- LINE 1: FROM peer.t;
-- ^
ROLLBACK;
FROM peer.t; -- BAD: We still can't see the table after rolling back
-- Catalog Error:
-- Table with name t does not exist!
-- Did you mean "information_schema.tables"?
--
-- LINE 1: FROM peer.t;
-- ^
-- Detach and reattach
DETACH peer;
ATTACH 'quack:localhost' AS peer (TOKEN '1234');
FROM peer.t; -- Table is visible again!
-- ┌────────┐
-- │ v │
-- │ int32 │
-- └────────┘
-- 0 rows
If a client drops a table within a transaction that is rolled back, the client stops being able to see that table for the remainder of the session.
Steps to reproduce
Setup server:
On client: