Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logictest: extend temp_table test to exercise discard + drop #96111

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/temp_table
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,44 @@ to_drop.pg_temp.testuser_tmp
to_drop.pg_temp.tempuser_view
to_drop.pg_temp.root_temp

subtest create_after_discard_and_drop_database

statement ok
ALTER ROLE testuser WITH CREATEDB;

user testuser

statement ok
CREATE DATABASE to_drop

statement ok
USE to_drop

statement ok
CREATE TEMPORARY TABLE t (i INT PRIMARY KEY);

statement ok
SELECT * FROM pg_temp.t

statement ok
DISCARD TEMP

statement error pgcode 42P01 relation "pg_temp.t" does not exist
SELECT * FROM pg_temp.t

statement ok
USE defaultdb;
DROP DATABASE to_drop CASCADE;

statement ok
CREATE DATABASE to_drop

statement ok
CREATE TEMPORARY TABLE t (i INT PRIMARY KEY);

statement ok
SELECT * FROM pg_temp.t

statement ok
USE defaultdb;
DROP DATABASE to_drop CASCADE;