summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-06-24 20:53:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-06-24 20:53:34 +0000
commitb90f8f20f035c3313f8a284346b5a1d155cfd2f0 (patch)
tree68ea92accca0015cc6d16c22f860c6c8167a82b6 /src/test
parent39f3c5d3850f7c50d363e8984280784251317e8b (diff)
Extend r-tree operator classes to handle Y-direction tests equivalent
to the existing X-direction tests. An rtree class now includes 4 actual 2-D tests, 4 1-D X-direction tests, and 4 1-D Y-direction tests. This involved adding four new Y-direction test operators for each of box and polygon; I followed the PostGIS project's lead as to the names of these operators. NON BACKWARDS COMPATIBLE CHANGE: the poly_overleft (&<) and poly_overright (&>) operators now have semantics comparable to box_overleft and box_overright. This is necessary to make r-tree indexes work correctly on polygons. Also, I changed circle_left and circle_right to agree with box_left and box_right --- formerly they allowed the boundaries to touch. This isn't actually essential given the lack of any r-tree opclass for circles, but it seems best to sync all the definitions while we are at it.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/opr_sanity.out6
-rw-r--r--src/test/regress/expected/polygon.out11
-rw-r--r--src/test/regress/sql/polygon.sql2
3 files changed, 11 insertions, 8 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index e2e59d675e6..05bfe054d7a 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -803,6 +803,10 @@ ORDER BY 1, 2, 3;
402 | 6 | ~=
402 | 7 | ~
402 | 8 | @
+ 402 | 9 | &<|
+ 402 | 10 | <<|
+ 402 | 11 | |>>
+ 402 | 12 | |&>
403 | 1 | <
403 | 1 | ~<~
403 | 2 | <=
@@ -815,7 +819,7 @@ ORDER BY 1, 2, 3;
403 | 5 | ~>~
405 | 1 | =
405 | 1 | ~=~
-(20 rows)
+(24 rows)
-- Check that all operators linked to by opclass entries have selectivity
-- estimators. This is not absolutely required, but it seems a reasonable
diff --git a/src/test/regress/expected/polygon.out b/src/test/regress/expected/polygon.out
index e9032d4dbcd..3d761e527fb 100644
--- a/src/test/regress/expected/polygon.out
+++ b/src/test/regress/expected/polygon.out
@@ -67,9 +67,8 @@ SELECT '' AS two, p.*
WHERE p.f1 &> '(3.0,1.0),(3.0,3.0),(1.0,0.0)';
two | f1
-----+---------------------
- | ((2,0),(2,4),(0,0))
| ((3,1),(3,3),(1,0))
-(2 rows)
+(1 row)
-- left of
SELECT '' AS one, p.*
@@ -144,10 +143,10 @@ SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' << polygon '(3.0,1.0),(3.0,3.0),(
(1 row)
-- right overlap
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
- true
-------
- t
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
+ false
+-------
+ f
(1 row)
-- right of
diff --git a/src/test/regress/sql/polygon.sql b/src/test/regress/sql/polygon.sql
index 1e20f381753..5ac3343cb1c 100644
--- a/src/test/regress/sql/polygon.sql
+++ b/src/test/regress/sql/polygon.sql
@@ -100,7 +100,7 @@ SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' << polygon '(3.0,1.0),(3.0,3.0),(
SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' << polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
-- right overlap
-SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS true;
+SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' &> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;
-- right of
SELECT polygon '(2.0,0.0),(2.0,4.0),(0.0,0.0)' >> polygon '(3.0,1.0),(3.0,3.0),(1.0,0.0)' AS false;