1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

This is a comprehensive set of diffs (versus current CVS) that replaces those

attached to the same message with the Earth Distance patches.
Recent changes include changing the subscript in one place I forgot
in the previous bugfix patch. A couple of added regression tests, which
should help catch this mistake if it reappears.
I also put in a limit of 100 dimensions in cube_large and cube_in to
prevent making it easy to create very large cubes. Changing one define
in cubedata.h will raise the limit if some needs more dimensions.

Bruno Wolff III
This commit is contained in:
Bruce Momjian
2002-09-12 00:26:00 +00:00
parent eb5bf51372
commit e57ab04565
8 changed files with 160 additions and 59 deletions

View File

@ -339,6 +339,15 @@ ERROR: (7) bad cube representation; garbage at or before char 4, ('end of input
SELECT '1..2'::cube AS cube; -- 7
ERROR: (7) bad cube representation; garbage at or before char 4, ('end of input', \000)
--
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
--
select '(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)'::cube;
ERROR: (8) bad cube representation; more than 100 dimensions
select '(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)'::cube;
ERROR: (8) bad cube representation; more than 100 dimensions
--
-- testing the operators
--
@ -1109,6 +1118,12 @@ SELECT cube_enlarge('(0)'::cube, 0, 2);
(0)
(1 row)
SELECT cube_enlarge('(2),(-2)'::cube, 0, 4);
cube_enlarge
--------------
(-2),(2)
(1 row)
SELECT cube_enlarge('(0)'::cube, 1, 0);
cube_enlarge
--------------
@ -1127,6 +1142,12 @@ SELECT cube_enlarge('(0)'::cube, 1, 2);
(-1, -1),(1, 1)
(1 row)
SELECT cube_enlarge('(2),(-2)'::cube, 1, 4);
cube_enlarge
-------------------------------
(-3, -1, -1, -1),(3, 1, 1, 1)
(1 row)
SELECT cube_enlarge('(0)'::cube, -1, 0);
cube_enlarge
--------------
@ -1145,6 +1166,12 @@ SELECT cube_enlarge('(0)'::cube, -1, 2);
(0)
(1 row)
SELECT cube_enlarge('(2),(-2)'::cube, -1, 4);
cube_enlarge
--------------
(-1),(1)
(1 row)
SELECT cube_enlarge('(0,0,0)'::cube, 1, 0);
cube_enlarge
------------------------