diff --git a/tests/queries/0_stateless/01137_order_by_func.reference b/tests/queries/0_stateless/01137_order_by_func.reference index 1dd2626a58f..66d4d94db72 100644 --- a/tests/queries/0_stateless/01137_order_by_func.reference +++ b/tests/queries/0_stateless/01137_order_by_func.reference @@ -3,8 +3,6 @@ 2020-05-05 01:00:00 2 2020-05-05 01:00:00 3 2020-05-05 01:00:00 4 -999999 -999999 -999999 -999998 -999998 +111 9999999 9999999 +111 9999998 9999998 +111 9999997 9999997 diff --git a/tests/queries/0_stateless/01137_order_by_func.sql b/tests/queries/0_stateless/01137_order_by_func.sql index 7fc2126b515..5a23bd533de 100644 --- a/tests/queries/0_stateless/01137_order_by_func.sql +++ b/tests/queries/0_stateless/01137_order_by_func.sql @@ -9,11 +9,16 @@ SELECT * FROM pk_func ORDER BY toDate(d), ui LIMIT 5; DROP TABLE pk_func; -CREATE TABLE pk_func(i UInt32) ENGINE = MergeTree ORDER BY -i; -INSERT INTO pk_func SELECT number FROM numbers(1000000); -INSERT INTO pk_func SELECT number FROM numbers(1000000); -INSERT INTO pk_func SELECT number FROM numbers(1000000); +CREATE TABLE nORX (`A` Int64, `B` Int64, `V` Int64) ENGINE = MergeTree ORDER BY (A, negate(B)); +INSERT INTO nORX SELECT 111, number, number FROM numbers(10000000); -SELECT * FROM pk_func ORDER BY -i LIMIT 5; +SELECT * +FROM nORX +WHERE B >= 1000 +ORDER BY + A ASC, + -B ASC +LIMIT 3 +SETTINGS max_threads = 1; -DROP TABLE pk_func; +DROP TABLE nORX;