Commit 7063c46f authored by Tom Lane's avatar Tom Lane

Insert ORDER BY into a few regression test queries that now have unstable

results due to syncscan patch, when shared_buffers is small enough.  Per
buildfarm reports and some local testing with shared_buffers set to the
lowest value considered by initdb.
parent e17e40f7
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
-- Cursor regression tests -- Cursor regression tests
-- --
BEGIN; BEGIN;
DECLARE foo1 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo1 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo2 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo2 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo3 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo3 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo4 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo4 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo5 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo5 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo6 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo6 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo7 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo7 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo8 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo8 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo9 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo9 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo10 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo10 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo11 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo11 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo12 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo12 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo16 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo16 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
FETCH 1 in foo1; FETCH 1 in foo1;
unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
...@@ -680,14 +680,14 @@ CLOSE foo12; ...@@ -680,14 +680,14 @@ CLOSE foo12;
-- however) -- however)
SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors; SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
name | statement | is_holdable | is_binary | is_scrollable name | statement | is_holdable | is_binary | is_scrollable
-------+------------------------------------------------------+-------------+-----------+--------------- -------+-----------------------------------------------------------------------+-------------+-----------+---------------
foo13 | DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo13 | DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo15 | DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo15 | DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo19 | DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo19 | DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo17 | DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo17 | DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo14 | DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t foo14 | DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t
foo21 | DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo21 | DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo23 | DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1; | f | f | t foo23 | DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2; | f | f | t
foo18 | DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t foo18 | DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t
foo20 | DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t foo20 | DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t
foo22 | DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t foo22 | DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2; | f | f | t
...@@ -704,7 +704,7 @@ SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors; ...@@ -704,7 +704,7 @@ SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
-- NO SCROLL disallows backward fetching -- NO SCROLL disallows backward fetching
-- --
BEGIN; BEGIN;
DECLARE foo24 NO SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo24 NO SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
FETCH 1 FROM foo24; FETCH 1 FROM foo24;
unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
...@@ -767,7 +767,7 @@ CLOSE foo25; ...@@ -767,7 +767,7 @@ CLOSE foo25;
-- ROLLBACK should close holdable cursors -- ROLLBACK should close holdable cursors
-- --
BEGIN; BEGIN;
DECLARE foo26 CURSOR WITH HOLD FOR SELECT * FROM tenk1; DECLARE foo26 CURSOR WITH HOLD FOR SELECT * FROM tenk1 ORDER BY unique2;
ROLLBACK; ROLLBACK;
-- should fail -- should fail
FETCH FROM foo26; FETCH FROM foo26;
......
This diff is collapsed.
...@@ -315,7 +315,7 @@ SELECT 1; -- this should work ...@@ -315,7 +315,7 @@ SELECT 1; -- this should work
-- check non-transactional behavior of cursors -- check non-transactional behavior of cursors
BEGIN; BEGIN;
DECLARE c CURSOR FOR SELECT unique2 FROM tenk1; DECLARE c CURSOR FOR SELECT unique2 FROM tenk1 ORDER BY unique2;
SAVEPOINT one; SAVEPOINT one;
FETCH 10 FROM c; FETCH 10 FROM c;
unique2 unique2
...@@ -365,7 +365,7 @@ BEGIN; ...@@ -365,7 +365,7 @@ BEGIN;
(10 rows) (10 rows)
CLOSE c; CLOSE c;
DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1; DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1 ORDER BY unique2;
SAVEPOINT two; SAVEPOINT two;
FETCH 10 FROM c; FETCH 10 FROM c;
ERROR: division by zero ERROR: division by zero
......
...@@ -4,51 +4,51 @@ ...@@ -4,51 +4,51 @@
BEGIN; BEGIN;
DECLARE foo1 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo1 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo2 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo2 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo3 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo3 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo4 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo4 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo5 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo5 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo6 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo6 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo7 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo7 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo8 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo8 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo9 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo9 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo10 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo10 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo11 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo11 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo12 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo12 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo13 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo14 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo15 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo16 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo16 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo17 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo18 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo19 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo20 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo21 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2; DECLARE foo22 SCROLL CURSOR FOR SELECT * FROM tenk2;
DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo23 SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
FETCH 1 in foo1; FETCH 1 in foo1;
...@@ -182,7 +182,7 @@ SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors; ...@@ -182,7 +182,7 @@ SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
BEGIN; BEGIN;
DECLARE foo24 NO SCROLL CURSOR FOR SELECT * FROM tenk1; DECLARE foo24 NO SCROLL CURSOR FOR SELECT * FROM tenk1 ORDER BY unique2;
FETCH 1 FROM foo24; FETCH 1 FROM foo24;
...@@ -223,7 +223,7 @@ CLOSE foo25; ...@@ -223,7 +223,7 @@ CLOSE foo25;
BEGIN; BEGIN;
DECLARE foo26 CURSOR WITH HOLD FOR SELECT * FROM tenk1; DECLARE foo26 CURSOR WITH HOLD FOR SELECT * FROM tenk1 ORDER BY unique2;
ROLLBACK; ROLLBACK;
......
...@@ -38,7 +38,8 @@ EXECUTE q2('regression'); ...@@ -38,7 +38,8 @@ EXECUTE q2('regression');
PREPARE q3(text, int, float, boolean, oid, smallint) AS PREPARE q3(text, int, float, boolean, oid, smallint) AS
SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int); ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int)
ORDER BY unique1;
EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint); EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint);
...@@ -56,7 +57,8 @@ PREPARE q4(nonexistenttype) AS SELECT $1; ...@@ -56,7 +57,8 @@ PREPARE q4(nonexistenttype) AS SELECT $1;
-- create table as execute -- create table as execute
PREPARE q5(int, text) AS PREPARE q5(int, text) AS
SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2; SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2
ORDER BY unique1;
CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA'); CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA');
SELECT * FROM q5_prep_results; SELECT * FROM q5_prep_results;
......
...@@ -212,7 +212,7 @@ SELECT 1; -- this should work ...@@ -212,7 +212,7 @@ SELECT 1; -- this should work
-- check non-transactional behavior of cursors -- check non-transactional behavior of cursors
BEGIN; BEGIN;
DECLARE c CURSOR FOR SELECT unique2 FROM tenk1; DECLARE c CURSOR FOR SELECT unique2 FROM tenk1 ORDER BY unique2;
SAVEPOINT one; SAVEPOINT one;
FETCH 10 FROM c; FETCH 10 FROM c;
ROLLBACK TO SAVEPOINT one; ROLLBACK TO SAVEPOINT one;
...@@ -220,7 +220,7 @@ BEGIN; ...@@ -220,7 +220,7 @@ BEGIN;
RELEASE SAVEPOINT one; RELEASE SAVEPOINT one;
FETCH 10 FROM c; FETCH 10 FROM c;
CLOSE c; CLOSE c;
DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1; DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1 ORDER BY unique2;
SAVEPOINT two; SAVEPOINT two;
FETCH 10 FROM c; FETCH 10 FROM c;
ROLLBACK TO SAVEPOINT two; ROLLBACK TO SAVEPOINT two;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment