Changeset: 68283ddeffa5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68283ddeffa5
Modified Files:
        geom/monetdb5/geom.c
        geom/monetdb5/geomBulk.c
        monetdb5/mal/Tests/tst019.stable.err
        monetdb5/mal/Tests/tst036.stable.err
        monetdb5/mal/Tests/tst054.stable.err
        monetdb5/mal/Tests/tst058.stable.err
        monetdb5/mal/Tests/tst070.stable.err
        monetdb5/mal/Tests/tst804.stable.err
        monetdb5/mal/mal_errors.h
        monetdb5/modules/atoms/mtime.c
        monetdb5/optimizer/opt_pipes.c
        sql/backends/monet5/LSST/lsst.c
        sql/backends/monet5/UDF/cudf/udf.c
        sql/backends/monet5/UDF/pyapi/connection.c
        sql/backends/monet5/UDF/pyapi/conversion.c
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/emit.c
        sql/backends/monet5/UDF/pyapi/formatinput.c
        sql/backends/monet5/UDF/pyapi/pyapi.c
        sql/backends/monet5/UDF/pyapi/pyheader.h
        sql/backends/monet5/UDF/pyapi/pyloader.c
        sql/backends/monet5/UDF/pyapi/type_conversion.c
        sql/backends/monet5/generator/generator.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_assert.c
        sql/backends/monet5/sql_bat2time.c
        sql/backends/monet5/sql_cast.c
        sql/backends/monet5/sql_cast_impl_down_from_flt.h
        sql/backends/monet5/sql_cast_impl_int.h
        sql/backends/monet5/sql_cast_impl_up_to_flt.h
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_fround_impl.h
        sql/backends/monet5/sql_orderidx.c
        sql/backends/monet5/sql_rank.c
        sql/backends/monet5/sql_round_impl.h
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statistics.c
        sql/backends/monet5/sql_transaction.c
        sql/backends/monet5/sql_upgrades.c
        sql/backends/monet5/sql_user.c
        sql/backends/monet5/vaults/bam/bam_export.c
        sql/backends/monet5/vaults/bam/bam_lib.c
        sql/backends/monet5/vaults/bam/bam_loader.c
        sql/backends/monet5/vaults/bam/bam_wrapper.c
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/lidar/lidar.c
        sql/backends/monet5/vaults/netcdf/netcdf.c
        sql/backends/monet5/vaults/shp/shp.c
        sql/backends/monet5/vaults/vault.c
        sql/backends/monet5/wlr.c
        sql/server/rel_dump.c
        sql/server/rel_psm.c
        sql/server/rel_rel.c
        sql/server/rel_schema.c
        sql/server/rel_select.c
        sql/server/rel_semantic.c
        sql/server/rel_sequence.c
        sql/server/rel_trans.c
        sql/server/rel_updates.c
        sql/server/rel_xml.c
        sql/server/sql_env.c
        sql/server/sql_mvc.c
        sql/server/sql_parser.h
        sql/server/sql_parser.y
        sql/server/sql_privileges.c
        sql/server/sql_scan.c
Branch: data-vaults
Log Message:

Merge with default

Change to the SQLSTATE macro


diffs (truncated from 15023 to 300 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -71,7 +71,7 @@ transformCoordSeq(int idx, int coordinat
        if (!GEOSCoordSeq_getX(gcs_old, idx, &x) ||
            !GEOSCoordSeq_getY(gcs_old, idx, &y) ||
            (coordinatesNum > 2 && !GEOSCoordSeq_getZ(gcs_old, idx, &z)))
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos cannot get 
coordinates");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos cannot get 
coordinates");
 
        /* check if the passed reference system is geographic (proj=latlong)
         * and change the degrees to radians because pj_transform works with 
radians*/
@@ -83,9 +83,9 @@ transformCoordSeq(int idx, int coordinat
        errorNum = pj_get_errno_ref();
        if (*errorNum != 0) {
                if (coordinatesNum > 2)
-                       throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos 
cannot transform point (%f %f %f): %s\n", x, y, z, pj_strerrno(*errorNum));
+                       throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos 
cannot transform point (%f %f %f): %s\n", x, y, z, pj_strerrno(*errorNum));
                else
-                       throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos 
cannot transform point (%f %f): %s\n", x, y, pj_strerrno(*errorNum));
+                       throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos 
cannot transform point (%f %f): %s\n", x, y, pj_strerrno(*errorNum));
        }
 
        /* check if the destination reference system is geographic and change
@@ -96,7 +96,7 @@ transformCoordSeq(int idx, int coordinat
        if (!GEOSCoordSeq_setX(gcs_new, idx, x) ||
            !GEOSCoordSeq_setY(gcs_new, idx, y) ||
            (coordinatesNum > 2 && !GEOSCoordSeq_setZ(gcs_new, idx, z)))
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos cannot set 
coordinates");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos cannot set 
coordinates");
 
        return MAL_SUCCEED;
 }
@@ -117,12 +117,12 @@ transformPoint(GEOSGeometry **transforme
        gcs_old = GEOSGeom_getCoordSeq(geosGeometry);
 
        if (gcs_old == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
 
        /* create the coordinates sequence for the transformed geometry */
        gcs_new = GEOSCoordSeq_create(1, coordinatesNum);
        if (gcs_new == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
 
        /* create the transformed coordinates */
        ret = transformCoordSeq(0, coordinatesNum, proj4_src, proj4_dst, 
gcs_old, gcs_new);
@@ -135,7 +135,7 @@ transformPoint(GEOSGeometry **transforme
        *transformedGeometry = GEOSGeom_createPoint(gcs_new);
        if (*transformedGeometry == NULL) {
                GEOSCoordSeq_destroy(gcs_new);
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
        }
 
        return MAL_SUCCEED;
@@ -155,16 +155,16 @@ transformLine(GEOSCoordSeq *gcs_new, con
        gcs_old = GEOSGeom_getCoordSeq(geosGeometry);
 
        if (gcs_old == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
 
        /* get the number of points in the geometry */
        if (!GEOSCoordSeq_getSize(gcs_old, &pointsNum))
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_getSize failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_getSize failed");
 
        /* create the coordinates sequence for the transformed geometry */
        *gcs_new = GEOSCoordSeq_create(pointsNum, coordinatesNum);
        if (*gcs_new == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_create failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_create failed");
 
        /* create the transformed coordinates */
        for (i = 0; i < pointsNum; i++) {
@@ -195,7 +195,7 @@ transformLineString(GEOSGeometry **trans
        *transformedGeometry = GEOSGeom_createLineString(coordSeq);
        if (*transformedGeometry == NULL) {
                GEOSCoordSeq_destroy(coordSeq);
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_createLineString failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_createLineString failed");
        }
 
        return ret;
@@ -217,7 +217,7 @@ transformLinearRing(GEOSGeometry **trans
        *transformedGeometry = GEOSGeom_createLinearRing(coordSeq);
        if (*transformedGeometry == NULL) {
                GEOSCoordSeq_destroy(coordSeq);
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_createLineString failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGeom_createLineString failed");
        }
 
        return ret;
@@ -236,7 +236,7 @@ transformPolygon(GEOSGeometry **transfor
        exteriorRingGeometry = GEOSGetExteriorRing(geosGeometry);
        if (exteriorRingGeometry == NULL) {
                *transformedGeometry = NULL;
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGetExteriorRing failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGetExteriorRing failed");
        }
 
        ret = transformLinearRing(&transformedExteriorRingGeometry, 
exteriorRingGeometry, proj4_src, proj4_dst);
@@ -250,7 +250,7 @@ transformPolygon(GEOSGeometry **transfor
        if (numInteriorRings == -1) {
                *transformedGeometry = NULL;
                GEOSGeom_destroy(transformedExteriorRingGeometry);
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGetInteriorRingN failed.");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGetInteriorRingN failed.");
        }
 
        /* iterate over the interiorRing and transform each one of them */
@@ -258,7 +258,7 @@ transformPolygon(GEOSGeometry **transfor
        if (transformedInteriorRingGeometries == NULL) {
                *transformedGeometry = NULL;
                GEOSGeom_destroy(transformedExteriorRingGeometry);
-               throw(MAL, "geom.Transform", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
+               throw(MAL, "geom.Transform", SQLSTATE(HY001) MAL_MALLOC_FAIL);
        }
        for (i = 0; i < numInteriorRings; i++) {
                ret = 
transformLinearRing(&transformedInteriorRingGeometries[i], 
GEOSGetInteriorRingN(geosGeometry, i), proj4_src, proj4_dst);
@@ -277,7 +277,7 @@ transformPolygon(GEOSGeometry **transfor
        if (*transformedGeometry == NULL) {
                for (i = 0; i < numInteriorRings; i++)
                        GEOSGeom_destroy(transformedInteriorRingGeometries[i]);
-               ret = createException(MAL, "geom.Transform", "SQLSTATE 38000 
!""Geos operation GEOSGeom_createPolygon failed");
+               ret = createException(MAL, "geom.Transform", SQLSTATE(38000) 
"Geos operation GEOSGeom_createPolygon failed");
        }
        GDKfree(transformedInteriorRingGeometries);
        GEOSGeom_destroy(transformedExteriorRingGeometry);
@@ -295,16 +295,16 @@ transformMultiGeometry(GEOSGeometry **tr
 
        geometriesNum = GEOSGetNumGeometries(geosGeometry);
        if (geometriesNum == -1)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
GEOSGetNumGeometries failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
GEOSGetNumGeometries failed");
        transformedMultiGeometries = GDKmalloc(geometriesNum * 
sizeof(GEOSGeometry *));
        if (transformedMultiGeometries == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE HY001 !"MAL_MALLOC_FAIL);
+               throw(MAL, "geom.Transform", SQLSTATE(HY001) MAL_MALLOC_FAIL);
 
        for (i = 0; i < geometriesNum; i++) {
                if ((multiGeometry = GEOSGetGeometryN(geosGeometry, i)) == NULL)
-                       ret = createException(MAL, "geom.Transform", "SQLSTATE 
38000 !""Geos operation GEOSGetGeometryN failed");
+                       ret = createException(MAL, "geom.Transform", 
SQLSTATE(38000) "Geos operation GEOSGetGeometryN failed");
                else if ((subGeometryType = GEOSGeomTypeId(multiGeometry) + 1) 
== 0)
-                       ret = createException(MAL, "geom.Transform", "SQLSTATE 
38000 !""Geos operation GEOSGeomTypeId failed");
+                       ret = createException(MAL, "geom.Transform", 
SQLSTATE(38000) "Geos operation GEOSGeomTypeId failed");
                else {
                        switch (subGeometryType) {
                        case wkbPoint_mdb:
@@ -320,7 +320,7 @@ transformMultiGeometry(GEOSGeometry **tr
                                ret = 
transformPolygon(&transformedMultiGeometries[i], multiGeometry, proj4_src, 
proj4_dst, srid);
                                break;
                        default:
-                               ret = createException(MAL, "geom.Transform", 
"SQLSTATE 38000 !""Geos unknown geometry type");
+                               ret = createException(MAL, "geom.Transform", 
SQLSTATE(38000) "Geos unknown geometry type");
                                break;
                        }
                }
@@ -340,7 +340,7 @@ transformMultiGeometry(GEOSGeometry **tr
        if (*transformedGeometry == NULL) {
                for (i = 0; i < geometriesNum; i++)
                        GEOSGeom_destroy(transformedMultiGeometries[i]);
-               ret = createException(MAL, "geom.Transform", "SQLSTATE 38000 
!""Geos operation GEOSGeom_createCollection failed");
+               ret = createException(MAL, "geom.Transform", SQLSTATE(38000) 
"Geos operation GEOSGeom_createCollection failed");
        }
        GDKfree(transformedMultiGeometries);
 
@@ -401,7 +401,7 @@ wkbTransform(wkb **transformedWKB, wkb *
        (void) srid_dst;
        (void) proj4_src_str;
        (void) proj4_dst_str;
-       throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos function Not 
Implemented");
+       throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos function Not 
Implemented");
 #else
        projPJ proj4_src, proj4_dst;
        GEOSGeom geosGeometry, transformedGeosGeometry;
@@ -410,7 +410,7 @@ wkbTransform(wkb **transformedWKB, wkb *
        str ret = MAL_SUCCEED;
 
        if (*geomWKB == NULL)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos wkb format 
is null");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos wkb format 
is null");
 
        if (wkb_isnil(*geomWKB) ||
            *srid_src == int_nil ||
@@ -418,14 +418,14 @@ wkbTransform(wkb **transformedWKB, wkb *
            strcmp(*proj4_src_str, str_nil) == 0 ||
            strcmp(*proj4_dst_str, str_nil) == 0) {
                if ((*transformedWKB = wkbNULLcopy()) == NULL)
-                       throw(MAL, "geom.Transform", "SQLSTATE HY001 
!"MAL_MALLOC_FAIL);
+                       throw(MAL, "geom.Transform", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
                return MAL_SUCCEED;
        }
 
        if (strcmp(*proj4_src_str, "null") == 0)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Cannot find in 
spatial_ref_sys srid %d\n", *srid_src);
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Cannot find in 
spatial_ref_sys srid %d\n", *srid_src);
        if (strcmp(*proj4_dst_str, "null") == 0)
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Cannot find in 
spatial_ref_sys srid %d\n", *srid_dst);
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Cannot find in 
spatial_ref_sys srid %d\n", *srid_dst);
 
        proj4_src = /*pj_init_plus */ projFromStr(*proj4_src_str);
        proj4_dst = /*pj_init_plus */ projFromStr(*proj4_dst_str);
@@ -434,7 +434,7 @@ wkbTransform(wkb **transformedWKB, wkb *
                        pj_free(proj4_src);
                if (proj4_dst)
                        pj_free(proj4_dst);
-               throw(MAL, "geom.Transform", "SQLSTATE 38000 !""Geos operation 
pj_init failed");
+               throw(MAL, "geom.Transform", SQLSTATE(38000) "Geos operation 
pj_init failed");
        }
 
        /* get the geosGeometry from the wkb */
@@ -462,7 +462,7 @@ wkbTransform(wkb **transformedWKB, wkb *
                break;
        default:
                transformedGeosGeometry = NULL;
-               ret = createException(MAL, "geom.Transform", "SQLSTATE 38000 
!""Geos unknown geometry type");
+               ret = createException(MAL, "geom.Transform", SQLSTATE(38000) 
"Geos unknown geometry type");
        }
 
        if (ret == MAL_SUCCEED && transformedGeosGeometry) {
@@ -470,7 +470,7 @@ wkbTransform(wkb **transformedWKB, wkb *
                GEOSSetSRID(transformedGeosGeometry, *srid_dst);
                /* get the wkb */
                if ((*transformedWKB = geos2wkb(transformedGeosGeometry)) == 
NULL)
-                       ret = createException(MAL, "geom.Transform", "SQLSTATE 
38000 !""Geos operation geos2wkb failed");
+                       ret = createException(MAL, "geom.Transform", 
SQLSTATE(38000) "Geos operation geos2wkb failed");
                /* destroy the geos geometries */
                GEOSGeom_destroy(transformedGeosGeometry);
        }
@@ -491,21 +491,21 @@ forceDimCoordSeq(int idx, int coordinate
 
        //get the coordinates
        if (!GEOSCoordSeq_getX(gcs_old, idx, &x))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_getX failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_getX failed");
        if (!GEOSCoordSeq_getY(gcs_old, idx, &y))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_getY failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_getY failed");
        if (coordinatesNum > 2 && dim > 2 &&    //read it only if needed (dim 
>2)
            !GEOSCoordSeq_getZ(gcs_old, idx, &z))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_getZ failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_getZ failed");
 
        //create the new coordinates
        if (!GEOSCoordSeq_setX(gcs_new, idx, x))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_setX failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_setX failed");
        if (!GEOSCoordSeq_setY(gcs_new, idx, y))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_setY failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_setY failed");
        if (dim > 2)
                if (!GEOSCoordSeq_setZ(gcs_new, idx, z))
-                       throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos 
operation GEOSCoordSeq_setZ failed");
+                       throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos 
operation GEOSCoordSeq_setZ failed");
        return MAL_SUCCEED;
 }
 
@@ -524,13 +524,13 @@ forceDimPoint(GEOSGeometry **outGeometry
 
        if (gcs_old == NULL) {
                *outGeometry = NULL;
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
        }
 
        /* create the coordinates sequence for the translated geometry */
        if ((gcs_new = GEOSCoordSeq_create(1, dim)) == NULL) {
                *outGeometry = NULL;
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_create failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_create failed");
        }
 
        /* create the translated coordinates */
@@ -545,7 +545,7 @@ forceDimPoint(GEOSGeometry **outGeometry
        *outGeometry = GEOSGeom_createPoint(gcs_new);
        if (*outGeometry == NULL) {
                GEOSCoordSeq_destroy(gcs_new);
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_createPoint failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSGeom_createPoint failed");
        }
 
        return MAL_SUCCEED;
@@ -566,16 +566,16 @@ forceDimLineString(GEOSGeometry **outGeo
        gcs_old = GEOSGeom_getCoordSeq(geosGeometry);
 
        if (gcs_old == NULL)
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSGeom_getCoordSeq failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSGeom_getCoordSeq failed");
 
        /* get the number of points in the geometry */
        if (!GEOSCoordSeq_getSize(gcs_old, &pointsNum))
-               throw(MAL, "geom.ForceDim", "SQLSTATE 38000 !""Geos operation 
GEOSCoordSeq_getSize failed");
+               throw(MAL, "geom.ForceDim", SQLSTATE(38000) "Geos operation 
GEOSCoordSeq_getSize failed");
 
        /* create the coordinates sequence for the translated geometry */
        gcs_new = GEOSCoordSeq_create(pointsNum, dim);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to