ClickHouse/tests/queries/0_stateless/00116_storage_set.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.0 KiB
MySQL
Raw Normal View History

2019-06-07 14:59:41 +00:00
DROP TABLE IF EXISTS set;
DROP TABLE IF EXISTS set2;
2015-01-27 00:52:03 +00:00
2019-06-07 14:59:41 +00:00
CREATE TABLE set (x String) ENGINE = Set;
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s NOT IN set;
INSERT INTO set VALUES ('Hello'), ('World');
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
RENAME TABLE set TO set2;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
2019-06-07 14:59:41 +00:00
INSERT INTO set2 VALUES ('Hello'), ('World');
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
2019-06-07 14:59:41 +00:00
INSERT INTO set2 VALUES ('abc'), ('World');
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
DETACH TABLE set2;
2020-09-09 13:32:50 +00:00
ATTACH TABLE set2;
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
RENAME TABLE set2 TO set;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
2019-06-07 14:59:41 +00:00
DROP TABLE set;