Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ac70c35

Browse files
committed
I have tested the beta3 on WinNT and here are the results:
- I was unable to compile ecpg due to the ":=" instead of "=" in defining LIBPQDIR and some other variables in Makefile.global.in - pg_id (and also pg_encoding) executable was not removed during "make clean" - there was no $(X) appended to the executable name for rm - I have added result for int2, int4, float8 and geometry regression tests - int2, int2 - yet another message for too large numbers ;-) - float8 - it is problably a bug in the newlib C library - it has no error message for numbers with exponent -400 - geometry - differences in precision of float numbers - I have added appropriate lines into resultmap file - I have modified the script regress.sh to use "case" statement when testing the hostname. For cygwin the script is called with "i686-pc-cygwin" (on my machine) as a parameter and this was not catched with the "if" statement. The check was done for PORTNAME (win) and not HOSTNAME (i.86-pc-cygwin*). The patch for described modifications is included. All this modifications can be applied to "current" tree too. The compilation was done on CygwinB20.1 with gcc 2.95, cygipc library 1.05. The binaries were able to run also on the newest development snapshot (2000-03-25). Dan
1 parent 51bacfd commit ac70c35

9 files changed

+1356
-43
lines changed

src/Makefile.global.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.68 2000/03/30 05:29:20 tgl Exp $
10+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.69 2000/03/31 14:14:31 momjian Exp $
1111
#
1212
# NOTES
1313
# Essentially all Postgres make files include this file and use the
@@ -53,11 +53,11 @@ BSD_SHLIB= true
5353
# systems now. May be applicable to other systems to?
5454
ELF_SYSTEM= @ELF_SYS@
5555

56-
LIBPQDIR:= $(SRCDIR)/interfaces/libpq
57-
LIBPGTCLDIR:= $(SRCDIR)/interfaces/libpgtcl
56+
LIBPQDIR= $(SRCDIR)/interfaces/libpq
57+
LIBPGTCLDIR= $(SRCDIR)/interfaces/libpgtcl
5858

59-
LIBPQ:= -L$(LIBPQDIR) -lpq
60-
LIBPGTCL:= -L$(LIBPGTCLDIR) -lpgtcl
59+
LIBPQ= -L$(LIBPQDIR) -lpq
60+
LIBPGTCL= -L$(LIBPGTCLDIR) -lpgtcl
6161

6262
# For convenience, POSTGRESDIR is where BINDIR, and LIBDIR
6363
# and other target destinations are rooted. Of course, each of these is

src/bin/pg_encoding/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.5 2000/03/08 01:58:20 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/bin/pg_encoding/Attic/Makefile,v 1.6 2000/03/31 14:14:32 momjian Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -36,7 +36,7 @@ depend dep:
3636
$(CC) -MM $(CFLAGS) *.c >depend
3737

3838
clean:
39-
rm -f pg_encoding pg_encoding.o
39+
rm -f pg_encoding$(X) pg_encoding.o
4040

4141
ifeq (depend,$(wildcard depend))
4242
include depend

src/bin/pg_id/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Copyright (C) 2000 by PostgreSQL Global Development Team
77
#
8-
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.15 2000/02/09 16:23:42 momjian Exp $
8+
# $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/Makefile,v 1.16 2000/03/31 14:14:32 momjian Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -26,7 +26,7 @@ depend dep:
2626
$(CC) -MM $(CFLAGS) *.c >depend
2727

2828
clean:
29-
rm -f pg_id $(OBJS)
29+
rm -f pg_id$(X) $(OBJS)
3030

3131
ifeq (depend,$(wildcard depend))
3232
include depend
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
--
2+
-- FLOAT8
3+
--
4+
CREATE TABLE FLOAT8_TBL(f1 float8);
5+
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
6+
INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
7+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
8+
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
9+
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10+
SELECT '' AS five, FLOAT8_TBL.*;
11+
five | f1
12+
------+----------------------
13+
| 0
14+
| 1004.3
15+
| -34.84
16+
| 1.2345678901234e+200
17+
| 1.2345678901234e-200
18+
(5 rows)
19+
20+
SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
21+
four | f1
22+
------+----------------------
23+
| 0
24+
| -34.84
25+
| 1.2345678901234e+200
26+
| 1.2345678901234e-200
27+
(4 rows)
28+
29+
SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
30+
one | f1
31+
-----+--------
32+
| 1004.3
33+
(1 row)
34+
35+
SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1;
36+
three | f1
37+
-------+----------------------
38+
| 0
39+
| -34.84
40+
| 1.2345678901234e-200
41+
(3 rows)
42+
43+
SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3';
44+
three | f1
45+
-------+----------------------
46+
| 0
47+
| -34.84
48+
| 1.2345678901234e-200
49+
(3 rows)
50+
51+
SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
52+
four | f1
53+
------+----------------------
54+
| 0
55+
| 1004.3
56+
| -34.84
57+
| 1.2345678901234e-200
58+
(4 rows)
59+
60+
SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3';
61+
four | f1
62+
------+----------------------
63+
| 0
64+
| 1004.3
65+
| -34.84
66+
| 1.2345678901234e-200
67+
(4 rows)
68+
69+
SELECT '' AS three, f.f1, f.f1 * '-10' AS x
70+
FROM FLOAT8_TBL f
71+
WHERE f.f1 > '0.0';
72+
three | f1 | x
73+
-------+----------------------+-----------------------
74+
| 1004.3 | -10043
75+
| 1.2345678901234e+200 | -1.2345678901234e+201
76+
| 1.2345678901234e-200 | -1.2345678901234e-199
77+
(3 rows)
78+
79+
SELECT '' AS three, f.f1, f.f1 + '-10' AS x
80+
FROM FLOAT8_TBL f
81+
WHERE f.f1 > '0.0';
82+
three | f1 | x
83+
-------+----------------------+----------------------
84+
| 1004.3 | 994.3
85+
| 1.2345678901234e+200 | 1.2345678901234e+200
86+
| 1.2345678901234e-200 | -10
87+
(3 rows)
88+
89+
SELECT '' AS three, f.f1, f.f1 / '-10' AS x
90+
FROM FLOAT8_TBL f
91+
WHERE f.f1 > '0.0';
92+
three | f1 | x
93+
-------+----------------------+-----------------------
94+
| 1004.3 | -100.43
95+
| 1.2345678901234e+200 | -1.2345678901234e+199
96+
| 1.2345678901234e-200 | -1.2345678901234e-201
97+
(3 rows)
98+
99+
SELECT '' AS three, f.f1, f.f1 - '-10' AS x
100+
FROM FLOAT8_TBL f
101+
WHERE f.f1 > '0.0';
102+
three | f1 | x
103+
-------+----------------------+----------------------
104+
| 1004.3 | 1014.3
105+
| 1.2345678901234e+200 | 1.2345678901234e+200
106+
| 1.2345678901234e-200 | 10
107+
(3 rows)
108+
109+
SELECT '' AS one, f.f1 ^ '2.0' AS square_f1
110+
FROM FLOAT8_TBL f where f.f1 = '1004.3';
111+
one | square_f1
112+
-----+------------
113+
| 1008618.49
114+
(1 row)
115+
116+
-- absolute value
117+
SELECT '' AS five, f.f1, @f.f1 AS abs_f1
118+
FROM FLOAT8_TBL f;
119+
five | f1 | abs_f1
120+
------+----------------------+----------------------
121+
| 0 | 0
122+
| 1004.3 | 1004.3
123+
| -34.84 | 34.84
124+
| 1.2345678901234e+200 | 1.2345678901234e+200
125+
| 1.2345678901234e-200 | 1.2345678901234e-200
126+
(5 rows)
127+
128+
-- truncate
129+
SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
130+
FROM FLOAT8_TBL f;
131+
five | f1 | trunc_f1
132+
------+----------------------+----------------------
133+
| 0 | 0
134+
| 1004.3 | 1004
135+
| -34.84 | -34
136+
| 1.2345678901234e+200 | 1.2345678901234e+200
137+
| 1.2345678901234e-200 | 0
138+
(5 rows)
139+
140+
-- round
141+
SELECT '' AS five, f.f1, f.f1 % AS round_f1
142+
FROM FLOAT8_TBL f;
143+
five | f1 | round_f1
144+
------+----------------------+----------------------
145+
| 0 | 0
146+
| 1004.3 | 1004
147+
| -34.84 | -35
148+
| 1.2345678901234e+200 | 1.2345678901234e+200
149+
| 1.2345678901234e-200 | 0
150+
(5 rows)
151+
152+
SELECT sqrt(float8 '64') AS eight;
153+
eight
154+
-------
155+
8
156+
(1 row)
157+
158+
-- square root
159+
SELECT |/ float8 '64' AS eight;
160+
eight
161+
-------
162+
8
163+
(1 row)
164+
165+
SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
166+
FROM FLOAT8_TBL f
167+
WHERE f.f1 > '0.0';
168+
three | f1 | sqrt_f1
169+
-------+----------------------+-----------------------
170+
| 1004.3 | 31.6906926399535
171+
| 1.2345678901234e+200 | 1.11111110611109e+100
172+
| 1.2345678901234e-200 | 1.11111110611109e-100
173+
(3 rows)
174+
175+
-- take exp of ln(f.f1)
176+
SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
177+
FROM FLOAT8_TBL f
178+
WHERE f.f1 > '0.0';
179+
three | f1 | exp_ln_f1
180+
-------+----------------------+-----------------------
181+
| 1004.3 | 1004.3
182+
| 1.2345678901234e+200 | 1.23456789012338e+200
183+
| 1.2345678901234e-200 | 1.23456789012339e-200
184+
(3 rows)
185+
186+
-- cube root
187+
SELECT ||/ float8 '27' AS three;
188+
three
189+
-------
190+
3
191+
(1 row)
192+
193+
SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f;
194+
five | f1 | cbrt_f1
195+
------+----------------------+----------------------
196+
| 0 | 0
197+
| 1004.3 | 10.014312837827
198+
| -34.84 | -3.26607421344208
199+
| 1.2345678901234e+200 | 4.97933859234765e+66
200+
| 1.2345678901234e-200 | 2.3112042409018e-67
201+
(5 rows)
202+
203+
SELECT '' AS five, FLOAT8_TBL.*;
204+
five | f1
205+
------+----------------------
206+
| 0
207+
| 1004.3
208+
| -34.84
209+
| 1.2345678901234e+200
210+
| 1.2345678901234e-200
211+
(5 rows)
212+
213+
UPDATE FLOAT8_TBL
214+
SET f1 = FLOAT8_TBL.f1 * '-1'
215+
WHERE FLOAT8_TBL.f1 > '0.0';
216+
SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
217+
ERROR: Bad float8 input format -- overflow
218+
SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
219+
ERROR: pow() result is out of range
220+
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ;
221+
ERROR: can't take log of zero
222+
SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ;
223+
ERROR: can't take log of a negative number
224+
SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f;
225+
ERROR: exp() result is out of range
226+
SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f;
227+
ERROR: float8div: divide by zero error
228+
SELECT '' AS five, FLOAT8_TBL.*;
229+
five | f1
230+
------+-----------------------
231+
| 0
232+
| -34.84
233+
| -1004.3
234+
| -1.2345678901234e+200
235+
| -1.2345678901234e-200
236+
(5 rows)
237+
238+
-- test for over- and underflow
239+
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
240+
ERROR: Input '10e400' is out of range for float8
241+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
242+
ERROR: Input '-10e400' is out of range for float8
243+
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
244+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
245+
-- maintain external table consistency across platforms
246+
-- delete all values and reinsert well-behaved ones
247+
DELETE FROM FLOAT8_TBL;
248+
INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
249+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
250+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30');
251+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200');
252+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200');
253+
SELECT '' AS five, FLOAT8_TBL.*;
254+
five | f1
255+
------+-----------------------
256+
| 0
257+
| -34.84
258+
| -1004.3
259+
| -1.2345678901234e+200
260+
| -1.2345678901234e-200
261+
(5 rows)
262+

0 commit comments

Comments
 (0)