ClickHouse/tests/queries/0_stateless/02961_drop_tables.sql
zhongyuankai 9a289a3baa
fix test
2024-01-28 13:53:38 +08:00

33 lines
1.2 KiB
SQL

-- Tags: no-parallel
DROP DATABASE IF EXISTS 02961_db1;
CREATE DATABASE IF NOT EXISTS 02961_db1;
DROP DATABASE IF EXISTS 02961_db2;
CREATE DATABASE IF NOT EXISTS 02961_db2;
CREATE TABLE IF NOT EXISTS 02961_db1.02961_tb1 (id UInt32) Engine=Memory();
CREATE TABLE IF NOT EXISTS 02961_db1.02961_tb2 (id UInt32) Engine=Memory();
CREATE TABLE IF NOT EXISTS 02961_db2.02961_tb3 (id UInt32) Engine=Memory();
CREATE TABLE IF NOT EXISTS 02961_db2.02961_tb4 (id UInt32) Engine=Memory();
CREATE TABLE IF NOT EXISTS 02961_db2.02961_tb5 (id UInt32) Engine=Memory();
DROP TABLE 02961_db1.02961_tb1, 02961_db1.02961_tb2, 02961_db2.02961_tb3;
SELECT '-- check which tables exist in 02961_db1';
SHOW TABLES FROM 02961_db1;
SELECT '-- check which tables exist in 02961_db2';
SHOW TABLES FROM 02961_db2;
SELECT 'Test when deletion of existing table fails';
DROP TABLE 02961_db2.02961_tb4, 02961_db1.02961_tb1, 02961_db2.02961_tb5; -- { serverError UNKNOWN_TABLE }
SELECT '-- check which tables exist in 02961_db1';
SHOW TABLES FROM 02961_db1;
SELECT '-- check which tables exist in 02961_db2';
SHOW TABLES FROM 02961_db2;
DROP DATABASE IF EXISTS 02961_db1;
DROP DATABASE IF EXISTS 02961_db2;