diff --git a/tests/queries/0_stateless/03262_common_expression_optimization.reference b/tests/queries/0_stateless/03262_common_expression_optimization.reference index 035769cce67..70da99ae413 100644 --- a/tests/queries/0_stateless/03262_common_expression_optimization.reference +++ b/tests/queries/0_stateless/03262_common_expression_optimization.reference @@ -830,26 +830,26 @@ QUERY id: 0 SELECT count() AS `count()` FROM default.x AS __table1 WHERE __table1.A OR (__table1.B AND ((__table1.C AND __table1.D) OR (__table1.C AND __table1.E))) --9222995085389227671 0 0 0 0 0 1 -9180023040793172172 0 0 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9172372182410586193 0 1 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9140643988322994670 0 1 1 1 0 1 --9222995085389227671 0 0 0 0 0 1 -9131908548041292850 0 0 1 0 0 0 --9222995085389227671 0 0 0 0 0 1 -9125905281269664989 0 1 1 0 1 0 --9222995085389227671 0 0 0 0 0 1 -9122596639456104649 0 0 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9072373031481714042 0 0 1 0 0 1 --9222995085389227671 0 0 0 0 0 1 -9026061943293167962 0 1 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9004164398646425447 0 1 1 0 0 0 --9222995085389227671 0 0 0 0 0 1 -8974795392131287614 0 1 1 0 1 0 --9222995085389227671 0 0 0 0 0 1 -9180023040793172172 0 0 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9172372182410586193 0 1 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9140643988322994670 0 1 1 1 0 1 --9222995085389227671 0 0 0 0 0 1 -9131908548041292850 0 0 1 0 0 0 --9222995085389227671 0 0 0 0 0 1 -9125905281269664989 0 1 1 0 1 0 --9222995085389227671 0 0 0 0 0 1 -9122596639456104649 0 0 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9072373031481714042 0 0 1 0 0 1 --9222995085389227671 0 0 0 0 0 1 -9026061943293167962 0 1 1 0 1 1 --9222995085389227671 0 0 0 0 0 1 -9004164398646425447 0 1 1 0 0 0 --9222995085389227671 0 0 0 0 0 1 -8974795392131287614 0 1 1 0 1 0 +-9222995085389227671 0 0 0 0 0 1 -9212191261079457524 0 0 1 0 1 0 +-9222995085389227671 0 0 0 0 0 1 -9210944775923669427 0 1 1 1 0 0 +-9222995085389227671 0 0 0 0 0 1 -9202601338732071287 0 1 1 1 1 1 +-9222995085389227671 0 0 0 0 0 1 -9185234005543064629 0 1 1 0 1 1 +-9222995085389227671 0 0 0 0 0 1 -9181371158682533758 0 1 1 1 0 0 +-9222995085389227671 0 0 0 0 0 1 -9173688614647112626 0 0 1 0 0 1 +-9222995085389227671 0 0 0 0 0 1 -9130964659455442087 0 1 1 1 1 1 +-9222995085389227671 0 0 0 0 0 1 -9109186410997511387 0 1 1 0 1 1 +-9222995085389227671 0 0 0 0 0 1 -9071619989214493680 0 1 1 0 1 0 +-9222995085389227671 0 0 0 0 0 1 -9071253360041153133 0 1 1 1 0 1 +-9222995085389227671 0 0 0 0 0 1 -9212191261079457524 0 0 1 0 1 0 +-9222995085389227671 0 0 0 0 0 1 -9210944775923669427 0 1 1 1 0 0 +-9222995085389227671 0 0 0 0 0 1 -9202601338732071287 0 1 1 1 1 1 +-9222995085389227671 0 0 0 0 0 1 -9185234005543064629 0 1 1 0 1 1 +-9222995085389227671 0 0 0 0 0 1 -9181371158682533758 0 1 1 1 0 0 +-9222995085389227671 0 0 0 0 0 1 -9173688614647112626 0 0 1 0 0 1 +-9222995085389227671 0 0 0 0 0 1 -9130964659455442087 0 1 1 1 1 1 +-9222995085389227671 0 0 0 0 0 1 -9109186410997511387 0 1 1 0 1 1 +-9222995085389227671 0 0 0 0 0 1 -9071619989214493680 0 1 1 0 1 0 +-9222995085389227671 0 0 0 0 0 1 -9071253360041153133 0 1 1 1 0 1 QUERY id: 0 PROJECTION COLUMNS count() UInt64 diff --git a/tests/queries/0_stateless/03262_common_expression_optimization.sql b/tests/queries/0_stateless/03262_common_expression_optimization.sql index af8a4dd8e73..80d8d1718b2 100644 --- a/tests/queries/0_stateless/03262_common_expression_optimization.sql +++ b/tests/queries/0_stateless/03262_common_expression_optimization.sql @@ -96,7 +96,16 @@ EXPLAIN QUERY TREE dump_ast = 1 SELECT count() FROM x WHERE A OR (B AND ((C AND DROP TABLE IF EXISTS y; CREATE TABLE y (x Int64, A UInt8, B UInt8, C UInt8, D UInt8, E UInt8, F UInt8) ENGINE = MergeTree ORDER BY x; -INSERT INTO y SELECT x, A%2 AS A, B%2 AS B, C%2 AS C, D%2 AS D, E%2 AS E, F%2 AS F FROM generateRandom('x Int64, A UInt8, B UInt8, C UInt8, D UInt8, E UInt8, F UInt8', 43) LIMIT 2000; +INSERT INTO y + SELECT + murmurHash3_64(number) AS x, + murmurHash3_64(number + 1) % 2 AS A, + murmurHash3_64(number + 2) % 2 AS B, + murmurHash3_64(number + 3) % 2 AS C, + murmurHash3_64(number + 4) % 2 AS D, + murmurHash3_64(number + 5) % 2 AS E, + murmurHash3_64(number + 6) % 2 AS F + FROM numbers(2000); -- JOIN expressions -- As the optimization code is shared between ON and WHERE, it is enough to test that the optimization is done also in ON