|
5 | 5 | -- first, define the datatype. Turn off echoing so that expected file
|
6 | 6 | -- does not depend on contents of cube.sql.
|
7 | 7 | --
|
| 8 | +SET client_min_messages = warning; |
8 | 9 | \set ECHO none
|
9 |
| -psql:cube.sql:10: NOTICE: type "cube" is not yet defined |
10 |
| -DETAIL: Creating a shell type definition. |
11 |
| -psql:cube.sql:15: NOTICE: argument type cube is only a shell |
| 10 | +RESET client_min_messages; |
12 | 11 | --
|
13 | 12 | -- testing the input and output functions
|
14 | 13 | --
|
@@ -395,6 +394,37 @@ SELECT '(0)'::text::cube;
|
395 | 394 | (0)
|
396 | 395 | (1 row)
|
397 | 396 |
|
| 397 | +-- |
| 398 | +-- Test the float[] -> cube cast |
| 399 | +-- |
| 400 | +SELECT cube('{0,1,2}'::float[], '{3,4,5}'::float[]); |
| 401 | + cube |
| 402 | +--------------------- |
| 403 | + (0, 1, 2),(3, 4, 5) |
| 404 | +(1 row) |
| 405 | + |
| 406 | +SELECT cube('{0,1,2}'::float[], '{3}'::float[]); |
| 407 | +ERROR: UR and LL arrays must be of same length |
| 408 | +SELECT cube(NULL::float[], '{3}'::float[]); |
| 409 | + cube |
| 410 | +------ |
| 411 | + |
| 412 | +(1 row) |
| 413 | + |
| 414 | +SELECT cube('{0,1,2}'::float[]); |
| 415 | + cube |
| 416 | +----------- |
| 417 | + (0, 1, 2) |
| 418 | +(1 row) |
| 419 | + |
| 420 | +SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]); |
| 421 | + cube_subset |
| 422 | +--------------------------- |
| 423 | + (5, 3, 1, 1),(8, 7, 6, 6) |
| 424 | +(1 row) |
| 425 | + |
| 426 | +SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]); |
| 427 | +ERROR: Index out of bounds |
398 | 428 | --
|
399 | 429 | -- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
|
400 | 430 | --
|
@@ -1021,18 +1051,18 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
|
1021 | 1051 | CREATE TABLE test_cube (c cube);
|
1022 | 1052 | \copy test_cube from 'data/test_cube.data'
|
1023 | 1053 | CREATE INDEX test_cube_ix ON test_cube USING gist (c);
|
1024 |
| -SELECT * FROM test_cubeWHERE c && '(3000,1000),(0,0)'; |
| 1054 | +SELECT * FROM test_cubeWHERE c && '(3000,1000),(0,0)' ORDER BY c; |
1025 | 1055 | c
|
1026 | 1056 | --------------------------
|
1027 |
| - (2424, 160),(2424, 81) |
| 1057 | + (337, 455),(240, 359) |
1028 | 1058 | (759, 187),(662, 163)
|
1029 | 1059 | (1444, 403),(1346, 344)
|
1030 |
| - (337, 455),(240, 359) |
1031 | 1060 | (1594, 1043),(1517, 971)
|
| 1061 | + (2424, 160),(2424, 81) |
1032 | 1062 | (5 rows)
|
1033 | 1063 |
|
1034 | 1064 | -- Test sorting
|
1035 |
| -SELECT * FROM test_cubeWHERE c && '(3000,1000),(0,0)' GROUP BY c; |
| 1065 | +SELECT * FROM test_cubeWHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c; |
1036 | 1066 | c
|
1037 | 1067 | --------------------------
|
1038 | 1068 | (337, 455),(240, 359)
|
|