aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>1998-07-08 14:29:09 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>1998-07-08 14:29:09 +0000
commit4405a85d7f957625e2db4948c4a50ddc6f1a9bd6 (patch)
tree054d5e76280c187fc037cdcb1565d3bec48443cc /src
parent33dd5c444faa87c5265206bd3ae34d2b890c9f28 (diff)
downloadpostgresql-4405a85d7f957625e2db4948c4a50ddc6f1a9bd6.tar.gz
postgresql-4405a85d7f957625e2db4948c4a50ddc6f1a9bd6.zip
Include tests for new 8-byte integer (minimal).
Include tests for HAVING clause.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/int8.out115
-rw-r--r--src/test/regress/expected/select_having.out12
2 files changed, 127 insertions, 0 deletions
diff --git a/src/test/regress/expected/int8.out b/src/test/regress/expected/int8.out
new file mode 100644
index 00000000000..b9d4e4e0943
--- /dev/null
+++ b/src/test/regress/expected/int8.out
@@ -0,0 +1,115 @@
+QUERY: CREATE TABLE INT8_TBL(q1 int8, q2 int8);
+QUERY: INSERT INTO INT8_TBL VALUES('123','456');
+QUERY: INSERT INTO INT8_TBL VALUES('123','4567890123456789');
+QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','123');
+QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789');
+QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');
+QUERY: SELECT * FROM INT8_TBL;
+ q1| q2
+----------------+-----------------
+ 123| 456
+ 123| 4567890123456789
+4567890123456789| 123
+4567890123456789| 4567890123456789
+4567890123456789|-4567890123456789
+(5 rows)
+
+QUERY: SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;
+five| plus| minus
+----+----------------+-----------------
+ | 123| -123
+ | 123| -123
+ |4567890123456789|-4567890123456789
+ |4567890123456789|-4567890123456789
+ |4567890123456789|-4567890123456789
+(5 rows)
+
+QUERY: SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;
+five| q1| q2| plus
+----+----------------+-----------------+----------------
+ | 123| 456| 579
+ | 123| 4567890123456789|4567890123456912
+ |4567890123456789| 123|4567890123456912
+ |4567890123456789| 4567890123456789|9135780246913578
+ |4567890123456789|-4567890123456789| 0
+(5 rows)
+
+QUERY: SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;
+five| q1| q2| minus
+----+----------------+-----------------+-----------------
+ | 123| 456| -333
+ | 123| 4567890123456789|-4567890123456666
+ |4567890123456789| 123| 4567890123456666
+ |4567890123456789| 4567890123456789| 0
+ |4567890123456789|-4567890123456789| 9135780246913578
+(5 rows)
+
+QUERY: SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
+ WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
+three| q1| q2| multiply
+-----+----------------+----------------+------------------
+ | 123| 456| 56088
+ | 123|4567890123456789|561850485185185047
+ |4567890123456789| 123|561850485185185047
+(3 rows)
+
+QUERY: SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
+five| q1| q2| divide
+----+----------------+-----------------+--------------
+ | 123| 456| 0
+ | 123| 4567890123456789| 0
+ |4567890123456789| 123|37137318076884
+ |4567890123456789| 4567890123456789| 1
+ |4567890123456789|-4567890123456789| -1
+(5 rows)
+
+QUERY: SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
+five| q1|float8
+----+----------------+--------------------
+ | 123|123
+ | 123|123
+ |4567890123456789|4.56789012345679e+15
+ |4567890123456789|4.56789012345679e+15
+ |4567890123456789|4.56789012345679e+15
+(5 rows)
+
+QUERY: SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
+five| q2|float8
+----+-----------------+---------------------
+ | 456|456
+ | 4567890123456789|4.56789012345679e+15
+ | 123|123
+ | 4567890123456789|4.56789012345679e+15
+ |-4567890123456789|-4.56789012345679e+15
+(5 rows)
+
+QUERY: SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
+five| q1| two coercions
+----+----------------+----------------
+ | 123| 123
+ | 123| 123
+ |4567890123456789|4567890123456789
+ |4567890123456789|4567890123456789
+ |4567890123456789|4567890123456789
+(5 rows)
+
+QUERY: SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
+five| twice int4
+----+----------------
+ | 246
+ | 246
+ |9135780246913578
+ |9135780246913578
+ |9135780246913578
+(5 rows)
+
+QUERY: SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
+five| twice int4
+----+----------------
+ | 246
+ | 246
+ |9135780246913578
+ |9135780246913578
+ |9135780246913578
+(5 rows)
+
diff --git a/src/test/regress/expected/select_having.out b/src/test/regress/expected/select_having.out
new file mode 100644
index 00000000000..95dd274c513
--- /dev/null
+++ b/src/test/regress/expected/select_having.out
@@ -0,0 +1,12 @@
+QUERY: SELECT d1, count(*) FROM DATETIME_TBL
+ GROUP BY d1 HAVING count(*) > 1;
+d1 |count
+----------------------------+-----
+Thu Jun 13 00:00:00 1957 PDT| 2
+Mon Feb 10 09:32:01 1997 PST| 3
+Mon Feb 10 17:32:01 1997 PST| 13
+Sun Feb 16 17:32:01 1997 PST| 2
+Sat Mar 01 17:32:01 1997 PST| 2
+invalid | 2
+(6 rows)
+