Also added two new files.
src/test/regess/sql/junkfilter.sql -- SQL for regression test src/test/regess/expected/junkfilter.out -- Expected output SQL for regression test David Hartwig
This commit is contained in:
parent
2e6159311a
commit
b952a8491e
132
src/test/regress/expected/junkfilter.out
Normal file
132
src/test/regress/expected/junkfilter.out
Normal file
@ -0,0 +1,132 @@
|
||||
QUERY: CREATE TABLE test_missing_target (a int, b int, c char(8));
|
||||
QUERY: INSERT INTO test_missing_target VALUES (0, 1, 'XXXX');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (1, 2, 'AAAA');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (2, 2, 'AAAA');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (3, 3, 'BBBB');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (4, 3, 'BBBB');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (5, 3, 'BBBB');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (6, 4, 'CCCC');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (7, 4, 'CCCC');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (8, 4, 'CCCC');
|
||||
QUERY: INSERT INTO test_missing_target VALUES (9, 4, 'CCCC');
|
||||
QUERY: SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c;
|
||||
c |count
|
||||
--------+-----
|
||||
AAAA | 2
|
||||
BBBB | 3
|
||||
CCCC | 4
|
||||
XXXX | 1
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c;
|
||||
count
|
||||
-----
|
||||
2
|
||||
3
|
||||
4
|
||||
1
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
|
||||
ERROR: parser: illegal use of aggregates or non-group column in target list
|
||||
QUERY: SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
|
||||
count
|
||||
-----
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT test_missing_target.b, count(*) FROM test_missing_target GROUP BY b ORDER BY b;
|
||||
b|count
|
||||
-+-----
|
||||
1| 1
|
||||
2| 2
|
||||
3| 3
|
||||
4| 4
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT c FROM test_missing_target ORDER BY a;
|
||||
c
|
||||
--------
|
||||
XXXX
|
||||
AAAA
|
||||
AAAA
|
||||
BBBB
|
||||
BBBB
|
||||
BBBB
|
||||
CCCC
|
||||
CCCC
|
||||
CCCC
|
||||
CCCC
|
||||
(10 rows)
|
||||
|
||||
QUERY: SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
|
||||
count
|
||||
-----
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
|
||||
count
|
||||
-----
|
||||
10
|
||||
(1 row)
|
||||
|
||||
QUERY: SELECT c, count(*) FROM test_missing_target GROUP BY 1;
|
||||
c |count
|
||||
--------+-----
|
||||
AAAA | 2
|
||||
BBBB | 3
|
||||
CCCC | 4
|
||||
XXXX | 1
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT c, count(*) FROM test_missing_target GROUP BY 3;
|
||||
ERROR: left hand side of operator < has an unknown type, probably a bad attribute name
|
||||
QUERY: SELECT count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY b ORDER BY b;
|
||||
ERROR: Column b is ambiguous
|
||||
QUERY: SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
b|count
|
||||
-+-----
|
||||
1| 1
|
||||
2| 2
|
||||
3| 3
|
||||
4| 4
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
count
|
||||
-----
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
(4 rows)
|
||||
|
||||
QUERY: SELECT count(*) INTO TABLE test_missing_target2
|
||||
FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
QUERY: SELECT * FROM test_missing_target2;
|
||||
count
|
||||
-----
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
(4 rows)
|
||||
|
||||
QUERY: drop table test_missing_target;
|
||||
QUERY: drop table test_missing_target2;
|
||||
|
74
src/test/regress/sql/junkfilter.sql
Normal file
74
src/test/regress/sql/junkfilter.sql
Normal file
@ -0,0 +1,74 @@
|
||||
-- load test data
|
||||
CREATE TABLE test_missing_target (a int, b int, c char(8));
|
||||
INSERT INTO test_missing_target VALUES (0, 1, 'XXXX');
|
||||
INSERT INTO test_missing_target VALUES (1, 2, 'AAAA');
|
||||
INSERT INTO test_missing_target VALUES (2, 2, 'AAAA');
|
||||
INSERT INTO test_missing_target VALUES (3, 3, 'BBBB');
|
||||
INSERT INTO test_missing_target VALUES (4, 3, 'BBBB');
|
||||
INSERT INTO test_missing_target VALUES (5, 3, 'BBBB');
|
||||
INSERT INTO test_missing_target VALUES (6, 4, 'CCCC');
|
||||
INSERT INTO test_missing_target VALUES (7, 4, 'CCCC');
|
||||
INSERT INTO test_missing_target VALUES (8, 4, 'CCCC');
|
||||
INSERT INTO test_missing_target VALUES (9, 4, 'CCCC');
|
||||
|
||||
|
||||
-- w/ existing GROUP BY target
|
||||
SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c;
|
||||
|
||||
-- w/o existing GROUP BY target using a relation name in GROUP BY clause
|
||||
SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c;
|
||||
|
||||
-- w/o existing GROUP BY target and w/o existing a different ORDER BY target
|
||||
-- failure expected
|
||||
SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b;
|
||||
|
||||
-- w/o existing GROUP BY target and w/o existing same ORDER BY target
|
||||
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b;
|
||||
|
||||
-- w/ existing GROUP BY target using a relation name in target
|
||||
SELECT test_missing_target.b, count(*) FROM test_missing_target GROUP BY b ORDER BY b;
|
||||
|
||||
-- w/o existing GROUP BY target
|
||||
SELECT c FROM test_missing_target ORDER BY a;
|
||||
|
||||
-- w/o existing ORDER BY target
|
||||
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc;
|
||||
|
||||
-- group using reference number
|
||||
SELECT count(*) FROM test_missing_target ORDER BY 1 desc;
|
||||
|
||||
-- order using reference number
|
||||
SELECT c, count(*) FROM test_missing_target GROUP BY 1;
|
||||
|
||||
-- group using reference number out of range
|
||||
-- failure expected
|
||||
SELECT c, count(*) FROM test_missing_target GROUP BY 3;
|
||||
|
||||
-- group w/o existing GROUP BY and ORDER BY target under ambigious condition
|
||||
-- failure expected
|
||||
SELECT count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY b ORDER BY b;
|
||||
|
||||
-- group w/ existing GROUP BY target under ambigious condition
|
||||
SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
|
||||
-- group w/o existing GROUP BY target under ambigious condition
|
||||
SELECT count(*) FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
|
||||
-- group w/o existing GROUP BY target under ambigious condition
|
||||
-- into a table
|
||||
SELECT count(*) INTO TABLE test_missing_target2
|
||||
FROM test_missing_target x, test_missing_target y
|
||||
WHERE x.a = y.a
|
||||
GROUP BY x.b;
|
||||
SELECT * FROM test_missing_target2;
|
||||
|
||||
-- Cleanup
|
||||
drop table test_missing_target;
|
||||
drop table test_missing_target2;
|
||||
|
Loading…
Reference in New Issue
Block a user