Changeset: 8405a83831ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8405a83831ad
Branch: new_rmt_opt
Log Message:

merged with default


diffs (256 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -25,7 +25,7 @@ jobs:
           - os: macos-latest
             c_compiler: clang
           - os: macos-latest
-            c_compiler: gcc
+            c_compiler: gcc-12
           - os: ubuntu-latest
             c_compiler: gcc
           - os: ubuntu-latest
@@ -37,6 +37,8 @@ jobs:
             c_compiler: clang
           - os: macos-latest
             c_compiler: cl
+          - os: macos-latest
+            c_compiler: gcc
           - os: ubuntu-latest
             c_compiler: cl
     runs-on: ${{ matrix.os }}
@@ -60,10 +62,11 @@ jobs:
             -DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'Linux'
-      -
-        name: brew packages
+
+      - name: brew packages
         run: brew install bison
         if: runner.os == 'macOS'
+
       - name: make MonetDB on macos
         run: |
           mkdir build
@@ -79,6 +82,19 @@ jobs:
             -DCMAKE_SUMMARY=ON
           make install -j3
         if: runner.os == 'macOS'
+
+      - name: choco packages
+        run: choco install winflexbison
+        if: runner.os == 'Windows'
+
+      - name: make MonetDB on Windows
+        run: |
+          mkdir build
+          cd build 
+          cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DRINTEGRATION=OFF  -DCMAKE_BUILD_TYPE=Release 
-DASSERT=OFF -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}  -DCMAKE_SUMMARY=ON
+          make install -j3
+        if: runner.os == 'Windows'
+
       - name: ctest 
         run: |
           cd build 
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -114,97 +114,99 @@ wkbCollectAggrSubGroupedCand(bat *outid,
                goto free;
        }
 
-       //All unions for output BAT
-       if ((unions = GDKzalloc(sizeof(wkb *) * ngrp)) == NULL) {
-               msg = createException(MAL, "geom.Collect", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-               BBPreclaim(out);
-               goto free;
-       }
-
-       //Intermediate array for all the geometries in a group
-       if ((unionGroup = GDKzalloc(sizeof(GEOSGeom) * ci.ncand)) == NULL) {
-               msg = createException(MAL, "geom.Collect", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-               BBPreclaim(out);
-               if (unions)
-                       GDKfree(unions);
-               goto free;
-       }
-
-       if (g && !BATtdense(g))
-               gids = (const oid *)Tloc(g, 0);
-       bi = bat_iterator(b);
-
-       for (BUN i = 0; i < ci.ncand; i++) {
-               oid o = canditer_next(&ci);
-               BUN p = o - b->hseqbase;
-               oid grp = gids ? gids[p] : g ? min + (oid)p : 0;
-               wkb *inWKB = (wkb *)BUNtvar(bi, p);
-               GEOSGeom inGEOM = wkb2geos(inWKB);
-
-
-               if (grp != lastGrp) {
-                       if (lastGrp != (oid)-1) {
-                               //Finish the previous group, move on to the 
next one
-                               collection = 
GEOSGeom_createCollection(geomCollectionType, unionGroup, (unsigned int) 
geomCount);
-                               GEOSSetSRID(collection,srid);
-                               //Save collection to unions array as wkb
-                               unions[lastGrp] = geos2wkb(collection);
-
-                               GEOSGeom_destroy(collection);
-                               GDKfree(unionGroup);
-
-                               if ((unionGroup = GDKzalloc(sizeof(GEOSGeom) * 
ci.ncand)) == NULL) {
-                                       msg = createException(MAL, 
"geom.Collect", SQLSTATE(HY013) MAL_MALLOC_FAIL);
-                                       //Frees
-                                       bat_iterator_end(&bi);
-                                       if (unions) {
-                                               for (BUN i = 0; i < ngrp; i++)
-                                                       GDKfree(unions[i]);
-                                               GDKfree(unions);
+       if (ngrp) {
+               //All unions for output BAT
+               if ((unions = GDKzalloc(sizeof(wkb *) * ngrp)) == NULL) {
+                       msg = createException(MAL, "geom.Collect", 
SQLSTATE(HY013) MAL_MALLOC_FAIL);
+                       BBPreclaim(out);
+                       goto free;
+               }
+
+               //Intermediate array for all the geometries in a group
+               if ((unionGroup = GDKzalloc(sizeof(GEOSGeom) * ci.ncand)) == 
NULL) {
+                       msg = createException(MAL, "geom.Collect", 
SQLSTATE(HY013) MAL_MALLOC_FAIL);
+                       BBPreclaim(out);
+                       if (unions)
+                               GDKfree(unions);
+                       goto free;
+               }
+
+               if (g && !BATtdense(g))
+                       gids = (const oid *)Tloc(g, 0);
+               bi = bat_iterator(b);
+
+               for (BUN i = 0; i < ci.ncand; i++) {
+                       oid o = canditer_next(&ci);
+                       BUN p = o - b->hseqbase;
+                       oid grp = gids ? gids[p] : g ? min + (oid)p : 0;
+                       wkb *inWKB = (wkb *)BUNtvar(bi, p);
+                       GEOSGeom inGEOM = wkb2geos(inWKB);
+
+
+                       if (grp != lastGrp) {
+                               if (lastGrp != (oid)-1) {
+                                       //Finish the previous group, move on to 
the next one
+                                       collection = 
GEOSGeom_createCollection(geomCollectionType, unionGroup, (unsigned int) 
geomCount);
+                                       GEOSSetSRID(collection,srid);
+                                       //Save collection to unions array as wkb
+                                       unions[lastGrp] = geos2wkb(collection);
+
+                                       GEOSGeom_destroy(collection);
+                                       GDKfree(unionGroup);
+
+                                       if ((unionGroup = 
GDKzalloc(sizeof(GEOSGeom) * ci.ncand)) == NULL) {
+                                               msg = createException(MAL, 
"geom.Collect", SQLSTATE(HY013) MAL_MALLOC_FAIL);
+                                               //Frees
+                                               bat_iterator_end(&bi);
+                                               if (unions) {
+                                                       for (BUN i = 0; i < 
ngrp; i++)
+                                                               
GDKfree(unions[i]);
+                                                       GDKfree(unions);
+                                               }
+                                               if (unionGroup) {
+                                                       for (BUN i = 0; i < 
geomCount; i++)
+                                                               if 
(unionGroup[i])
+                                                                       
GEOSGeom_destroy(unionGroup[i]);
+                                                       GDKfree(unionGroup);
+                                               }
+                                               goto free;
                                        }
-                                       if (unionGroup) {
-                                               for (BUN i = 0; i < geomCount; 
i++)
-                                                       if (unionGroup[i])
-                                                               
GEOSGeom_destroy(unionGroup[i]);
-                                               GDKfree(unionGroup);
-                                       }
-                                       goto free;
                                }
+                               geomCount = 0;
+                               lastGrp = grp;
+                               geomCollectionType = 
GEOSGeom_getCollectionType(GEOSGeomTypeId(inGEOM));
+                               srid = GEOSGetSRID(inGEOM);
                        }
-                       geomCount = 0;
-                       lastGrp = grp;
-                       geomCollectionType = 
GEOSGeom_getCollectionType(GEOSGeomTypeId(inGEOM));
-                       srid = GEOSGetSRID(inGEOM);
+                       unionGroup[geomCount] = inGEOM;
+                       geomCount += 1;
+                       if (geomCollectionType != GEOS_GEOMETRYCOLLECTION && 
GEOSGeom_getCollectionType(GEOSGeomTypeId(inGEOM)) != geomCollectionType)
+                               geomCollectionType = GEOS_GEOMETRYCOLLECTION;
                }
-               unionGroup[geomCount] = inGEOM;
-               geomCount += 1;
-               if (geomCollectionType != GEOS_GEOMETRYCOLLECTION && 
GEOSGeom_getCollectionType(GEOSGeomTypeId(inGEOM)) != geomCollectionType)
-                       geomCollectionType = GEOS_GEOMETRYCOLLECTION;
-       }
-       //Last collection
-       collection = GEOSGeom_createCollection(geomCollectionType, unionGroup, 
(unsigned int) geomCount);
-       GEOSSetSRID(collection,srid);
-       unions[lastGrp] = geos2wkb(collection);
-
-       GEOSGeom_destroy(collection);
-       GDKfree(unionGroup);
-
-       if (BUNappendmulti(out, unions, ngrp, false) != GDK_SUCCEED) {
-               msg = createException(MAL, "geom.Union", SQLSTATE(38000) 
"BUNappend operation failed");
+               //Last collection
+               collection = GEOSGeom_createCollection(geomCollectionType, 
unionGroup, (unsigned int) geomCount);
+               GEOSSetSRID(collection,srid);
+               unions[lastGrp] = geos2wkb(collection);
+
+               GEOSGeom_destroy(collection);
+               GDKfree(unionGroup);
+
+               if (BUNappendmulti(out, unions, ngrp, false) != GDK_SUCCEED) {
+                       msg = createException(MAL, "geom.Union", 
SQLSTATE(38000) "BUNappend operation failed");
+                       bat_iterator_end(&bi);
+                       if (unions) {
+                               for (BUN i = 0; i < ngrp; i++)
+                                       GDKfree(unions[i]);
+                               GDKfree(unions);
+                       }
+                       goto free;
+               }
+
                bat_iterator_end(&bi);
-               if (unions) {
-                       for (BUN i = 0; i < ngrp; i++)
-                               GDKfree(unions[i]);
-                       GDKfree(unions);
-               }
-               goto free;
-       }
-
-       bat_iterator_end(&bi);
-       for (BUN i = 0; i < ngrp; i++)
-               GDKfree(unions[i]);
-       GDKfree(unions);
-
+               for (BUN i = 0; i < ngrp; i++)
+                       GDKfree(unions[i]);
+               GDKfree(unions);
+
+       }
        *outid = out->batCacheid;
        BBPkeepref(out);
        BBPunfix(b->batCacheid);
diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -2381,7 +2381,7 @@ command_snapshot(int argc, char *argv[])
 int
 main(int argc, char *argv[])
 {
-       char buf[1024];
+       char buf[1024+10];
        int i;
        int retval = 0;
 #ifdef TIOCGWINSZ
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to