]> granicus.if.org Git - postgresql/commitdiff
Include tests for new 8-byte integer.
authorThomas G. Lockhart <lockhart@fourpalms.org>
Wed, 8 Jul 1998 14:31:02 +0000 (14:31 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Wed, 8 Jul 1998 14:31:02 +0000 (14:31 +0000)
Include tests for HAVING clause.

src/test/regress/sql/int8.sql [new file with mode: 0644]
src/test/regress/sql/select_having.sql [new file with mode: 0644]
src/test/regress/sql/tests

diff --git a/src/test/regress/sql/int8.sql b/src/test/regress/sql/int8.sql
new file mode 100644 (file)
index 0000000..1b997e9
--- /dev/null
@@ -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 (file)
index 0000000..88abecc
--- /dev/null
@@ -0,0 +1,7 @@
+--
+-- select_having.sql
+--
+
+SELECT d1, count(*) FROM DATETIME_TBL
+  GROUP BY d1 HAVING count(*) > 1;
+
index c2c8cfa9cd5214574ca0b50ec56b00989439fa21..de02118cd0badf04d88138bf03a482d1635f85b8 100644 (file)
@@ -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