From e2ba4ee2a8148004faa8d1b69f2ed734e37c2c83 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Wed, 8 Jul 1998 14:31:02 +0000 Subject: [PATCH] Include tests for new 8-byte integer. Include tests for HAVING clause. --- src/test/regress/sql/int8.sql | 27 ++++++++++++++++++++++++++ src/test/regress/sql/select_having.sql | 7 +++++++ src/test/regress/sql/tests | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 src/test/regress/sql/int8.sql create mode 100644 src/test/regress/sql/select_having.sql diff --git a/src/test/regress/sql/int8.sql b/src/test/regress/sql/int8.sql new file mode 100644 index 0000000000..1b997e9ed8 --- /dev/null +++ b/src/test/regress/sql/int8.sql @@ -0,0 +1,27 @@ +-- +-- Test int8 64-bit integers. +-- +CREATE TABLE INT8_TBL(q1 int8, q2 int8); + +INSERT INTO INT8_TBL VALUES('123','456'); +INSERT INTO INT8_TBL VALUES('123','4567890123456789'); +INSERT INTO INT8_TBL VALUES('4567890123456789','123'); +INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789'); +INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789'); + +SELECT * FROM INT8_TBL; + +SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL; + +SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL; +SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL; +SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL + WHERE q1 < 1000 or (q2 > 0 and q2 < 1000); +SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL; + +SELECT '' AS five, q1, float8(q1) FROM INT8_TBL; +SELECT '' AS five, q2, float8(q2) FROM INT8_TBL; +SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL; + +SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL; +SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL; diff --git a/src/test/regress/sql/select_having.sql b/src/test/regress/sql/select_having.sql new file mode 100644 index 0000000000..88abecc385 --- /dev/null +++ b/src/test/regress/sql/select_having.sql @@ -0,0 +1,7 @@ +-- +-- select_having.sql +-- + +SELECT d1, count(*) FROM DATETIME_TBL + GROUP BY d1 HAVING count(*) > 1; + diff --git a/src/test/regress/sql/tests b/src/test/regress/sql/tests index c2c8cfa9cd..de02118cd0 100644 --- a/src/test/regress/sql/tests +++ b/src/test/regress/sql/tests @@ -6,6 +6,7 @@ text strings int2 int4 +int8 oid oidint2 oidint4 @@ -45,6 +46,7 @@ select select_into select_distinct select_distinct_on +select_having subselect union aggregates