Skip to content

Commit e2ba4ee

Browse files
author
Thomas G. Lockhart
committed
Include tests for new 8-byte integer.
Include tests for HAVING clause.
1 parent 5e7beed commit e2ba4ee

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

src/test/regress/sql/int8.sql

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--
2+
-- Test int8 64-bit integers.
3+
--
4+
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
5+
6+
INSERT INTO INT8_TBL VALUES('123','456');
7+
INSERT INTO INT8_TBL VALUES('123','4567890123456789');
8+
INSERT INTO INT8_TBL VALUES('4567890123456789','123');
9+
INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789');
10+
INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');
11+
12+
SELECT * FROM INT8_TBL;
13+
14+
SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;
15+
16+
SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;
17+
SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;
18+
SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
19+
WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
20+
SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
21+
22+
SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
23+
SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
24+
SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
25+
26+
SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
27+
SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--
2+
-- select_having.sql
3+
--
4+
5+
SELECT d1, count(*) FROM DATETIME_TBL
6+
GROUP BY d1 HAVING count(*) > 1;
7+

src/test/regress/sql/tests

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ text
66
strings
77
int2
88
int4
9+
int8
910
oid
1011
oidint2
1112
oidint4
@@ -45,6 +46,7 @@ select
4546
select_into
4647
select_distinct
4748
select_distinct_on
49+
select_having
4850
subselect
4951
union
5052
aggregates

0 commit comments

Comments
 (0)