forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca6975a
commit 2fd2352
Showing
3 changed files
with
42 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ r1_bak | |
r2_bak | ||
test_dictionary | ||
test_dictionary_2 | ||
UNKNOWN_TABLE |
57 changes: 0 additions & 57 deletions
57
tests/queries/0_stateless/02891_rename_table_without_keyword.sh
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
tests/queries/0_stateless/02891_rename_table_without_keyword.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE:Identifier}; | ||
CREATE DATABASE IF NOT EXISTS {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
CREATE TABLE IF NOT EXISTS {CLICKHOUSE_DATABASE:Identifier}.r1 (name String) Engine=Memory(); | ||
SHOW TABLES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
RENAME TABLE {CLICKHOUSE_DATABASE:Identifier}.r1 TO {CLICKHOUSE_DATABASE:Identifier}.r1_bak; | ||
SHOW TABLES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
RENAME {CLICKHOUSE_DATABASE:Identifier}.r1_bak TO {CLICKHOUSE_DATABASE:Identifier}.r1; | ||
SHOW TABLES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
CREATE TABLE IF NOT EXISTS {CLICKHOUSE_DATABASE:Identifier}.r2 (name String) Engine=Memory(); | ||
RENAME {CLICKHOUSE_DATABASE:Identifier}.r1 TO {CLICKHOUSE_DATABASE:Identifier}.r1_bak, | ||
{CLICKHOUSE_DATABASE:Identifier}.r2 TO {CLICKHOUSE_DATABASE:Identifier}.r2_bak; | ||
SHOW TABLES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
CREATE TABLE IF NOT EXISTS {CLICKHOUSE_DATABASE:Identifier}.source_table ( | ||
id UInt64, | ||
value String | ||
) ENGINE = Memory; | ||
|
||
CREATE DICTIONARY IF NOT EXISTS {CLICKHOUSE_DATABASE:Identifier}.test_dictionary | ||
( | ||
id UInt64, | ||
value String | ||
) | ||
PRIMARY KEY id | ||
SOURCE(CLICKHOUSE(TABLE '{CLICKHOUSE_DATABASE:String}.dictionary_table')) | ||
LAYOUT(FLAT()) | ||
LIFETIME(MIN 0 MAX 1000); | ||
|
||
SHOW DICTIONARIES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
RENAME {CLICKHOUSE_DATABASE:Identifier}.test_dictionary TO {CLICKHOUSE_DATABASE:Identifier}.test_dictionary_2; | ||
SHOW DICTIONARIES FROM {CLICKHOUSE_DATABASE:Identifier}; | ||
|
||
SHOW DATABASES LIKE '{CLICKHOUSE_DATABASE:String}'; | ||
RENAME {CLICKHOUSE_DATABASE:Identifier} TO {CLICKHOUSE_DATABASE_1:Identifier}; -- { serverError UNKNOWN_TABLE } | ||
SHOW DATABASES LIKE '{CLICKHOUSE_DATABASE:String}'; | ||
|
||
DROP DATABASE IF EXISTS {CLICKHOUSE_DATABASE:Identifier}; |