mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-13 17:39:36 +02:00
ac70c3547b
- 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
216 lines
4.7 KiB
Plaintext
216 lines
4.7 KiB
Plaintext
--
|
|
-- INT2
|
|
-- NOTE: int2 operators never check for over/underflow!
|
|
-- Some of these answers are consequently numerically incorrect.
|
|
--
|
|
CREATE TABLE INT2_TBL(f1 int2);
|
|
INSERT INTO INT2_TBL(f1) VALUES ('0');
|
|
INSERT INTO INT2_TBL(f1) VALUES ('1234');
|
|
INSERT INTO INT2_TBL(f1) VALUES ('-1234');
|
|
INSERT INTO INT2_TBL(f1) VALUES ('34.5');
|
|
ERROR: pg_atoi: error in "34.5": can't parse ".5"
|
|
-- largest and smallest values
|
|
INSERT INTO INT2_TBL(f1) VALUES ('32767');
|
|
INSERT INTO INT2_TBL(f1) VALUES ('-32767');
|
|
-- bad input values -- should give warnings
|
|
INSERT INTO INT2_TBL(f1) VALUES ('100000');
|
|
ERROR: pg_atoi: error reading "100000": Math result out of range
|
|
INSERT INTO INT2_TBL(f1) VALUES ('asdf');
|
|
ERROR: pg_atoi: error in "asdf": can't parse "asdf"
|
|
SELECT '' AS five, INT2_TBL.*;
|
|
five | f1
|
|
------+--------
|
|
| 0
|
|
| 1234
|
|
| -1234
|
|
| 32767
|
|
| -32767
|
|
(5 rows)
|
|
|
|
SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> int2 '0';
|
|
four | f1
|
|
------+--------
|
|
| 1234
|
|
| -1234
|
|
| 32767
|
|
| -32767
|
|
(4 rows)
|
|
|
|
SELECT '' AS four, i.* FROM INT2_TBL i WHERE i.f1 <> int4 '0';
|
|
four | f1
|
|
------+--------
|
|
| 1234
|
|
| -1234
|
|
| 32767
|
|
| -32767
|
|
(4 rows)
|
|
|
|
SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = int2 '0';
|
|
one | f1
|
|
-----+----
|
|
| 0
|
|
(1 row)
|
|
|
|
SELECT '' AS one, i.* FROM INT2_TBL i WHERE i.f1 = int4 '0';
|
|
one | f1
|
|
-----+----
|
|
| 0
|
|
(1 row)
|
|
|
|
SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < int2 '0';
|
|
two | f1
|
|
-----+--------
|
|
| -1234
|
|
| -32767
|
|
(2 rows)
|
|
|
|
SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 < int4 '0';
|
|
two | f1
|
|
-----+--------
|
|
| -1234
|
|
| -32767
|
|
(2 rows)
|
|
|
|
SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= int2 '0';
|
|
three | f1
|
|
-------+--------
|
|
| 0
|
|
| -1234
|
|
| -32767
|
|
(3 rows)
|
|
|
|
SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 <= int4 '0';
|
|
three | f1
|
|
-------+--------
|
|
| 0
|
|
| -1234
|
|
| -32767
|
|
(3 rows)
|
|
|
|
SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > int2 '0';
|
|
two | f1
|
|
-----+-------
|
|
| 1234
|
|
| 32767
|
|
(2 rows)
|
|
|
|
SELECT '' AS two, i.* FROM INT2_TBL i WHERE i.f1 > int4 '0';
|
|
two | f1
|
|
-----+-------
|
|
| 1234
|
|
| 32767
|
|
(2 rows)
|
|
|
|
SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= int2 '0';
|
|
three | f1
|
|
-------+-------
|
|
| 0
|
|
| 1234
|
|
| 32767
|
|
(3 rows)
|
|
|
|
SELECT '' AS three, i.* FROM INT2_TBL i WHERE i.f1 >= int4 '0';
|
|
three | f1
|
|
-------+-------
|
|
| 0
|
|
| 1234
|
|
| 32767
|
|
(3 rows)
|
|
|
|
-- positive odds
|
|
SELECT '' AS one, i.* FROM INT2_TBL i WHERE (i.f1 % int2 '2') = int2 '1';
|
|
one | f1
|
|
-----+-------
|
|
| 32767
|
|
(1 row)
|
|
|
|
-- any evens
|
|
SELECT '' AS three, i.* FROM INT2_TBL i WHERE (i.f1 % int4 '2') = int2 '0';
|
|
three | f1
|
|
-------+-------
|
|
| 0
|
|
| 1234
|
|
| -1234
|
|
(3 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 * int2 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+-------
|
|
| 0 | 0
|
|
| 1234 | 2468
|
|
| -1234 | -2468
|
|
| 32767 | -2
|
|
| -32767 | 2
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | 0
|
|
| 1234 | 2468
|
|
| -1234 | -2468
|
|
| 32767 | 65534
|
|
| -32767 | -65534
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 + int2 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | 2
|
|
| 1234 | 1236
|
|
| -1234 | -1232
|
|
| 32767 | -32767
|
|
| -32767 | -32765
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | 2
|
|
| 1234 | 1236
|
|
| -1234 | -1232
|
|
| 32767 | 32769
|
|
| -32767 | -32765
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 - int2 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+-------
|
|
| 0 | -2
|
|
| 1234 | 1232
|
|
| -1234 | -1236
|
|
| 32767 | 32765
|
|
| -32767 | 32767
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | -2
|
|
| 1234 | 1232
|
|
| -1234 | -1236
|
|
| 32767 | 32765
|
|
| -32767 | -32769
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | 0
|
|
| 1234 | 617
|
|
| -1234 | -617
|
|
| 32767 | 16383
|
|
| -32767 | -16383
|
|
(5 rows)
|
|
|
|
SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT2_TBL i;
|
|
five | f1 | x
|
|
------+--------+--------
|
|
| 0 | 0
|
|
| 1234 | 617
|
|
| -1234 | -617
|
|
| 32767 | 16383
|
|
| -32767 | -16383
|
|
(5 rows)
|
|
|