Skip to content

Tables dropped in a rolled back client transaction become invisible to that client #174

Description

@flip-rossi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions