mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 00:01:57 -04:00
Include tests for new 8-byte integer.
Include tests for HAVING clause.
This commit is contained in:
parent
5e7beed3eb
commit
e2ba4ee2a8
27
src/test/regress/sql/int8.sql
Normal file
27
src/test/regress/sql/int8.sql
Normal file
@ -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;
|
7
src/test/regress/sql/select_having.sql
Normal file
7
src/test/regress/sql/select_having.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
--
|
||||||
|
-- select_having.sql
|
||||||
|
--
|
||||||
|
|
||||||
|
SELECT d1, count(*) FROM DATETIME_TBL
|
||||||
|
GROUP BY d1 HAVING count(*) > 1;
|
||||||
|
|
@ -6,6 +6,7 @@ text
|
|||||||
strings
|
strings
|
||||||
int2
|
int2
|
||||||
int4
|
int4
|
||||||
|
int8
|
||||||
oid
|
oid
|
||||||
oidint2
|
oidint2
|
||||||
oidint4
|
oidint4
|
||||||
@ -45,6 +46,7 @@ select
|
|||||||
select_into
|
select_into
|
||||||
select_distinct
|
select_distinct
|
||||||
select_distinct_on
|
select_distinct_on
|
||||||
|
select_having
|
||||||
subselect
|
subselect
|
||||||
union
|
union
|
||||||
aggregates
|
aggregates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user