Commit 5a722414 authored by Bruce Momjian's avatar Bruce Momjian

This patch resolves some regression test failures caused by platform
dependencies.

David Hartwig
parent 9728ce74
QUERY: SELECT d1, count(*) FROM DATETIME_TBL QUERY: CREATE TABLE test_having (a int, b int, c char(8), d char);
GROUP BY d1 HAVING count(*) > 1; QUERY: INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
d1 |count QUERY: INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
----------------------------+----- QUERY: INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
Thu Jun 13 00:00:00 1957 PDT| 2 QUERY: INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
Mon Feb 10 09:32:01 1997 PST| 3 QUERY: INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
Mon Feb 10 17:32:01 1997 PST| 13 QUERY: INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
Sun Feb 16 17:32:01 1997 PST| 2 QUERY: INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
Sat Mar 01 17:32:01 1997 PST| 2 QUERY: INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
invalid | 2 QUERY: INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
(6 rows) QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
QUERY: SELECT max(a) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
max
---
5
9
(2 rows)
QUERY: SELECT lower(c), count(c) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a);
lower |count
--------+-----
bbbb | 3
cccc | 4
xxxx | 1
(3 rows)
QUERY: SELECT c, max(a) FROM test_having
GROUP BY c HAVING count(*) > 2 OR min(a) = max(a);
c |max
--------+---
XXXX | 0
bbbb | 5
(2 rows)
QUERY: DROP TABLE test_having;
QUERY: CREATE TABLE test_missing_target (a int, b int, c char(8)); QUERY: CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
QUERY: INSERT INTO test_missing_target VALUES (0, 1, 'XXXX'); QUERY: INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
QUERY: INSERT INTO test_missing_target VALUES (1, 2, 'AAAA'); QUERY: INSERT INTO test_missing_target VALUES (1, 2, 'AAAA', 'b');
QUERY: INSERT INTO test_missing_target VALUES (2, 2, 'AAAA'); QUERY: INSERT INTO test_missing_target VALUES (2, 2, 'AAAA', 'c');
QUERY: INSERT INTO test_missing_target VALUES (3, 3, 'BBBB'); QUERY: INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
QUERY: INSERT INTO test_missing_target VALUES (4, 3, 'BBBB'); QUERY: INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
QUERY: INSERT INTO test_missing_target VALUES (5, 3, 'bbbb'); QUERY: INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
QUERY: INSERT INTO test_missing_target VALUES (6, 4, 'cccc'); QUERY: INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
QUERY: INSERT INTO test_missing_target VALUES (7, 4, 'cccc'); QUERY: INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
QUERY: INSERT INTO test_missing_target VALUES (8, 4, 'CCCC'); QUERY: INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
QUERY: INSERT INTO test_missing_target VALUES (9, 4, 'CCCC'); QUERY: INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
QUERY: SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c; QUERY: SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c;
c |count c |count
--------+----- --------+-----
...@@ -210,9 +210,10 @@ cccc | 4 ...@@ -210,9 +210,10 @@ cccc | 4
xxxx | 1 xxxx | 1
(4 rows) (4 rows)
QUERY: SELECT a FROM test_missing_target ORDER BY upper(c); QUERY: SELECT a FROM test_missing_target ORDER BY upper(d);
a a
- -
0
1 1
2 2
3 3
...@@ -222,7 +223,6 @@ a ...@@ -222,7 +223,6 @@ a
7 7
8 8
9 9
0
(10 rows) (10 rows)
QUERY: SELECT count(b) FROM test_missing_target QUERY: SELECT count(b) FROM test_missing_target
......
...@@ -2,6 +2,26 @@ ...@@ -2,6 +2,26 @@
-- select_having.sql -- select_having.sql
-- --
SELECT d1, count(*) FROM DATETIME_TBL -- load test data
GROUP BY d1 HAVING count(*) > 1; CREATE TABLE test_having (a int, b int, c char(8), d char);
INSERT INTO test_having VALUES (0, 1, 'XXXX', 'A');
INSERT INTO test_having VALUES (1, 2, 'AAAA', 'b');
INSERT INTO test_having VALUES (2, 2, 'AAAA', 'c');
INSERT INTO test_having VALUES (3, 3, 'BBBB', 'D');
INSERT INTO test_having VALUES (4, 3, 'BBBB', 'e');
INSERT INTO test_having VALUES (5, 3, 'bbbb', 'F');
INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
SELECT max(a) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
SELECT lower(c), count(c) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a);
SELECT c, max(a) FROM test_having
GROUP BY c HAVING count(*) > 2 OR min(a) = max(a);
DROP TABLE test_having;
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
-- - thomas 1998-07-09 -- - thomas 1998-07-09
-- load test data -- load test data
CREATE TABLE test_missing_target (a int, b int, c char(8)); CREATE TABLE test_missing_target (a int, b int, c char(8), d char);
INSERT INTO test_missing_target VALUES (0, 1, 'XXXX'); INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A');
INSERT INTO test_missing_target VALUES (1, 2, 'AAAA'); INSERT INTO test_missing_target VALUES (1, 2, 'AAAA', 'b');
INSERT INTO test_missing_target VALUES (2, 2, 'AAAA'); INSERT INTO test_missing_target VALUES (2, 2, 'AAAA', 'c');
INSERT INTO test_missing_target VALUES (3, 3, 'BBBB'); INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D');
INSERT INTO test_missing_target VALUES (4, 3, 'BBBB'); INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e');
INSERT INTO test_missing_target VALUES (5, 3, 'bbbb'); INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F');
INSERT INTO test_missing_target VALUES (6, 4, 'cccc'); INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g');
INSERT INTO test_missing_target VALUES (7, 4, 'cccc'); INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h');
INSERT INTO test_missing_target VALUES (8, 4, 'CCCC'); INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I');
INSERT INTO test_missing_target VALUES (9, 4, 'CCCC'); INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j');
-- w/ existing GROUP BY target -- w/ existing GROUP BY target
...@@ -118,7 +118,7 @@ SELECT lower(test_missing_target.c), count(c) ...@@ -118,7 +118,7 @@ SELECT lower(test_missing_target.c), count(c)
FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c); FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c);
-- w/o existing GROUP BY target -- w/o existing GROUP BY target
SELECT a FROM test_missing_target ORDER BY upper(c); SELECT a FROM test_missing_target ORDER BY upper(d);
-- w/o existing ORDER BY target -- w/o existing ORDER BY target
SELECT count(b) FROM test_missing_target SELECT count(b) FROM test_missing_target
......
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