Changeset: 075187d80709 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=075187d80709
Modified Files:
        geom/monetdb5/geom.c
        geom/sql/Tests/relation.stable.err
Branch: Oct2014
Log Message:

GEOSRelatePattern returns 2 in case of failure.


diffs (79 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -1056,6 +1056,7 @@ wkbRelate(bit *out, wkb **a, wkb **b, co
 {
        GEOSGeom ga = wkb2geos(*a);
        GEOSGeom gb = wkb2geos(*b);
+       char res;
 
        if (!ga && gb) {
                GEOSGeom_destroy(gb);
@@ -1072,11 +1073,14 @@ wkbRelate(bit *out, wkb **a, wkb **b, co
                return MAL_SUCCEED;
        }
 
-       *out = GEOSRelatePattern(ga, gb, *pattern);
+       res = GEOSRelatePattern(ga, gb, *pattern);
 
        GEOSGeom_destroy(ga);
        GEOSGeom_destroy(gb);
 
+       if (res == 2)
+               throw(MAL, "geom.Relate", GDK_EXCEPTION);
+       *out = (bit) res;
        return MAL_SUCCEED;
 }
 
diff --git a/geom/sql/Tests/relation.stable.err 
b/geom/sql/Tests/relation.stable.err
--- a/geom/sql/Tests/relation.stable.err
+++ b/geom/sql/Tests/relation.stable.err
@@ -10,36 +10,37 @@ stderr of test 'relation` in directory '
 # 22:42:46 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=koala --port=32262 
 # 22:42:46 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('LINESTRING(10 10)');
 ERROR = !IllegalArgumentException: point array must contain 0 or >1 elements
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('LINESTRING(10)');
 ERROR = !ParseException: Expected number but encountered ')'
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('LINESTRING()');
 ERROR = !ParseException: Expected number but encountered ')'
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('LINESTRING');
 ERROR = !ParseException: Expected word but encountered end of stream
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('');
 ERROR = !ParseException: Expected word but encountered end of stream
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('POINT(10)');
 ERROR = !ParseException: Expected number but encountered ')'
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('POINT()');
 ERROR = !ParseException: Expected number but encountered ')'
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('POINT');
 ERROR = !ParseException: Expected word but encountered end of stream
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = INSERT INTO geoms values ('');
 ERROR = !ParseException: Expected word but encountered end of stream
-MAPI  = (monetdb) /var/tmp/mtest-14314/.s.monetdb.37270
+MAPI  = (monetdb) /var/tmp/mtest-21146/.s.monetdb.32090
 QUERY = SELECT a.g, b.g, Relate(a.g,b.g,'Touches') FROM geoms a, geoms b where 
a.g is not NULL and b.g is not NULL order by a.g, b.g;
-ERROR = !GDKerror:!ERROR: IllegalArgumentException: IllegalArgumentException: 
Should be length 9, is [Touches] instead
+ERROR = !GDK reported error.
+        !IllegalArgumentException: IllegalArgumentException: Should be length 
9, is [Touches] instead
 
 # 14:48:45 >  
 # 14:48:45 >  Done.
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to