mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Test for bug with missing column in PREWHERE step
This commit is contained in:
parent
f91a127175
commit
1d28da3263
@ -0,0 +1,30 @@
|
||||
1 Hello, world! 0
|
||||
2 Goodbye. 3
|
||||
-- { echoOn }
|
||||
SELECT s FROM test_02559 PREWHERE x AND y ORDER BY s;
|
||||
Goodbye.
|
||||
SELECT s, y FROM test_02559 PREWHERE y ORDER BY s;
|
||||
Goodbye. 3
|
||||
SELECT s, y FROM test_02559 PREWHERE NOT y ORDER BY s;
|
||||
Hello, world! 0
|
||||
SELECT s, y FROM test_02559 PREWHERE x AND y ORDER BY s;
|
||||
Goodbye. 3
|
||||
SELECT s, y FROM test_02559 PREWHERE x AND NOT y ORDER BY s;
|
||||
Hello, world! 0
|
||||
SELECT s, y FROM test_02559 PREWHERE y AND x ORDER BY s;
|
||||
Goodbye. 3
|
||||
SELECT s, y FROM test_02559 PREWHERE (NOT y) AND x ORDER BY s;
|
||||
Hello, world! 0
|
||||
ALTER TABLE test_02559 ADD COLUMN z UInt8 DEFAULT 10;
|
||||
INSERT INTO test_02559 VALUES (3, 'So long, and thanks for all the fish.', 42, 0);
|
||||
SELECT * FROM test_02559 ORDER BY x;
|
||||
1 Hello, world! 0 10
|
||||
2 Goodbye. 3 10
|
||||
3 So long, and thanks for all the fish. 42 0
|
||||
SELECT s FROM test_02559 PREWHERE z ORDER BY s;
|
||||
Goodbye.
|
||||
Hello, world!
|
||||
SELECT s FROM test_02559 PREWHERE y AND z ORDER BY s;
|
||||
Goodbye.
|
||||
SELECT s, z FROM test_02559 PREWHERE NOT y AND z ORDER BY s;
|
||||
Hello, world! 10
|
@ -0,0 +1,30 @@
|
||||
DROP TABLE IF EXISTS test_02559;
|
||||
CREATE TABLE test_02559 (x UInt8, s String) ENGINE = MergeTree ORDER BY tuple();
|
||||
|
||||
INSERT INTO test_02559 VALUES (1, 'Hello, world!');
|
||||
|
||||
ALTER TABLE test_02559 ADD COLUMN y UInt8 DEFAULT 0;
|
||||
INSERT INTO test_02559 VALUES (2, 'Goodbye.', 3);
|
||||
SELECT * FROM test_02559 ORDER BY x;
|
||||
|
||||
SET enable_multiple_prewhere_read_steps=true, move_all_conditions_to_prewhere=true;
|
||||
|
||||
-- { echoOn }
|
||||
SELECT s FROM test_02559 PREWHERE x AND y ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE y ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE NOT y ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE x AND y ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE x AND NOT y ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE y AND x ORDER BY s;
|
||||
SELECT s, y FROM test_02559 PREWHERE (NOT y) AND x ORDER BY s;
|
||||
|
||||
ALTER TABLE test_02559 ADD COLUMN z UInt8 DEFAULT 10;
|
||||
INSERT INTO test_02559 VALUES (3, 'So long, and thanks for all the fish.', 42, 0);
|
||||
SELECT * FROM test_02559 ORDER BY x;
|
||||
|
||||
SELECT s FROM test_02559 PREWHERE z ORDER BY s;
|
||||
SELECT s FROM test_02559 PREWHERE y AND z ORDER BY s;
|
||||
SELECT s, z FROM test_02559 PREWHERE NOT y AND z ORDER BY s;
|
||||
-- { echoOff }
|
||||
|
||||
DROP TABLE test_02559;
|
Loading…
Reference in New Issue
Block a user