mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
Include tests for new 8-byte integer (minimal).
Include tests for HAVING clause.
This commit is contained in:
parent
33dd5c444f
commit
4405a85d7f
115
src/test/regress/expected/int8.out
Normal file
115
src/test/regress/expected/int8.out
Normal file
@ -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)
|
||||
|
12
src/test/regress/expected/select_having.out
Normal file
12
src/test/regress/expected/select_having.out
Normal file
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user