Merge pull request #2696 from citusdata/order_by_fix_7

Add some more ORDER BYs
pull/2691/head
Önder Kalacı 2019-05-02 19:15:31 +02:00 committed by GitHub
commit 53d0dcd659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -171,9 +171,9 @@ begin
return result;
end;
$$ language plpgsql;
SELECT * FROM table1 JOIN max_and_min() m ON (m.maximum = data OR m.minimum = data);
SELECT * FROM table1 JOIN max_and_min() m ON (m.maximum = data OR m.minimum = data) ORDER BY 1,2,3,4;
DEBUG: generating subplan 14_1 for subquery SELECT minimum, maximum FROM functions_in_joins.max_and_min() m(minimum, maximum)
DEBUG: Plan 14 query after replacing subqueries and CTEs: SELECT table1.id, table1.data, m.minimum, m.maximum FROM (functions_in_joins.table1 JOIN (SELECT intermediate_result.minimum, intermediate_result.maximum FROM read_intermediate_result('14_1'::text, 'binary'::citus_copy_format) intermediate_result(minimum integer, maximum integer)) m ON (((m.maximum OPERATOR(pg_catalog.=) table1.data) OR (m.minimum OPERATOR(pg_catalog.=) table1.data))))
DEBUG: Plan 14 query after replacing subqueries and CTEs: SELECT table1.id, table1.data, m.minimum, m.maximum FROM (functions_in_joins.table1 JOIN (SELECT intermediate_result.minimum, intermediate_result.maximum FROM read_intermediate_result('14_1'::text, 'binary'::citus_copy_format) intermediate_result(minimum integer, maximum integer)) m ON (((m.maximum OPERATOR(pg_catalog.=) table1.data) OR (m.minimum OPERATOR(pg_catalog.=) table1.data)))) ORDER BY table1.id, table1.data, m.minimum, m.maximum
id | data | minimum | maximum
-----+-------+---------+---------
1 | 1 | 1 | 10000

View File

@ -773,16 +773,16 @@ SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
(3 rows)
UPDATE test_table_1 SET col_3 = 3 WHERE date_col < now();
SELECT * FROM test_table_1;
SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
id | date_col | col_3
----+------------------------------+-------
1 | Sat Apr 05 08:32:12 2014 PDT | 3
3 | Mon Jan 12 08:35:19 2111 PST | 9
2 | Sun Feb 01 08:31:16 2015 PST | 3
1 | Sat Apr 05 08:32:12 2014 PDT | 3
(3 rows)
DELETE FROM test_table_1 WHERE date_col < current_timestamp;
SELECT * FROM test_table_1;
SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
id | date_col | col_3
----+------------------------------+-------
3 | Mon Jan 12 08:35:19 2111 PST | 9

View File

@ -108,7 +108,7 @@ begin
end;
$$ language plpgsql;
SELECT * FROM table1 JOIN max_and_min() m ON (m.maximum = data OR m.minimum = data);
SELECT * FROM table1 JOIN max_and_min() m ON (m.maximum = data OR m.minimum = data) ORDER BY 1,2,3,4;
-- The following tests will fail as we do not support all joins on
-- all kinds of functions

View File

@ -644,9 +644,9 @@ ROLLBACK;
-- Stable functions are supported
SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
UPDATE test_table_1 SET col_3 = 3 WHERE date_col < now();
SELECT * FROM test_table_1;
SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
DELETE FROM test_table_1 WHERE date_col < current_timestamp;
SELECT * FROM test_table_1;
SELECT * FROM test_table_1 ORDER BY 1 DESC, 2 DESC, 3 DESC;
DROP TABLE test_table_1;