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.

36 lines
1.4 KiB
MySQL
Raw Normal View History

2019-06-07 14:59:41 +00:00
DROP TABLE IF EXISTS set;
DROP TABLE IF EXISTS set2;
DROP TABLE IF EXISTS tab;
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;
create table tab (x String) engine = MergeTree order by x as select 'Hello';
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings allow_experimental_analyzer=0;
SELECT * FROM tab PREWHERE x IN (set) WHERE x IN (set) LIMIT 1 settings allow_experimental_analyzer=1;
DROP TABLE tab;
2019-06-07 14:59:41 +00:00
DROP TABLE set;