Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4405a85

Browse files
author
Thomas G. Lockhart
committed
Include tests for new 8-byte integer (minimal).
Include tests for HAVING clause.
1 parent33dd5c4 commit4405a85

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

‎src/test/regress/expected/int8.out

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
QUERY: CREATE TABLE INT8_TBL(q1 int8, q2 int8);
2+
QUERY: INSERT INTO INT8_TBL VALUES('123','456');
3+
QUERY: INSERT INTO INT8_TBL VALUES('123','4567890123456789');
4+
QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','123');
5+
QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','4567890123456789');
6+
QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');
7+
QUERY: SELECT * FROM INT8_TBL;
8+
q1| q2
9+
----------------+-----------------
10+
123| 456
11+
123| 4567890123456789
12+
4567890123456789| 123
13+
4567890123456789| 4567890123456789
14+
4567890123456789|-4567890123456789
15+
(5 rows)
16+
17+
QUERY: SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;
18+
five| plus| minus
19+
----+----------------+-----------------
20+
| 123| -123
21+
| 123| -123
22+
|4567890123456789|-4567890123456789
23+
|4567890123456789|-4567890123456789
24+
|4567890123456789|-4567890123456789
25+
(5 rows)
26+
27+
QUERY: SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;
28+
five| q1| q2| plus
29+
----+----------------+-----------------+----------------
30+
| 123| 456| 579
31+
| 123| 4567890123456789|4567890123456912
32+
|4567890123456789| 123|4567890123456912
33+
|4567890123456789| 4567890123456789|9135780246913578
34+
|4567890123456789|-4567890123456789| 0
35+
(5 rows)
36+
37+
QUERY: SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;
38+
five| q1| q2| minus
39+
----+----------------+-----------------+-----------------
40+
| 123| 456| -333
41+
| 123| 4567890123456789|-4567890123456666
42+
|4567890123456789| 123| 4567890123456666
43+
|4567890123456789| 4567890123456789| 0
44+
|4567890123456789|-4567890123456789| 9135780246913578
45+
(5 rows)
46+
47+
QUERY: SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
48+
WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
49+
three| q1| q2| multiply
50+
-----+----------------+----------------+------------------
51+
| 123| 456| 56088
52+
| 123|4567890123456789|561850485185185047
53+
|4567890123456789| 123|561850485185185047
54+
(3 rows)
55+
56+
QUERY: SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;
57+
five| q1| q2| divide
58+
----+----------------+-----------------+--------------
59+
| 123| 456| 0
60+
| 123| 4567890123456789| 0
61+
|4567890123456789| 123|37137318076884
62+
|4567890123456789| 4567890123456789| 1
63+
|4567890123456789|-4567890123456789| -1
64+
(5 rows)
65+
66+
QUERY: SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;
67+
five| q1|float8
68+
----+----------------+--------------------
69+
| 123|123
70+
| 123|123
71+
|4567890123456789|4.56789012345679e+15
72+
|4567890123456789|4.56789012345679e+15
73+
|4567890123456789|4.56789012345679e+15
74+
(5 rows)
75+
76+
QUERY: SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;
77+
five| q2|float8
78+
----+-----------------+---------------------
79+
| 456|456
80+
| 4567890123456789|4.56789012345679e+15
81+
| 123|123
82+
| 4567890123456789|4.56789012345679e+15
83+
|-4567890123456789|-4.56789012345679e+15
84+
(5 rows)
85+
86+
QUERY: SELECT '' AS five, q1, int8(float8(q1)) AS "two coercions" FROM INT8_TBL;
87+
five| q1| two coercions
88+
----+----------------+----------------
89+
| 123| 123
90+
| 123| 123
91+
|4567890123456789|4567890123456789
92+
|4567890123456789|4567890123456789
93+
|4567890123456789|4567890123456789
94+
(5 rows)
95+
96+
QUERY: SELECT '' AS five, 2 * q1 AS "twice int4" FROM INT8_TBL;
97+
five| twice int4
98+
----+----------------
99+
| 246
100+
| 246
101+
|9135780246913578
102+
|9135780246913578
103+
|9135780246913578
104+
(5 rows)
105+
106+
QUERY: SELECT '' AS five, q1 * 2 AS "twice int4" FROM INT8_TBL;
107+
five| twice int4
108+
----+----------------
109+
| 246
110+
| 246
111+
|9135780246913578
112+
|9135780246913578
113+
|9135780246913578
114+
(5 rows)
115+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
QUERY: SELECT d1, count(*) FROM DATETIME_TBL
2+
GROUP BY d1 HAVING count(*) > 1;
3+
d1 |count
4+
----------------------------+-----
5+
Thu Jun 13 00:00:00 1957 PDT| 2
6+
Mon Feb 10 09:32:01 1997 PST| 3
7+
Mon Feb 10 17:32:01 1997 PST| 13
8+
Sun Feb 16 17:32:01 1997 PST| 2
9+
Sat Mar 01 17:32:01 1997 PST| 2
10+
invalid | 2
11+
(6 rows)
12+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp