mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Improve contrib/cube's handling of zero-D cubes, infinities, and NaNs.
It's always been possible to create a zero-dimensional cube by converting
from a zero-length float8 array, but cube_in failed to accept the '()'
representation that cube_out produced for that case, resulting in a
dump/reload hazard. Make it accept the case. Also fix a couple of
other places that didn't behave sanely for zero-dimensional cubes:
cube_size would produce 1.0 when surely the answer should be 0.0,
and g_cube_distance risked a divide-by-zero failure.
Likewise, it's always been possible to create cubes containing float8
infinity or NaN coordinate values, but cube_in couldn't parse such input,
and cube_out produced platform-dependent spellings of the values. Convert
them to use float8in_internal and float8out_internal so that the behavior
will be the same as for float8, as we recently did for the core geometric
types (cf commit 50861cd68
). As in that commit, I don't pretend that this
patch fixes all insane corner-case behaviors that may exist for NaNs, but
it's a step forward.
(This change allows removal of the separate cube_1.out and cube_3.out
expected-files, as the platform dependency that previously required them
is now gone: an underflowing coordinate value will now produce an error
not plus or minus zero.)
Make errors from cube_in follow project conventions as to spelling
("invalid input syntax for cube" not "bad cube representation")
and errcode (INVALID_TEXT_REPRESENTATION not SYNTAX_ERROR).
Also a few marginal code cleanups and comment improvements.
Tom Lane, reviewed by Amul Sul
Discussion: <15085.1472494782@sss.pgh.pa.us>
This commit is contained in:
@ -126,16 +126,34 @@ SELECT '-1.0e-7'::cube AS cube;
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
SELECT '1e-300'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-300)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
SELECT '-1e-300'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-300)
|
||||
(1 row)
|
||||
|
||||
SELECT 'infinity'::cube AS cube;
|
||||
cube
|
||||
------------
|
||||
(Infinity)
|
||||
(1 row)
|
||||
|
||||
SELECT '-infinity'::cube AS cube;
|
||||
cube
|
||||
-------------
|
||||
(-Infinity)
|
||||
(1 row)
|
||||
|
||||
SELECT 'NaN'::cube AS cube;
|
||||
cube
|
||||
-------
|
||||
(NaN)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
@ -175,6 +193,12 @@ SELECT '-.1234567890123456'::cube AS cube;
|
||||
(1 row)
|
||||
|
||||
-- simple lists (points)
|
||||
SELECT '()'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
()
|
||||
(1 row)
|
||||
|
||||
SELECT '1,2'::cube AS cube;
|
||||
cube
|
||||
--------
|
||||
@ -200,6 +224,12 @@ SELECT '(1,2,3,4,5)'::cube AS cube;
|
||||
(1 row)
|
||||
|
||||
-- double lists (cubes)
|
||||
SELECT '(),()'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
()
|
||||
(1 row)
|
||||
|
||||
SELECT '(0),(0)'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
@ -250,146 +280,145 @@ SELECT '[(0,0,0,0),(1,0,0,0)]'::cube AS cube;
|
||||
|
||||
-- invalid input: parse errors
|
||||
SELECT ''::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT ''::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT 'ABC'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT 'ABC'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "A"
|
||||
SELECT '()'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
LINE 1: SELECT '()'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '[]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[()]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[()]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1)]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1),]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1),2]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),2]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "2"
|
||||
SELECT '[(1),(2),(3)]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),(2),(3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '1,'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT '1,2,'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2,'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT '1,,2'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,,2'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '(1,)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '(1,2,)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '(1,,2)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,,2)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
-- invalid input: semantic errors and trailing garbage
|
||||
SELECT '[(1),(2)],'::cube AS cube; -- 0
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),(2)],'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '[(1,2,3),(2,3)]'::cube AS cube; -- 1
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1,2,3),(2,3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2,3) and (2,3).
|
||||
SELECT '[(1,2),(1,2,3)]'::cube AS cube; -- 1
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1,2),(1,2,3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2) and (1,2,3).
|
||||
SELECT '(1),(2),'::cube AS cube; -- 2
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1),(2),'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '(1,2,3),(2,3)'::cube AS cube; -- 3
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3),(2,3)'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2,3) and (2,3).
|
||||
SELECT '(1,2),(1,2,3)'::cube AS cube; -- 3
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2),(1,2,3)'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2) and (1,2,3).
|
||||
SELECT '(1,2,3)ab'::cube AS cube; -- 4
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3)ab'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '(1,2,3)a'::cube AS cube; -- 5
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3)a'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '(1,2)('::cube AS cube; -- 5
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2)('::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "("
|
||||
SELECT '1,2ab'::cube AS cube; -- 6
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2ab'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '1 e7'::cube AS cube; -- 6
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1 e7'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "e"
|
||||
SELECT '1,2a'::cube AS cube; -- 7
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2a'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '1..2'::cube AS cube; -- 7
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1..2'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ".2"
|
||||
SELECT '-1e-700'::cube AS cube; -- out of range
|
||||
ERROR: "-1e-700" is out of range for type double precision
|
||||
LINE 1: SELECT '-1e-700'::cube AS cube;
|
||||
^
|
||||
--
|
||||
-- Testing building cubes from float8 values
|
||||
--
|
||||
@ -556,12 +585,12 @@ SELECT cube(cube(1,2), 42, 24); -- cube_c_f8_f8
|
||||
-- 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: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: 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...
|
||||
^
|
||||
DETAIL: A cube cannot have 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: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: 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...
|
||||
^
|
||||
DETAIL: A cube cannot have more than 100 dimensions.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -126,16 +126,34 @@ SELECT '-1.0e-7'::cube AS cube;
|
||||
(-1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
SELECT '1e-300'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-300)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
SELECT '-1e-300'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-300)
|
||||
(1 row)
|
||||
|
||||
SELECT 'infinity'::cube AS cube;
|
||||
cube
|
||||
------------
|
||||
(Infinity)
|
||||
(1 row)
|
||||
|
||||
SELECT '-infinity'::cube AS cube;
|
||||
cube
|
||||
-------------
|
||||
(-Infinity)
|
||||
(1 row)
|
||||
|
||||
SELECT 'NaN'::cube AS cube;
|
||||
cube
|
||||
-------
|
||||
(NaN)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
@ -175,6 +193,12 @@ SELECT '-.1234567890123456'::cube AS cube;
|
||||
(1 row)
|
||||
|
||||
-- simple lists (points)
|
||||
SELECT '()'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
()
|
||||
(1 row)
|
||||
|
||||
SELECT '1,2'::cube AS cube;
|
||||
cube
|
||||
--------
|
||||
@ -200,6 +224,12 @@ SELECT '(1,2,3,4,5)'::cube AS cube;
|
||||
(1 row)
|
||||
|
||||
-- double lists (cubes)
|
||||
SELECT '(),()'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
()
|
||||
(1 row)
|
||||
|
||||
SELECT '(0),(0)'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
@ -250,146 +280,145 @@ SELECT '[(0,0,0,0),(1,0,0,0)]'::cube AS cube;
|
||||
|
||||
-- invalid input: parse errors
|
||||
SELECT ''::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT ''::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT 'ABC'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT 'ABC'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "A"
|
||||
SELECT '()'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
LINE 1: SELECT '()'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '[]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[()]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[()]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1)]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1),]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "]"
|
||||
SELECT '[(1),2]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),2]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "2"
|
||||
SELECT '[(1),(2),(3)]'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),(2),(3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '1,'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT '1,2,'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2,'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at end of input
|
||||
SELECT '1,,2'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,,2'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '(1,)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '(1,2,)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ")"
|
||||
SELECT '(1,,2)'::cube AS cube;
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,,2)'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
-- invalid input: semantic errors and trailing garbage
|
||||
SELECT '[(1),(2)],'::cube AS cube; -- 0
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1),(2)],'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '[(1,2,3),(2,3)]'::cube AS cube; -- 1
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1,2,3),(2,3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2,3) and (2,3).
|
||||
SELECT '[(1,2),(1,2,3)]'::cube AS cube; -- 1
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '[(1,2),(1,2,3)]'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2) and (1,2,3).
|
||||
SELECT '(1),(2),'::cube AS cube; -- 2
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1),(2),'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ","
|
||||
SELECT '(1,2,3),(2,3)'::cube AS cube; -- 3
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3),(2,3)'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2,3) and (2,3).
|
||||
SELECT '(1,2),(1,2,3)'::cube AS cube; -- 3
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2),(1,2,3)'::cube AS cube;
|
||||
^
|
||||
DETAIL: Different point dimensions in (1,2) and (1,2,3).
|
||||
SELECT '(1,2,3)ab'::cube AS cube; -- 4
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3)ab'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '(1,2,3)a'::cube AS cube; -- 5
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2,3)a'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '(1,2)('::cube AS cube; -- 5
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '(1,2)('::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "("
|
||||
SELECT '1,2ab'::cube AS cube; -- 6
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2ab'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '1 e7'::cube AS cube; -- 6
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1 e7'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "e"
|
||||
SELECT '1,2a'::cube AS cube; -- 7
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1,2a'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near "a"
|
||||
SELECT '1..2'::cube AS cube; -- 7
|
||||
ERROR: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: SELECT '1..2'::cube AS cube;
|
||||
^
|
||||
DETAIL: syntax error at or near ".2"
|
||||
SELECT '-1e-700'::cube AS cube; -- out of range
|
||||
ERROR: "-1e-700" is out of range for type double precision
|
||||
LINE 1: SELECT '-1e-700'::cube AS cube;
|
||||
^
|
||||
--
|
||||
-- Testing building cubes from float8 values
|
||||
--
|
||||
@ -556,12 +585,12 @@ SELECT cube(cube(1,2), 42, 24); -- cube_c_f8_f8
|
||||
-- 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: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: 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...
|
||||
^
|
||||
DETAIL: A cube cannot have 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: bad cube representation
|
||||
ERROR: invalid input syntax for cube
|
||||
LINE 1: 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...
|
||||
^
|
||||
DETAIL: A cube cannot have more than 100 dimensions.
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user