MonetDB: resultset - Merge with default
Changeset: a4dde796759d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a4dde796759d Modified Files: gdk/gdk_bbp.h geom/monetdb5/geom.c monetdb5/extras/rapi/rapi.c monetdb5/extras/rdf/rdfalgebra.c monetdb5/mal/mal_runtime.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/json.c monetdb5/modules/atoms/mtime.c monetdb5/modules/kernel/aggr.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/batcolor.c monetdb5/modules/kernel/batmmath.c monetdb5/modules/kernel/batstr.c monetdb5/modules/kernel/counters.c monetdb5/modules/kernel/group.c monetdb5/modules/kernel/status.c monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/batcalc.c monetdb5/modules/mal/bbp.c monetdb5/modules/mal/calc.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/cluster.c monetdb5/modules/mal/groupby.c monetdb5/modules/mal/inspect.c monetdb5/modules/mal/joinpath.c monetdb5/modules/mal/json_util.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/mat.c monetdb5/modules/mal/mdb.c monetdb5/modules/mal/mkey.c monetdb5/modules/mal/pcre.c monetdb5/modules/mal/querylog.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/sysmon.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/txtsim.c monetdb5/modules/mal/zorder.c monetdb5/optimizer/opt_mapreduce.c monetdb5/optimizer/opt_pipes.c monetdb5/scheduler/run_octopus.c monetdb5/scheduler/srvpool.c sql/backends/monet5/LSST/lsst.c sql/backends/monet5/UDF/udf.c sql/backends/monet5/bam/bam_db_interface.c sql/backends/monet5/bam/bam_export.c sql/backends/monet5/bam/bam_lib.c sql/backends/monet5/datacell/basket.c sql/backends/monet5/datacell/dcoperator.c sql/backends/monet5/datacell/emitter.c sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/datacell/receptor.c sql/backends/monet5/generator/generator.c sql/backends/monet5/gsl/gsl.c sql/backends/monet5/sql.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_down_from_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_cast_impl_up_to_int.h sql/backends/monet5/sql_fround_impl.h sql/backends/monet5/sql_optimizer.c sql/backends/monet5/sql_round_impl.h sql/backends/monet5/vaults/mseed.c Branch: resultset Log Message: Merge with default diffs (truncated from 6504 to 300 lines): diff --git a/gdk/gdk_bbp.h b/gdk/gdk_bbp.h --- a/gdk/gdk_bbp.h +++ b/gdk/gdk_bbp.h @@ -89,18 +89,6 @@ gdk_export int BBPincref(bat b, int logi gdk_export void BBPkeepref(bat i); gdk_export void BBPreleaseref(bat i); gdk_export int BBPdecref(bat b, int logical); -#if 0 -#define BBPdecref(b, logical) \ - ({ \ - bat _b = (b); \ - int _l = (logical); \ - if (BBP_refs(_b) + BBP_lrefs(_b) == 1) \ - fprintf(stderr, #final decref %d \ -%s[%s:%d]\n, \ - _b, __func__, __FILE__, __LINE__); \ - BBPdecref(_b, _l); \ - }) -#endif gdk_export void BBPshare(bat b); /* (strncmp(s, tmp_, 4) == 0 || strncmp(s, tmpr_, 5) == 0) */ diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -782,21 +782,21 @@ wkbcreatepoint_bat(bat *out, const bat * throw(MAL, geom.point, RUNTIME_OBJECT_MISSING); } if ((by = BATdescriptor(*iy)) == NULL) { - BBPreleaseref(bx-batCacheid); + BBPunfix(bx-batCacheid); throw(MAL, geom.point, RUNTIME_OBJECT_MISSING); } if ( bx-htype != TYPE_void || by-htype != TYPE_void || bx-hseqbase != by-hseqbase || BATcount(bx) != BATcount(by)) { - BBPreleaseref(bx-batCacheid); - BBPreleaseref(by-batCacheid); + BBPunfix(bx-batCacheid); + BBPunfix(by-batCacheid); throw(MAL, geom.point, both arguments must have dense and aligned heads); } if ((bo = BATnew(TYPE_void, ATOMindex(wkb), BATcount(bx), TRANSIENT)) == NULL) { - BBPreleaseref(bx-batCacheid); -
MonetDB: Oct2014 - Cleanup in use of BBP{inc,dec}ref, BBPrelease...
Changeset: a7bf0999b9e3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7bf0999b9e3 Modified Files: gdk/gdk_bbp.h geom/monetdb5/geom.c monetdb5/extras/rapi/rapi.c monetdb5/extras/rdf/rdfalgebra.c monetdb5/mal/mal_runtime.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/json.c monetdb5/modules/atoms/mtime.c monetdb5/modules/kernel/aggr.c monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/bat5.c monetdb5/modules/kernel/batcolor.c monetdb5/modules/kernel/batmmath.c monetdb5/modules/kernel/batstr.c monetdb5/modules/kernel/counters.c monetdb5/modules/kernel/group.c monetdb5/modules/kernel/status.c monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/batcalc.c monetdb5/modules/mal/bbp.c monetdb5/modules/mal/calc.c monetdb5/modules/mal/clients.c monetdb5/modules/mal/cluster.c monetdb5/modules/mal/groupby.c monetdb5/modules/mal/inspect.c monetdb5/modules/mal/joinpath.c monetdb5/modules/mal/json_util.c monetdb5/modules/mal/manifold.c monetdb5/modules/mal/mat.c monetdb5/modules/mal/mdb.c monetdb5/modules/mal/mkey.c monetdb5/modules/mal/pcre.c monetdb5/modules/mal/querylog.c monetdb5/modules/mal/remote.c monetdb5/modules/mal/sysmon.c monetdb5/modules/mal/tablet.c monetdb5/modules/mal/txtsim.c monetdb5/modules/mal/zorder.c monetdb5/optimizer/opt_mapreduce.c monetdb5/optimizer/opt_pipes.c monetdb5/scheduler/run_octopus.c monetdb5/scheduler/srvpool.c sql/backends/monet5/LSST/lsst.c sql/backends/monet5/UDF/udf.c sql/backends/monet5/bam/bam_db_interface.c sql/backends/monet5/bam/bam_export.c sql/backends/monet5/bam/bam_lib.c sql/backends/monet5/datacell/basket.c sql/backends/monet5/datacell/dcoperator.c sql/backends/monet5/datacell/emitter.c sql/backends/monet5/datacell/petrinet.c sql/backends/monet5/datacell/receptor.c sql/backends/monet5/generator/generator.c sql/backends/monet5/gsl/gsl.c sql/backends/monet5/sql.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_down_from_int.h sql/backends/monet5/sql_cast_impl_up_to_flt.h sql/backends/monet5/sql_cast_impl_up_to_int.h sql/backends/monet5/sql_fround_impl.h sql/backends/monet5/sql_optimizer.c sql/backends/monet5/sql_round_impl.h sql/backends/monet5/vaults/mseed.c Branch: Oct2014 Log Message: Cleanup in use of BBP{inc,dec}ref, BBPreleaseref, BBP{,un}fix. Only use BBPincref/BBPdecref for logical references (second arg is TRUE). Do not use BBPreleaseref at all. Instead of BBPincref/BBPdecref for physical references, and instead of BBPreleaseref we exclusively use BBPfix and BBPunfix. diffs (truncated from 6445 to 300 lines): diff --git a/gdk/gdk_bbp.h b/gdk/gdk_bbp.h --- a/gdk/gdk_bbp.h +++ b/gdk/gdk_bbp.h @@ -89,18 +89,6 @@ gdk_export int BBPincref(bat b, int logi gdk_export void BBPkeepref(bat i); gdk_export void BBPreleaseref(bat i); gdk_export int BBPdecref(bat b, int logical); -#if 0 -#define BBPdecref(b, logical) \ - ({ \ - bat _b = (b); \ - int _l = (logical); \ - if (BBP_refs(_b) + BBP_lrefs(_b) == 1) \ - fprintf(stderr, #final decref %d \ -%s[%s:%d]\n, \ - _b, __func__, __FILE__, __LINE__); \ - BBPdecref(_b, _l); \ - }) -#endif gdk_export void BBPshare(bat b); /* (strncmp(s, tmp_, 4) == 0 || strncmp(s, tmpr_, 5) == 0) */ diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -782,21 +782,21 @@ wkbcreatepoint_bat(bat *out, const bat * throw(MAL, geom.point, RUNTIME_OBJECT_MISSING); } if ((by = BATdescriptor(*iy)) == NULL) { - BBPreleaseref(bx-batCacheid); + BBPunfix(bx-batCacheid); throw(MAL, geom.point, RUNTIME_OBJECT_MISSING); } if ( bx-htype != TYPE_void || by-htype != TYPE_void || bx-hseqbase != by-hseqbase || BATcount(bx) != BATcount(by)) { - BBPreleaseref(bx-batCacheid); - BBPreleaseref(by-batCacheid); + BBPunfix(bx-batCacheid); +
MonetDB: geo - ST_*FromText : mTests + bulk
Changeset: 05f16de5c263 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=05f16de5c263 Added Files: geom/sql/Tests/functions/Tests/ST_GeomFromText.sql geom/sql/Tests/functions/Tests/ST_GeomFromText.stable.err geom/sql/Tests/functions/Tests/ST_GeomFromText.stable.out geom/sql/Tests/functions/Tests/ST_LineFromText.sql geom/sql/Tests/functions/Tests/ST_LineFromText.stable.err geom/sql/Tests/functions/Tests/ST_LineFromText.stable.out geom/sql/Tests/functions/Tests/ST_MLineFromText.sql geom/sql/Tests/functions/Tests/ST_MLineFromText.stable.err geom/sql/Tests/functions/Tests/ST_MLineFromText.stable.out geom/sql/Tests/functions/Tests/ST_MPointFromText.sql geom/sql/Tests/functions/Tests/ST_MPointFromText.stable.err geom/sql/Tests/functions/Tests/ST_MPointFromText.stable.out geom/sql/Tests/functions/Tests/ST_MPolygonFromText.sql geom/sql/Tests/functions/Tests/ST_MPolygonFromText.stable.err geom/sql/Tests/functions/Tests/ST_MPolygonFromText.stable.out geom/sql/Tests/functions/Tests/ST_PointFromText.sql geom/sql/Tests/functions/Tests/ST_PointFromText.stable.err geom/sql/Tests/functions/Tests/ST_PointFromText.stable.out geom/sql/Tests/functions/Tests/ST_PolygonFromText.sql geom/sql/Tests/functions/Tests/ST_PolygonFromText.stable.err geom/sql/Tests/functions/Tests/ST_PolygonFromText.stable.out geom/sql/Tests/functions/Tests/dropTestWKT.sql geom/sql/Tests/functions/Tests/dropTestWKT.stable.err geom/sql/Tests/functions/Tests/dropTestWKT.stable.out geom/sql/Tests/functions/Tests/loadTestWKT.sql geom/sql/Tests/functions/Tests/loadTestWKT.stable.err geom/sql/Tests/functions/Tests/loadTestWKT.stable.out Removed Files: geom/sql/Tests/functions/Tests/geomFromText.sql geom/sql/Tests/functions/Tests/geomFromText.stable.err geom/sql/Tests/functions/Tests/geomFromText.stable.out geom/sql/Tests/functions/Tests/lineFromText.sql geom/sql/Tests/functions/Tests/lineFromText.stable.err geom/sql/Tests/functions/Tests/lineFromText.stable.out geom/sql/Tests/functions/Tests/mlineFromText.sql geom/sql/Tests/functions/Tests/mlineFromText.stable.err geom/sql/Tests/functions/Tests/mlineFromText.stable.out geom/sql/Tests/functions/Tests/mpointFromText.sql geom/sql/Tests/functions/Tests/mpointFromText.stable.err geom/sql/Tests/functions/Tests/mpointFromText.stable.out geom/sql/Tests/functions/Tests/mpolygonFromText.sql geom/sql/Tests/functions/Tests/mpolygonFromText.stable.err geom/sql/Tests/functions/Tests/mpolygonFromText.stable.out geom/sql/Tests/functions/Tests/pointFromText.sql geom/sql/Tests/functions/Tests/pointFromText.stable.err geom/sql/Tests/functions/Tests/pointFromText.stable.out geom/sql/Tests/functions/Tests/polygonFromText.sql geom/sql/Tests/functions/Tests/polygonFromText.stable.err geom/sql/Tests/functions/Tests/polygonFromText.stable.out Modified Files: geom/monetdb5/geom.c geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: ST_*FromText : mTests + bulk diffs (truncated from 4560 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 @@ -2154,7 +2154,7 @@ str wkbFromText(wkb **geomWKB, str *geom *geomWKB = NULL; if (wkbFROMSTR(*geomWKT, len, geomWKB, *srid) - (wkb_isnil(*geomWKB) || *tpe==0 || *tpe == wkbGeometryCollection || (te = ((*((*geomWKB)-data + 1) 0x0f)+(*tpe2))) == *tpe)) { + (wkb_isnil(*geomWKB) || *tpe==0 || *tpe == wkbGeometryCollection || ((te = ((*((*geomWKB)-data + 1) 0x0f)))+(*tpe2)) == *tpe)) { return MAL_SUCCEED; } @@ -2162,11 +2162,9 @@ str wkbFromText(wkb **geomWKB, str *geom *geomWKB = wkb_nil; } - //get back the correct value for geos - te-= (te4); - + te += (te2); if (*tpe 0 te != *tpe) - throw(MAL, wkb.FromText, Geometry not type '%d: %s' but '%d: %s' instead, *tpe, geom_type2str(*tpe,0), te, geom_type2str(te,0)); + throw(SQL, wkb.FromText, Geometry not type '%d: %s' but '%d: %s' instead, *tpe, geom_type2str(*tpe,0), te, geom_type2str(te,0)); errbuf = GDKerrbuf; if (errbuf) { if (strncmp(errbuf, !ERROR: , 8) == 0) diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -117,6 +117,8 @@ geom_export mbr* mbrFromGeos(const GEOSG geom_export str wkbFromText(wkb **geomWKB, str *geomWKT, int* srid, int *tpe); +geom_export str
MonetDB: resultset - Reverse advisory one last block
Changeset: 25309a175cb1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25309a175cb1 Modified Files: monetdb5/modules/mal/tablet.c Branch: resultset Log Message: Reverse advisory one last block diffs (69 lines): diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c --- a/monetdb5/modules/mal/tablet.c +++ b/monetdb5/modules/mal/tablet.c @@ -667,7 +667,6 @@ typedef struct { Client cntxt; int id; /* for self reference */ int state; /* line break=1 , 2 = update bat */ - int msyncadvice;/* perform the parallel msync */ int workers;/* how many concurrent ones */ int error; /* error during line break */ int next; @@ -1040,12 +1039,8 @@ SQLworker(void *arg) /* stage two, updating the BATs */ for (i = 0; i task-as-nr_attrs; i++) if (task-cols[i]) { - BAT *b; t0 = GDKusec(); SQLworker_column(task, task-cols[i] - 1); - b = task-as-format[task-cols[i]-1].c; - if ( task-msyncadvice b b-batPersistence != PERSISTENT) - BATmsync(b); t0 = GDKusec() - t0; task-time[i] += t0; task-wtime += t0; @@ -1645,7 +1640,6 @@ SQLload_file(Client cntxt, Tablet *as, b /* stage one, break the lines in parallel */ ptask[j].error = 0; ptask[j].state = BREAKLINE; - ptask[j].msyncadvice = cnt == task-maxrow; //about to read last block ptask[j].next = task-top[task-cur]; ptask[j].fields = task-fields; ptask[j].limit = task-limit; @@ -1767,17 +1761,6 @@ SQLload_file(Client cntxt, Tablet *as, b task-ateof = 1; task-state = ENDOFCOPY; - if( !task-ateof || cnt task-maxrow){ -#ifdef _DEBUG_TABLET_ - mnstr_printf(GDKout,#Shut down reader\n); -#endif - MT_sema_up(task-producer, SQLload_file); - MT_join_thread(task-tid); - } - - MT_sema_destroy(ptask[j].producer); - MT_sema_destroy(ptask[j].consumer); - #ifdef _DEBUG_TABLET_ for(i=0; i as-nr_attrs; i++){ mnstr_printf(GDKout,column BUNFMT\n,i); @@ -1793,6 +1776,18 @@ SQLload_file(Client cntxt, Tablet *as, b ptask[j].state = SYNCBAT; MT_sema_up(ptask[j].sema, SQLload_file); } + + if( !task-ateof || cnt task-maxrow){ +#ifdef _DEBUG_TABLET_ + mnstr_printf(GDKout,#Shut down reader\n); +#endif + MT_sema_up(task-producer, SQLload_file); + MT_join_thread(task-tid); + } + + MT_sema_destroy(ptask[j].producer); + MT_sema_destroy(ptask[j].consumer); + // await completion of the BAT syncs for (j = 0; j threads; j++) MT_sema_down(ptask[j].reply, SQLload_file); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Fix printf format string.
Changeset: a74432d405de for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a74432d405de Modified Files: gdk/gdk_bbp.c Branch: Oct2014 Log Message: Fix printf format string. diffs (12 lines): diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -2837,7 +2837,7 @@ BBPtrim_select(size_t target, int dirty) PTRFMTCAST(void *)b); fprintf(stderr, - #(cnt= BUNFMT , mode=%d, + #(cnt= BUNFMT , mode=%u, refs=%d, wait=%d, parent=%d,%d, lastused=%d,%d,%d)\n, bbptrim[cur].cnt, ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: resultset - Add more defensive code.
Changeset: 8cfadf92ad6d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8cfadf92ad6d Modified Files: sql/backends/monet5/sql.c Branch: resultset Log Message: Add more defensive code. diffs (160 lines): diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c --- a/sql/backends/monet5/sql.c +++ b/sql/backends/monet5/sql.c @@ -492,6 +492,8 @@ table_has_updates(sql_trans *tr, sql_tab for ( n = t-columns.set-h; !cnt n; n = n-next) { sql_column *c = n-data; BAT *b = store_funcs.bind_col(tr, c, RD_UPD_ID); + if ( b == 0) + return -1; cnt |= BATcount(b) 0; BBPunfix(b-batCacheid); } @@ -1651,6 +1653,9 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb /* BAT b holds the UPD_ID bat */ oid l, h; BAT *c = mvc_bind(m, *sname, *tname, *cname, 0); + if (c == NULL) + throw(SQL,sql.bind,Cannot access the update column); + cnt = BATcount(c); psz = cnt ? (cnt / nr_parts) : 0; l = part_nr * psz; @@ -1665,6 +1670,8 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb BAT *uv = mvc_bind(m, *sname, *tname, *cname, RD_UPD_VAL); bat *uvl = getArgReference_bat(stk, pci, 1); + if (uv == NULL) + throw(SQL,sql.bind,Cannot access the update column); BBPkeepref(*bid = b-batCacheid); BBPkeepref(*uvl = uv-batCacheid); return MAL_SUCCEED; @@ -1675,8 +1682,14 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb if (BATcount(b)) { BAT *uv = mvc_bind(m, *sname, *tname, *cname, RD_UPD_VAL); BAT *ui = mvc_bind(m, *sname, *tname, *cname, RD_UPD_ID); - BAT *id = BATproject(b, ui); - BAT *vl = BATproject(b, uv); + BAT *id; + BAT *vl; + if (ui == NULL) + throw(SQL,sql.bind,Cannot access the insert column); + if (uv == NULL) + throw(SQL,sql.bind,Cannot access the update column); + id = BATproject(b, ui); + vl = BATproject(b, uv); bat_destroy(ui); bat_destroy(uv); BBPkeepref(*bid = id-batCacheid); @@ -1734,6 +1747,8 @@ mvc_bind_idxbat_wrap(Client cntxt, MalBl /* BAT b holds the UPD_ID bat */ oid l, h; BAT *c = mvc_bind_idxbat(m, *sname, *tname, *iname, 0); + if ( c == NULL) + throw(SQL,sql.bindidx,can not access index column); cnt = BATcount(c); psz = cnt ? (cnt / nr_parts) : 0; l = part_nr * psz; @@ -1747,6 +1762,8 @@ mvc_bind_idxbat_wrap(Client cntxt, MalBl } else if (upd) { BAT *uv = mvc_bind_idxbat(m, *sname, *tname, *iname, RD_UPD_VAL); bat *uvl = getArgReference_bat(stk, pci, 1); + if ( uv == NULL) + throw(SQL,sql.bindidx,can not access index column); BBPkeepref(*bid = b-batCacheid); BBPkeepref(*uvl = uv-batCacheid); return MAL_SUCCEED; @@ -1757,8 +1774,13 @@ mvc_bind_idxbat_wrap(Client cntxt, MalBl if (BATcount(b)) { BAT *uv = mvc_bind_idxbat(m, *sname, *tname, *iname, RD_UPD_VAL); BAT *ui = mvc_bind_idxbat(m, *sname, *tname, *iname, RD_UPD_ID); - BAT *id = BATproject(b, ui); - BAT *vl = BATproject(b, uv); + BAT *id, *vl; + if ( ui == NULL) + throw(SQL,sql.bindidx,can not access index column); + if ( uv == NULL) + throw(SQL,sql.bindidx,can not access index column); + id = BATproject(b, ui); + vl = BATproject(b, uv); bat_destroy(ui); bat_destroy(uv); BBPkeepref(*bid =
MonetDB: resultset - Be defensive during COPY into
Changeset: da7b619ad6f4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=da7b619ad6f4 Modified Files: sql/backends/monet5/sql_result.c Branch: resultset Log Message: Be defensive during COPY into diffs (72 lines): diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -773,11 +773,14 @@ mvc_import_table(Client cntxt, mvc *m, b if (locked) { BAT *b = store_funcs.bind_col(m-session-tr, col, RDONLY); + if (b == NULL) + sql_error(m, 500, failed to bind to table column); if (sz (lng) BATTINY) b = BATextend(b, (BUN) sz); - assert(b != NULL); + if (b == NULL) + sql_error(m, 500, failed to extend space for column); HASHdestroy(b); @@ -787,7 +790,7 @@ mvc_import_table(Client cntxt, mvc *m, b if ((fmt[i].c = BATextend(fmt[i].c, (BUN) sz)) == NULL) { for (i--; i = 0; i--) BBPunfix(fmt[i].c-batCacheid); - sql_error(m, 500, failed to allocate result table sizes ); + sql_error(m, 500, failed to allocate space for column); return NULL; } } @@ -795,7 +798,8 @@ mvc_import_table(Client cntxt, mvc *m, b } } if ( (locked || (msg = TABLETcreate_bats(as, (BUN) (sz 0 ? 1000 : sz))) == MAL_SUCCEED) ){ - if (SQLload_file(cntxt, as, bs, out, sep, rsep, ssep ? ssep[0] : 0, offset, sz, best) != BUN_NONE (best || !as.error)) { + if (SQLload_file(cntxt, as, bs, out, sep, rsep, ssep ? ssep[0] : 0, offset, sz, best) != BUN_NONE + (best || !as.error)) { bats = (BAT**) GDKzalloc(sizeof(BAT *) * as.nr_attrs); if ( bats == NULL){ TABLETdestroy_format(as); @@ -809,12 +813,15 @@ mvc_import_table(Client cntxt, mvc *m, b for (n = t-columns.set-h, i = 0; n; n = n-next, i++) { sql_column *col = n-data; BAT *b = store_funcs.bind_col(m-session-tr, col, RDONLY); - BATsetcount(b, cnt); - BBPunfix(b-batCacheid); + if (b == NULL) + sql_error(m, 500, failed to bind to temporary column); + else { + BATsetcount(b, cnt); + BBPunfix(b-batCacheid); + } } } } - (void) msg; if (locked) { /* fix delta structures and transaction */ for (n = t-columns.set-h, i = 0; n; n = n-next, i++) { sql_column *c = n-data; @@ -822,8 +829,12 @@ mvc_import_table(Client cntxt, mvc *m, b sql_delta *d = c-data; c-base.wtime = t-base.wtime = t-s-base.wtime = m-session-tr-wtime = m-session-tr-wstime; - d-ibase = (oid) (d-cnt = BATcount(b)); - BBPunfix(b-batCacheid); + if ( b == NULL) + sql_error(m, 500, failed to bind to delta column); + else { + d-ibase = (oid) (d-cnt = BATcount(b)); + BBPunfix(b-batCacheid); + } } } if (as.error) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: resultset - Merge with default
Changeset: ce8f0d0c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce8f0d0c Added Files: sql/test/BugTracker-2013/Tests/copy-into-compressed-bz2.Bug-3351.sql.in sql/test/BugTracker-2013/Tests/copy-into-compressed-bz2.Bug-3351.stable.err sql/test/BugTracker-2013/Tests/copy-into-compressed-bz2.Bug-3351.stable.out sql/test/BugTracker-2013/Tests/copy-into-compressed-gz.Bug-3351.sql.in sql/test/BugTracker-2013/Tests/copy-into-compressed-gz.Bug-3351.stable.err sql/test/BugTracker-2013/Tests/copy-into-compressed-gz.Bug-3351.stable.out sql/test/mergetables/Tests/mergekey.stable.err sql/test/mergetables/Tests/mergekey.stable.out Removed Files: monetdb5/mal/Tests/venks.mal monetdb5/mal/Tests/venks.stable.err monetdb5/mal/Tests/venks.stable.out monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/union_semantics.SF-1192348.mal monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/union_semantics.SF-1192348.stable.err monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/union_semantics.SF-1192348.stable.out monetdb5/tests/BugTracker/Tests/kunion-and-nil.Bug-1667.mal monetdb5/tests/BugTracker/Tests/kunion-and-nil.Bug-1667.stable.err monetdb5/tests/BugTracker/Tests/kunion-and-nil.Bug-1667.stable.out monetdb5/tests/gdkTests/Tests/intersect_diff_nil.mal monetdb5/tests/gdkTests/Tests/intersect_diff_nil.stable.err monetdb5/tests/gdkTests/Tests/intersect_diff_nil.stable.out monetdb5/tests/gdkTests/Tests/intersect_diff_void.mal monetdb5/tests/gdkTests/Tests/intersect_diff_void.stable.err monetdb5/tests/gdkTests/Tests/intersect_diff_void.stable.out monetdb5/tests/suite_00/Tests/test_15.mal monetdb5/tests/suite_00/Tests/test_15.stable.err monetdb5/tests/suite_00/Tests/test_15.stable.out sql/scripts/mtime.sql sql/scripts/replication.sql Modified Files: clients/Tests/MAL-signatures_all.stable.out clients/Tests/MAL-signatures_all.stable.out.int128 clients/Tests/MAL-signatures_fits_geom.stable.out clients/Tests/MAL-signatures_fits_geom.stable.out.int128 clients/Tests/MAL-signatures_geom.stable.out clients/Tests/MAL-signatures_geom.stable.out.int128 clients/Tests/MAL-signatures_none.stable.out clients/Tests/MAL-signatures_none.stable.out.int128 clients/Tests/SQL-dump_all.stable.out clients/Tests/SQL-dump_all.stable.out.oid32 clients/Tests/SQL-dump_geom.stable.out clients/Tests/SQL-dump_geom.stable.out.32bit clients/Tests/SQL-dump_geom.stable.out.64bit.oid32 clients/Tests/SQL-dump_none.stable.out clients/Tests/exports.stable.out clients/mapiclient/mclient.1 monetdb5/mal/Tests/All monetdb5/mal/mal_recycle.c monetdb5/modules/kernel/aggr.mal monetdb5/modules/kernel/algebra.c monetdb5/modules/kernel/algebra.h monetdb5/modules/kernel/algebra.mal monetdb5/modules/mal/00_batcalc_hge.mal monetdb5/modules/mal/00_batcalc_hge.mal.sh monetdb5/optimizer/Tests/All monetdb5/optimizer/Tests/ESexample.mal monetdb5/optimizer/Tests/ESexample.stable.out monetdb5/optimizer/opt_costModel.c monetdb5/optimizer/opt_dataflow.c monetdb5/optimizer/opt_emptySet.c monetdb5/tests/BugDay_2005-10-06_4.9.3/Tests/All monetdb5/tests/BugTracker/Tests/All monetdb5/tests/gdkTests/Tests/All monetdb5/tests/suite_00/Tests/All sql/ChangeLog.Oct2014 sql/backends/monet5/Tests/limithack.stable.out sql/backends/monet5/generator/Tests/generator01.stable.err sql/backends/monet5/generator/Tests/generator04.stable.err sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_upgrades.c sql/jdbc/tests/Tests/Test_Dobjects.stable.out sql/jdbc/tests/Tests/Test_Dobjects_bam.stable.out sql/scripts/17_temporal.sql sql/scripts/75_storagemodel.sql sql/scripts/Makefile.ag sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out sql/test/BugTracker-2013/Tests/All sql/test/BugTracker-2013/Tests/copy-into-compressed.Bug-3351.sql.in sql/test/BugTracker-2013/Tests/copy-into-compressed.Bug-3351.stable.out sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql
MonetDB: default - Merge with Oct2014 branch.
Changeset: dc6eacaa0ff1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc6eacaa0ff1 Modified Files: buildtools/autogen/autogen/am.py clients/Tests/exports.stable.out common/stream/stream.c gdk/gdk.h gdk/gdk_atoms.c gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_delta.c gdk/gdk_delta.h gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_posix.c gdk/gdk_private.h gdk/gdk_storage.c gdk/gdk_system.c gdk/gdk_system.h gdk/gdk_utils.c sql/server/rel_dump.c Branch: default Log Message: Merge with Oct2014 branch. diffs (truncated from 2159 to 300 lines): diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -977,7 +977,7 @@ def am_gem(fd, var, gem, am): for src in srcs: fd.write(\t[ '$(srcdir)' -ef . ] || rm -f '%s'\n % src) for d in sorted(dirs, reverse = True): -fd.write(\t[ '$(srcdir)' -ef . ] || rmdir '%s'\n % d) +fd.write(\t[ '$(srcdir)' -ef . -o ! -d '%s' ] || rmdir '%s'\n % (d, d)) fd.write(install-exec-local-%s: %s\n % (sf, f[:-4])) fd.write(\tmkdir -p $(DESTDIR)'%s'\n % rd) fd.write(\tgem install --local --install-dir $(DESTDIR)'%s' --force --rdoc '%s'\n % (rd, f[:-4])) @@ -1026,7 +1026,7 @@ def am_python_generic(fd, var, python, a fd.write(\trm '$(DESTDIR)$(prefix)/$(%s_LIBDIR)'/%s-*.egg-info\n % (PYTHON, name.replace('-', '_'))) fd.write('mostlyclean-local:\n') for pkgdir in sorted(pkgdirs, reverse = True): -fd.write(\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n % pkgdir) +fd.write(\t[ '$(srcdir)' -ef . -o ! -d '%s' ] || rm -r '%s'\n % (pkgdir, pkgdir)) def am_python2(fd, var, python, am): am_python_generic(fd, var, python, am, 'PYTHON2') diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -320,7 +320,7 @@ void PROPdestroy(PROPrec *p); BUN SORTfnd(BAT *b, const void *v); BUN SORTfndfirst(BAT *b, const void *v); BUN SORTfndlast(BAT *b, const void *v); -void *THRdata[16]; +void *THRdata[THREADDATA]; void THRdel(Thread t); Thread THRget(int tid); void *THRgetdata(int); diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -207,7 +207,7 @@ mnstr_read(stream *s, void *buf, size_t if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -226,7 +226,7 @@ mnstr_readline(stream *s, void *buf, siz if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); + fprintf(stderr, readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -283,7 +283,7 @@ mnstr_write(stream *s, const void *buf, if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -307,7 +307,7 @@ mnstr_close(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(close %s\n, s-name ? s-name : unnamed); + fprintf(stderr, close %s\n, s-name ? s-name : unnamed); #endif (*s-close) (s); } @@ -318,7 +318,7 @@ mnstr_destroy(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(destroy %s\n, s-name ? s-name : unnamed); + fprintf(stderr, destroy %s\n, s-name ? s-name : unnamed); #endif (*s-destroy) (s); } @@ -339,7 +339,7 @@ mnstr_flush(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(flush %s\n, s-name ? s-name : unnamed); + fprintf(stderr, flush %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -356,7 +356,7 @@ mnstr_fsync(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); + fprintf(stderr, fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -372,7 +372,7 @@ mnstr_fgetpos(stream *s, lng *p) if (s == NULL || p == NULL) return -1; #ifdef STREAM_DEBUG -
MonetDB: Oct2014 - All debug output in GDK and the stream librar...
Changeset: b5960202ebed for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b5960202ebed Modified Files: common/stream/stream.c gdk/gdk.h gdk/gdk_atoms.c gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_delta.c gdk/gdk_delta.h gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_posix.c gdk/gdk_private.h gdk/gdk_storage.c gdk/gdk_system.c gdk/gdk_system.h gdk/gdk_utils.c sql/server/rel_dump.c Branch: Oct2014 Log Message: All debug output in GDK and the stream library goes to stderr. diffs (truncated from 2117 to 300 lines): diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -201,7 +201,7 @@ mnstr_read(stream *s, void *buf, size_t if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -220,7 +220,7 @@ mnstr_readline(stream *s, void *buf, siz if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); + fprintf(stderr, readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -277,7 +277,7 @@ mnstr_write(stream *s, const void *buf, if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -301,7 +301,7 @@ mnstr_close(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(close %s\n, s-name ? s-name : unnamed); + fprintf(stderr, close %s\n, s-name ? s-name : unnamed); #endif (*s-close) (s); } @@ -312,7 +312,7 @@ mnstr_destroy(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(destroy %s\n, s-name ? s-name : unnamed); + fprintf(stderr, destroy %s\n, s-name ? s-name : unnamed); #endif (*s-destroy) (s); } @@ -333,7 +333,7 @@ mnstr_flush(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(flush %s\n, s-name ? s-name : unnamed); + fprintf(stderr, flush %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -350,7 +350,7 @@ mnstr_fsync(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); + fprintf(stderr, fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -366,7 +366,7 @@ mnstr_fgetpos(stream *s, lng *p) if (s == NULL || p == NULL) return -1; #ifdef STREAM_DEBUG - printf(fgetpos %s\n, s-name ? s-name : unnamed); + fprintf(stderr, fgetpos %s\n, s-name ? s-name : unnamed); #endif if (s-errnr) return -1; @@ -381,7 +381,7 @@ mnstr_fsetpos(stream *s, lng p) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(fsetpos %s\n, s-name ? s-name : unnamed); + fprintf(stderr, fsetpos %s\n, s-name ? s-name : unnamed); #endif if (s-errnr) return -1; @@ -439,7 +439,7 @@ mnstr_set_byteorder(stream *s, char bige if (s == NULL) return; #ifdef STREAM_DEBUG - printf(mnstr_set_byteorder %s\n, s-name ? s-name : unnamed); + fprintf(stderr, mnstr_set_byteorder %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_READ); s-type = ST_BIN; @@ -466,7 +466,7 @@ mnstr_rstream(stream *s) if (s == NULL) return NULL; #ifdef STREAM_DEBUG - printf(mnstr_rstream %s\n, s-name ? s-name : unnamed); + fprintf(stderr, mnstr_rstream %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_READ); s-type = ST_BIN; @@ -481,7 +481,7 @@ mnstr_wstream(stream *s) if (s == NULL) return NULL; #ifdef STREAM_DEBUG - printf(mnstr_wstream %s\n, s-name ? s-name : unnamed); + fprintf(stderr, mnstr_wstream %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_WRITE); s-type = ST_BIN; @@ -560,7 +560,7 @@ create_stream(const char *name) s-timeout_func = NULL; s-update_timeout = NULL; #ifdef STREAM_DEBUG - printf(create_stream %s - PTRFMT \n, name ? name : unnamed, PTRFMTCAST s); + fprintf(stderr, create_stream %s - PTRFMT \n,
MonetDB: Oct2014 - Use constant consistently.
Changeset: 21556530122a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=21556530122a Modified Files: clients/Tests/exports.stable.out gdk/gdk.h Branch: Oct2014 Log Message: Use constant consistently. diffs (24 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -320,7 +320,7 @@ void PROPdestroy(PROPrec *p); BUN SORTfnd(BAT *b, const void *v); BUN SORTfndfirst(BAT *b, const void *v); BUN SORTfndlast(BAT *b, const void *v); -void *THRdata[16]; +void *THRdata[THREADDATA]; void THRdel(Thread t); Thread THRget(int tid); void *THRgetdata(int); diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2646,7 +2646,7 @@ gdk_export int THRhighwater(void); gdk_export int THRprintf(stream *s, _In_z_ _Printf_format_string_ const char *format, ...) __attribute__((__format__(__printf__, 2, 3))); -gdk_export void *THRdata[16]; +gdk_export void *THRdata[THREADDATA]; #define GDKstdout ((stream*)THRdata[0]) #define GDKstdin ((stream*)THRdata[1]) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - approved output
Changeset: 0a8a327a33b5 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a8a327a33b5 Modified Files: sql/test/Tests/systemfunctions_bam.stable.out.int128 Branch: default Log Message: approved output diffs (127 lines): diff --git a/sql/test/Tests/systemfunctions_bam.stable.out.int128 b/sql/test/Tests/systemfunctions_bam.stable.out.int128 --- a/sql/test/Tests/systemfunctions_bam.stable.out.int128 +++ b/sql/test/Tests/systemfunctions_bam.stable.out.int128 @@ -135,6 +135,8 @@ Ready. [ sys, Intersect,0, boolean, create function \Intersect\(a geometry, b geometry) returns boolean external name geom.\Intersect\; ] [ sys, Intersect,1, geometry, ] [ sys, Intersect,2, geometry, ] +[ sys, Intersect,0, geometry, create filter function \Intersect\(a geometry, b geometry) external name geom.\Intersect\; ] +[ sys, Intersect,1, geometry, ] [ sys, Union,0, geometry, create function \Union\(a geometry, b geometry) returns geometry external name geom.\Union\; ] [ sys, Union,1, geometry, ] [ sys, Union,2, geometry, ] @@ -196,6 +198,15 @@ Ready. [ sys, contains, 0, boolean, create function contains(a geometry, b geometry) returns boolean external name geom.\Contains\; ] [ sys, contains, 1, geometry, ] [ sys, contains, 2, geometry, ] +[ sys, contains, 0, boolean, create function contains(a geometry, x double, y double) returns boolean external name geom.\Contains\; ] +[ sys, contains, 1, geometry, ] +[ sys, contains, 2, double, ] +[ sys, contains, 3, double, ] +[ sys, contains, 0, geometry, create filter function contains(a geometry, b geometry) external name geom.\Contains\; ] +[ sys, contains, 1, geometry, ] +[ sys, contains, 0, geometry, create filter function contains(a geometry, x double, y double) external name geom.\Contains\; ] +[ sys, contains, 1, double, ] +[ sys, contains, 2, double, ] [ sys, convexhull, 0, geometry, create function convexhull(a geometry) returns geometry external name geom.\ConvexHull\;] [ sys, convexhull, 1, geometry, ] [ sys, corr, 0, tinyint, create aggregate corr(e1 tinyint, e2 tinyint) returns tinyint\n\texternal name \aggr\.\corr\; ] @@ -225,6 +236,8 @@ Ready. [ sys, crosses, 0, boolean, create function crosses(a geometry, b geometry) returns boolean external name geom.\Crosses\; ] [ sys, crosses, 1, geometry, ] [ sys, crosses, 2, geometry, ] +[ sys, crosses, 0, geometry, create filter function crosses(a geometry, b geometry) external name geom.\Crosses\;] +[ sys, crosses, 1, geometry, ] [ sys, date_to_str, 0, clob, create function date_to_str(d date, format string) returns string\n\texternal name mtime.\date_to_str\; ] [ sys, date_to_str, 1, date, ] [ sys, date_to_str, 2, clob, ] @@ -290,6 +303,8 @@ Ready. [ sys, disjoint, 0, boolean, create function disjoint(a geometry, b geometry) returns boolean external name geom.\Disjoint\; ] [ sys, disjoint, 1, geometry, ] [ sys, disjoint, 2, geometry, ] +[ sys, disjoint, 0, geometry, create filter function disjoint(a geometry, b geometry) external name geom.\Disjoint\; ] +[ sys, disjoint, 1, geometry, ] [ sys, distance, 0, double, create function distance(a geometry, b geometry) returns float external name geom.\Distance\; ] [ sys, distance, 1, geometry, ] [ sys, distance, 2, geometry, ] @@ -299,9 +314,17 @@ Ready. [ sys, envelope, 1, geometry, ] [ sys, environment, 0, clob, -- The environment table\ncreate function sys.environment()\n\treturns table (\name\ string, value string)\n\texternal name sql.sql_environment;] [ sys, environment, 1, clob, ] +[ sys, epoch,0, timestamp,-- The contents of this file are subject to the MonetDB Public License\n-- Version 1.1 (the \License\); you may not use this file except in\n-- compliance with the License. You may obtain a copy of the License at\n-- http://www.monetdb.org/Legal/MonetDBLicense\n--\n-- Software distributed under the License is distributed on an \AS IS\\n-- basis, WITHOUT
MonetDB: geo - mtests: more geometries loaded at the beginning, ...
Changeset: 7feec13c0c28 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7feec13c0c28 Modified Files: geom/sql/Tests/functions/Tests/ST_Boundary.sql geom/sql/Tests/functions/Tests/ST_Boundary.stable.out geom/sql/Tests/functions/Tests/ST_Contains.stable.out geom/sql/Tests/functions/Tests/loadTestGeometries.sql geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out Branch: geo Log Message: mtests: more geometries loaded at the beginning, ST_Boundary + ST_Contains new results approved diffs (93 lines): diff --git a/geom/sql/Tests/functions/Tests/ST_Boundary.sql b/geom/sql/Tests/functions/Tests/ST_Boundary.sql --- a/geom/sql/Tests/functions/Tests/ST_Boundary.sql +++ b/geom/sql/Tests/functions/Tests/ST_Boundary.sql @@ -6,6 +6,6 @@ SELECT ST_Boundary(ST_GeomFromText('POLY SELECT ST_Boundary(ST_GeomFromText('MULTILINESTRING((1 1 1,0 0 0.5, -1 1 1),(1 1 0.5,0 0 0.5, -1 1 0.5, 1 1 0.5) )')); -SELECT geom AS GEOMETRY, ST_Boundary(geom) AS BOUNDARY FROM geometries WHERE id7; +SELECT geom AS GEOMETRY, ST_Boundary(geom) AS BOUNDARY FROM geometries WHERE id9; diff --git a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out @@ -58,7 +58,7 @@ Ready. [ POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)), LINESTRING (10 10, 10 20, 20 20, 20 10, 10 10)] [ MULTIPOINT (10 20, 30 40), GEOMETRYCOLLECTION EMPTY ] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), MULTIPOINT (30 40, 40 50, 50 60, 60 70) ] -[ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), MULTILINESTRING ((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))] +[ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), MULTIPOINT (50 60, 60 70) ] # 16:00:23 # 16:00:23 Done. diff --git a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out @@ -62,8 +62,11 @@ Ready. [ POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)), true] [ MULTIPOINT (10 20, 30 40), false ] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), false ] +[ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), false ] +[ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60)), false ] [ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), true] [ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), true] +[ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40, 10 20), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), true] # 17:07:03 # 17:07:03 Done. diff --git a/geom/sql/Tests/functions/Tests/loadTestGeometries.sql b/geom/sql/Tests/functions/Tests/loadTestGeometries.sql --- a/geom/sql/Tests/functions/Tests/loadTestGeometries.sql +++ b/geom/sql/Tests/functions/Tests/loadTestGeometries.sql @@ -1,17 +1,23 @@ CREATE TABLE geometries(id serial, geom geometry); --simple geometries ---1 +--1 closed INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('POINT(10 20)')); ---2 +--2 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('LINESTRING(10 20, 30 40, 50 60)')); ---3 +--3 closed INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))')); ---4 +--4 closed INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOINT(10 20, 30 40)')); --5 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTILINESTRING((30 40, 40 50), (50 60, 60 70))')); --6 +INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTILINESTRING((30 40, 40 50, 30 40), (50 60, 60 70))')); +--7 closed +INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTILINESTRING((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60))')); +--8 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOLYGON(((10 10, 10 20, 20 20, 20 10, 10 10),(30 30, 30 40, 40 40, 40 30, 30 30)))')); ---7 +--9 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); +--10 closed +INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40, 10 20),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); diff --git a/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out b/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out --- a/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out +++ b/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out @@ -65,11 +65,17 @@ Ready. [ 1] #INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOINT(10 20, 30 40)'));
MonetDB: geo - changed format in sprint to the correct one for u...
Changeset: 2d9844960a5d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d9844960a5d Modified Files: geom/monetdb5/geom.c Branch: geo Log Message: changed format in sprint to the correct one for unsinged int diffs (84 lines): diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -640,7 +640,7 @@ static str forceDimGeometry(GEOSGeometry case wkbMultiPoint: case wkbMultiLineString: case wkbMultiPolygon: - case wkbGeometryCollection: + case wkbGeometryCollection: if((err = forceDimMultiGeometry(outGeometry, geosGeometry, dim)) != MAL_SUCCEED){ str msg = createException(MAL, geom.ForceDim, %s,err); GDKfree(err); @@ -973,7 +973,7 @@ static str segmentizeGeometry(GEOSGeomet case wkbMultiPoint: case wkbMultiLineString: case wkbMultiPolygon: - case wkbGeometryCollection: + case wkbGeometryCollection: if((err = segmentizeMultiGeometry(outGeometry, geosGeometry, sz)) != MAL_SUCCEED){ str msg = createException(MAL, geom.Segmentize, %s,err); GDKfree(err); @@ -1261,7 +1261,7 @@ static str translateGeometry(GEOSGeometr case wkbMultiPoint: case wkbMultiLineString: case wkbMultiPolygon: - case wkbGeometryCollection: + case wkbGeometryCollection: if((err = translateMultiGeometry(outGeometry, geosGeometry, dx, dy, dz)) != MAL_SUCCEED){ str msg = createException(MAL, geom.Translate, %s,err); GDKfree(err); @@ -1379,7 +1379,7 @@ static str dumpGeometriesSingle(BAT* idB newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+1)*sizeof(char)); strcpy(newPath, path); - sprintf(newPath+pathLength, %d, *lvl); + sprintf(newPath+pathLength, %u, *lvl); } else { //remove the comma at the end of the path pathLength--; @@ -1415,7 +1415,7 @@ static str dumpGeometriesMulti(BAT* idBA newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+extraLength+1)*sizeof(char)); strcpy(newPath, path); - lvlDigitsNum = sprintf(newPath+pathLength, %d, lvl); + lvlDigitsNum = sprintf(newPath+pathLength, %u, lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); //*secondLevel = 0; @@ -1547,7 +1547,7 @@ static str dumpPointsPoint(BAT* idBAT, B newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+1)*sizeof(char)); strcpy(newPath, path); - sprintf(newPath+pathLength, %d, *lvl); + sprintf(newPath+pathLength, %u, *lvl); BUNappend(idBAT,newPath,TRUE); BUNappend(geomBAT,pointWKB,TRUE); @@ -1617,7 +1617,7 @@ static str dumpPointsPolygon(BAT* idBAT, newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+extraLength+1)*sizeof(char)); strcpy(newPath, path); - lvlDigitsNum = sprintf(newPath+pathLength, %d, *lvl); + lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); GDKfree(lvlStr); @@ -1646,7 +1646,7 @@ static str dumpPointsPolygon(BAT* idBAT, newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+extraLength+1)*sizeof(char)); strcpy(newPath, path); - lvlDigitsNum = sprintf(newPath+pathLength, %d, *lvl); + lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); GDKfree(lvlStr); @@ -1684,7 +1684,7 @@ static str dumpPointsMultiGeometry(BAT* newPath = (char*)GDKmalloc((pathLength+lvlDigitsNum+extraLength+1)*sizeof(char)); strcpy(newPath, path); - lvlDigitsNum = sprintf(newPath+pathLength, %d, lvl); + lvlDigitsNum = sprintf(newPath+pathLength, %u, lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); GDKfree(lvlStr); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: geo - new implementation for IsClosed which itertively ...
Changeset: 903c4f141ef5 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=903c4f141ef5 Modified Files: geom/monetdb5/geom.c Branch: geo Log Message: new implementation for IsClosed which itertively checks geometries in multilinestring and geometry collection diffs (106 lines): diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -3397,39 +3397,77 @@ static int wkbBasicBoolean(wkb **geom, c /* the function checks whether the geometry is closed. GEOS works only with * linestring geometries but PostGIS returns true in any geometry that is not * a linestring. I made it to be like PostGIS */ +static str geosIsClosed(bit *out, const GEOSGeometry *geosGeometry) { + int geometryType = GEOSGeomTypeId(geosGeometry)+1; + int i = 0; + str err; + int geometriesNum; + + *out = bit_nil; + + switch(geometryType) { + case -1: + throw(MAL, geom.IsClosed, GEOSGeomTypeId failed); + case wkbPoint: + case wkbPolygon: + case wkbMultiPoint: + case wkbMultiPolygon: + //In all these case it is always true + *out = 1; + break; + case wkbLineString: + //check + if((i = GEOSisClosed(geosGeometry)) == 2) + throw(MAL, geom.IsClosed, GEOSisClosed failed); + *out = i; + break; + case wkbMultiLineString: + case wkbGeometryCollection: + //check each one separately + geometriesNum = GEOSGetNumGeometries(geosGeometry); + if(geometriesNum 0) + throw(MAL, geom.IsClosed,GEOSGetNumGeometries failed); + + for(i=0; igeometriesNum; i++) { + const GEOSGeometry *gN = GEOSGetGeometryN(geosGeometry, i); + if(!gN) + throw(MAL, geom.IsClosed, GEOSGetGeometryN failed); + + if((err = geosIsClosed(out, gN)) != MAL_SUCCEED) { + str msg = createException(MAL, geom.IsClosed, %s, err); + GDKfree(err); + return msg; + } + + if(!*out) //no reason to check further logical AND will always be 0 + return MAL_SUCCEED; + } + + break; + default: + throw(MAL, geom.IsClosed, Unknown geometry type); + } + + return MAL_SUCCEED; +} + str wkbIsClosed(bit *out, wkb **geom) { - int res = -1; - int geometryType = 0; + str err; + GEOSGeom geosGeometry = wkb2geos(*geom); - - *out = bit_nil; - if (!geosGeometry) throw(MAL, geom.IsClosed, wkb2geos failed); - geometryType = GEOSGeomTypeId(geosGeometry)+1; - - /* if the geometry is point or multipoint it is always closed */ - if(geometryType == wkbPoint || geometryType == wkbMultiPoint) { - *out = 1; + if((err = geosIsClosed(out, geosGeometry)) != MAL_SUCCEED) { + str msg = createException(MAL, geom.IsClosed, %s, err); + GDKfree(err); GEOSGeom_destroy(geosGeometry); - return MAL_SUCCEED; - } - - /* if the geometry is not a point, multipoint or linestring, it is always not closed */ - if(geometryType != wkbLineString) { - *out = 0; - GEOSGeom_destroy(geosGeometry); - return MAL_SUCCEED; - } - - - res = GEOSisClosed(geosGeometry); + + return msg; + } + GEOSGeom_destroy(geosGeometry); - if(res == 2) - throw(MAL, geom.IsClosed, GEOSisClosed failed); - *out = res; return MAL_SUCCEED; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: geo - Generale function that handles an input BAT with ...
Changeset: c99aa741431e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c99aa741431e Added Files: geom/sql/Tests/functions/Tests/ST_IsEmpty.sql geom/sql/Tests/functions/Tests/ST_IsEmpty.stable.err geom/sql/Tests/functions/Tests/ST_IsEmpty.stable.out Removed Files: geom/sql/Tests/functions/Tests/isEmpty.sql Modified Files: geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: Generale function that handles an input BAT with wkb and an output BAT with bit ST_IsClosed bat version changed to use the general function ST_IsEmpty : mtest + Bulk diffs (215 lines): diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -130,7 +130,10 @@ geom_export str wkbAsText_bat(bat *inBAT geom_export str wkbAsBinary(char**, wkb**); geom_export str wkbFromBinary(wkb**, char**); + geom_export str wkbIsEmpty(bit*, wkb**); +geom_export str wkbIsEmpty_bat(bat *inBAT_id, bat *outBAT_id); + geom_export str wkbIsSimple(bit*, wkb**); //Is3D //IsMeasured diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal --- a/geom/monetdb5/geom.mal +++ b/geom/monetdb5/geom.mal @@ -505,7 +505,9 @@ function AsEWKT(w:bat[:oid,:wkb]) :bat[: end AsEWKT; command Boundary(w:bat[:oid,:wkb]) :bat[:oid,:wkb] address wkbBoundary_bat; + command IsClosed(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsClosed_bat; +command IsEmpty(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsEmpty_bat; command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat; command geom.pbsmIndexLoad() address pbsmIndexLoad_bat; diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c --- a/geom/monetdb5/geomBulk.c +++ b/geom/monetdb5/geomBulk.c @@ -191,7 +191,7 @@ str wkbBoundary_bat(bat *outBAT_id, bat return MAL_SUCCEED; } -str wkbIsClosed_bat(bat *outBAT_id, bat *inBAT_id) { +static str wkbBitOut_bat(bat *outBAT_id, bat *inBAT_id, str (*func)(bit*, wkb**), const char *name) { BAT *outBAT = NULL, *inBAT = NULL; wkb *inWKB = NULL; BUN p =0, q =0; @@ -199,18 +199,18 @@ str wkbIsClosed_bat(bat *outBAT_id, bat //get the descriptor of the BAT if ((inBAT = BATdescriptor(*inBAT_id)) == NULL) { - throw(MAL, batgeom.wkbIsClosed, RUNTIME_OBJECT_MISSING); + throw(MAL, name, RUNTIME_OBJECT_MISSING); } if ( inBAT-htype != TYPE_void ) { //header type of BAT not void BBPreleaseref(inBAT-batCacheid); - throw(MAL, batgeom.wkbIsClosed, The arguments must have dense and aligned heads); + throw(MAL, name, The arguments must have dense and aligned heads); } //create a new for the output BAT if ((outBAT = BATnew(TYPE_void, ATOMindex(bit), BATcount(inBAT), TRANSIENT)) == NULL) { BBPreleaseref(inBAT-batCacheid); - throw(MAL, batgeom.wkbIsClosed, MAL_MALLOC_FAIL); + throw(MAL, name, MAL_MALLOC_FAIL); } //set the first idx of the new BAT equal to that of the input BAT BATseqbase(outBAT, inBAT-hseqbase); @@ -222,8 +222,8 @@ str wkbIsClosed_bat(bat *outBAT_id, bat bit outSingle; inWKB = (wkb*) BUNtail(inBAT_iter, p); - if ((err = wkbIsClosed(outSingle, inWKB)) != MAL_SUCCEED) { - str msg = createException(MAL, batgeom.wkbIsClosed, %s, err); + if ((err = (*func)(outSingle, inWKB)) != MAL_SUCCEED) { + str msg = createException(MAL, name, %s, err); GDKfree(err); BBPreleaseref(inBAT-batCacheid); @@ -241,9 +241,15 @@ str wkbIsClosed_bat(bat *outBAT_id, bat BBPkeepref(*outBAT_id = outBAT-batCacheid); return MAL_SUCCEED; + } - +str wkbIsClosed_bat(bat *outBAT_id, bat *inBAT_id) { + return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsClosed, batgeom.wkbIsClosed); +} +str wkbIsEmpty_bat(bat *outBAT_id, bat *inBAT_id) { + return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsEmpty, batgeom.wkbIsEmpty); +} /***/ /* Two inputs **/ diff --git a/geom/sql/Tests/functions/Tests/All b/geom/sql/Tests/functions/Tests/All --- a/geom/sql/Tests/functions/Tests/All +++ b/geom/sql/Tests/functions/Tests/All @@ -14,7 +14,9 @@ loadTestGeometries ST_AsText ST_IsClosed -#isSimple +#ST_IsSimple +ST_IsEmpty + #isValid #isRing #coordinates diff --git a/geom/sql/Tests/functions/Tests/isEmpty.sql b/geom/sql/Tests/functions/Tests/ST_IsEmpty.sql rename from geom/sql/Tests/functions/Tests/isEmpty.sql rename to geom/sql/Tests/functions/Tests/ST_IsEmpty.sql --- a/geom/sql/Tests/functions/Tests/isEmpty.sql +++
MonetDB: geo - ST_IsClosed: bulk+mtest
Changeset: 88c68d6b5848 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=88c68d6b5848 Added Files: geom/sql/Tests/functions/Tests/ST_IsClosed.sql geom/sql/Tests/functions/Tests/ST_IsClosed.stable.err geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out Removed Files: geom/sql/Tests/functions/Tests/isClosed.sql geom/sql/Tests/functions/Tests/isClosed.stable.err geom/sql/Tests/functions/Tests/isClosed.stable.out Modified Files: geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: ST_IsClosed: bulk+mtest diffs (truncated from 458 to 300 lines): diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -180,7 +180,10 @@ geom_export str wkbExteriorRing(wkb**, w geom_export str wkbInteriorRingN(wkb**, wkb**, short*); geom_export str wkbNumRings(int*, wkb**, int*); geom_export str wkbInteriorRings(wkba**, wkb**); + geom_export str wkbIsClosed(bit *out, wkb **geom); +geom_export str wkbIsClosed_bat(bat *inBAT_id, bat *outBAT_id); + geom_export str wkbIsRing(bit *out, wkb **geom); geom_export str wkbIsValid(bit *out, wkb **geom); geom_export str wkbIsValidReason(char** out, wkb **geom); diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal --- a/geom/monetdb5/geom.mal +++ b/geom/monetdb5/geom.mal @@ -504,8 +504,8 @@ function AsEWKT(w:bat[:oid,:wkb]) :bat[: return x; end AsEWKT; -command Boundary(w:bat[:oid,:wkb]) :bat[:oid,:wkb] address wkbBoundary_bat -comment Returns the closure of the combinatorial boundary of the input geometries; +command Boundary(w:bat[:oid,:wkb]) :bat[:oid,:wkb] address wkbBoundary_bat; +command IsClosed(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsClosed_bat; command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat; command geom.pbsmIndexLoad() address pbsmIndexLoad_bat; diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c --- a/geom/monetdb5/geomBulk.c +++ b/geom/monetdb5/geomBulk.c @@ -177,7 +177,7 @@ str wkbBoundary_bat(bat *outBAT_id, bat return msg; } - BUNappend(outBAT,outSingle,TRUE); //add the point to the new BAT + BUNappend(outBAT,outSingle,TRUE); //add the result to the new BAT GDKfree(outSingle); outSingle = NULL; } @@ -191,6 +191,58 @@ str wkbBoundary_bat(bat *outBAT_id, bat return MAL_SUCCEED; } +str wkbIsClosed_bat(bat *outBAT_id, bat *inBAT_id) { + BAT *outBAT = NULL, *inBAT = NULL; + wkb *inWKB = NULL; + BUN p =0, q =0; + BATiter inBAT_iter; + + //get the descriptor of the BAT + if ((inBAT = BATdescriptor(*inBAT_id)) == NULL) { + throw(MAL, batgeom.wkbIsClosed, RUNTIME_OBJECT_MISSING); + } + + if ( inBAT-htype != TYPE_void ) { //header type of BAT not void + BBPreleaseref(inBAT-batCacheid); + throw(MAL, batgeom.wkbIsClosed, The arguments must have dense and aligned heads); + } + + //create a new for the output BAT + if ((outBAT = BATnew(TYPE_void, ATOMindex(bit), BATcount(inBAT), TRANSIENT)) == NULL) { + BBPreleaseref(inBAT-batCacheid); + throw(MAL, batgeom.wkbIsClosed, MAL_MALLOC_FAIL); + } + //set the first idx of the new BAT equal to that of the input BAT + BATseqbase(outBAT, inBAT-hseqbase); + + //iterator over the input BAT + inBAT_iter = bat_iterator(inBAT); + BATloop(inBAT, p, q) { //iterate over all valid elements + str err = NULL; + bit outSingle; + + inWKB = (wkb*) BUNtail(inBAT_iter, p); + if ((err = wkbIsClosed(outSingle, inWKB)) != MAL_SUCCEED) { + str msg = createException(MAL, batgeom.wkbIsClosed, %s, err); + GDKfree(err); + + BBPreleaseref(inBAT-batCacheid); + BBPreleaseref(outBAT-batCacheid); + + return msg; + } + BUNappend(outBAT,outSingle,TRUE); //add the result to the new BAT + } + + //set the number of elements in the outBAT + BATsetcount(outBAT, BATcount(inBAT)); + + BBPreleaseref(inBAT-batCacheid); + BBPkeepref(*outBAT_id = outBAT-batCacheid); + + return MAL_SUCCEED; +} + /***/ diff --git a/geom/sql/Tests/functions/Tests/All b/geom/sql/Tests/functions/Tests/All --- a/geom/sql/Tests/functions/Tests/All +++ b/geom/sql/Tests/functions/Tests/All @@ -13,7 +13,7 @@ loadTestGeometries ST_AsText -#isClosed +ST_IsClosed #isSimple #isValid #isRing diff --git
MonetDB: geo - new geometries are loading - new outputs of exist...
Changeset: 75f50cc544fa for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=75f50cc544fa Modified Files: geom/sql/Tests/functions/Tests/ST_Boundary.stable.out geom/sql/Tests/functions/Tests/ST_Contains.stable.out geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out geom/sql/Tests/functions/Tests/loadTestGeometries.sql geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out Branch: geo Log Message: new geometries are loading - new outputs of existing tests approved diffs (59 lines): diff --git a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out @@ -59,6 +59,8 @@ Ready. [ MULTIPOINT (10 20, 30 40), GEOMETRYCOLLECTION EMPTY ] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), MULTIPOINT (30 40, 40 50, 50 60, 60 70) ] [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), MULTIPOINT (50 60, 60 70) ] +[ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60)), MULTIPOINT EMPTY ] +[ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), MULTILINESTRING ((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))] # 16:00:23 # 16:00:23 Done. diff --git a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out @@ -65,6 +65,7 @@ Ready. [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), false ] [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60)), false ] [ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), true] +[ MULTIPOLYGON EMPTY,false ] [ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), true] [ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40, 10 20), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), true] diff --git a/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out b/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out --- a/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out @@ -102,6 +102,7 @@ Ready. [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), false ] [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60)), true] [ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), true] +[ MULTIPOLYGON EMPTY,false ] [ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), false ] [ GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 20, 30 40, 10 20), POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10))), true] diff --git a/geom/sql/Tests/functions/Tests/loadTestGeometries.sql b/geom/sql/Tests/functions/Tests/loadTestGeometries.sql --- a/geom/sql/Tests/functions/Tests/loadTestGeometries.sql +++ b/geom/sql/Tests/functions/Tests/loadTestGeometries.sql @@ -18,6 +18,8 @@ INSERT INTO geometries(geom) VALUES(ST_W --8 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOLYGON(((10 10, 10 20, 20 20, 20 10, 10 10),(30 30, 30 40, 40 40, 40 30, 30 30)))')); --9 +INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOLYGON EMPTY')); +--10 INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); ---10 closed +--11 closed INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40, 10 20),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); diff --git a/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out b/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out --- a/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out +++ b/geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out @@ -73,6 +73,8 @@ Ready. [ 1] #INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOLYGON(((10 10, 10 20, 20 20, 20 10, 10 10),(30 30, 30 40, 40 40, 40 30, 30 30)))')); [ 1] +#INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('MULTIPOLYGON EMPTY')); +[ 1] #INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); [ 1] #INSERT INTO geometries(geom) VALUES(ST_WKTToSQL('GEOMETRYCOLLECTION(POINT(10 20),LINESTRING(10 20, 30 40, 10 20),POLYGON((10 10, 10 20, 20 20, 20 10, 10 10)))')); ___ checkin-list mailing list checkin-list@monetdb.org
MonetDB: geo - ST_IsClosed : empty geometries are never closed
Changeset: 486003e3a10e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=486003e3a10e Modified Files: geom/monetdb5/geom.c Branch: geo Log Message: ST_IsClosed : empty geometries are never closed diffs (33 lines): diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -3451,13 +3451,27 @@ static str geosIsClosed(bit *out, const return MAL_SUCCEED; } -str wkbIsClosed(bit *out, wkb **geom) { +str wkbIsClosed(bit *out, wkb **geomWKB) { str err; - GEOSGeom geosGeometry = wkb2geos(*geom); + GEOSGeom geosGeometry = wkb2geos(*geomWKB); if (!geosGeometry) throw(MAL, geom.IsClosed, wkb2geos failed); + //if empty geometry return false + if((err = wkbIsEmpty(out, geomWKB)) != MAL_SUCCEED) { + str msg = createException(MAL, geom.IsEmpty, %s, err); + GDKfree(err); + GEOSGeom_destroy(geosGeometry); + + return msg; + } + if(*out) { + *out = 0; + GEOSGeom_destroy(geosGeometry); + return MAL_SUCCEED; + } + if((err = geosIsClosed(out, geosGeometry)) != MAL_SUCCEED) { str msg = createException(MAL, geom.IsClosed, %s, err); GDKfree(err); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: geo - ST_IsValid : mTest + bulk
Changeset: e68172cd826e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e68172cd826e Added Files: geom/sql/Tests/functions/Tests/ST_IsValid.sql geom/sql/Tests/functions/Tests/ST_IsValid.stable.err geom/sql/Tests/functions/Tests/ST_IsValid.stable.out Removed Files: geom/sql/Tests/functions/Tests/isValid.sql geom/sql/Tests/functions/Tests/isValid.stable.err geom/sql/Tests/functions/Tests/isValid.stable.out Modified Files: geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: ST_IsValid : mTest + bulk diffs (285 lines): diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -192,6 +192,8 @@ geom_export str wkbIsRing(bit *out, wkb geom_export str wkbIsRing_bat(bat *inBAT_id, bat *outBAT_id); geom_export str wkbIsValid(bit *out, wkb **geom); +geom_export str wkbIsValid_bat(bat *inBAT_id, bat *outBAT_id); + geom_export str wkbIsValidReason(char** out, wkb **geom); geom_export str wkbIsValidDetail(char** out, wkb **geom); diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal --- a/geom/monetdb5/geom.mal +++ b/geom/monetdb5/geom.mal @@ -510,6 +510,7 @@ command IsClosed(w:bat[:oid,:wkb]) :bat[ command IsEmpty(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsEmpty_bat; command IsSimple(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsSimple_bat; command IsRing(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsRing_bat; +command IsValid(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsValid_bat; command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat; command geom.pbsmIndexLoad() address pbsmIndexLoad_bat; diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c --- a/geom/monetdb5/geomBulk.c +++ b/geom/monetdb5/geomBulk.c @@ -256,6 +256,9 @@ str wkbIsSimple_bat(bat *outBAT_id, bat str wkbIsRing_bat(bat *outBAT_id, bat *inBAT_id) { return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsRing, batgeom.wkbIsRing); } +str wkbIsValid_bat(bat *outBAT_id, bat *inBAT_id) { + return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsValid, batgeom.wkbIsValid); +} /***/ /* Two inputs **/ diff --git a/geom/sql/Tests/functions/Tests/All b/geom/sql/Tests/functions/Tests/All --- a/geom/sql/Tests/functions/Tests/All +++ b/geom/sql/Tests/functions/Tests/All @@ -16,9 +16,7 @@ ST_AsText ST_IsClosed ST_IsEmpty ST_IsSimple - -#isValid - +ST_IsValid ST_IsRing #coordinates diff --git a/geom/sql/Tests/functions/Tests/isValid.sql b/geom/sql/Tests/functions/Tests/ST_IsValid.sql rename from geom/sql/Tests/functions/Tests/isValid.sql rename to geom/sql/Tests/functions/Tests/ST_IsValid.sql --- a/geom/sql/Tests/functions/Tests/isValid.sql +++ b/geom/sql/Tests/functions/Tests/ST_IsValid.sql @@ -1,10 +1,10 @@ create table geo (g geometry(multipoint, 4326)); -insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 30 30)', 4326)); -insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 10 10)', 4326)); +insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 30 30)', 4326)); +insert into geo values (st_mpointfromtext('MULTIPOINT(10 10, 20 20, 10 10)', 4326)); select st_isvalid(g) from geo; drop table geo; +select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')); -select ST_IsValid(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')); -select ST_IsValidReason(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')); +SELECT geom AS GEOMETRY FROM geometries WHERE ST_IsValid(geom); diff --git a/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err new file mode 100644 --- /dev/null +++ b/geom/sql/Tests/functions/Tests/ST_IsValid.stable.err @@ -0,0 +1,36 @@ +stderr of test 'ST_IsValid` in directory 'geom/sql/Tests/functions` itself: + + +# 15:17:46 +# 15:17:46 mserver5 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=39488 --set mapi_usock=/var/tmp/mtest-8421/.s.monetdb.39488 --set monet_prompt= --forcemito --set mal_listing=2 --dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions --set mal_listing=0 +# 15:17:46 + +# builtin opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = +# builtin opt monet_daemon = no +# builtin opt mapi_port = 5 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 39488 +# cmdline opt mapi_usock =
MonetDB: geo - ST_IsSimple : mTest + bulk
Changeset: 68eaf92bc7ad for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68eaf92bc7ad Added Files: geom/sql/Tests/functions/Tests/ST_IsSimple.sql geom/sql/Tests/functions/Tests/ST_IsSimple.stable.err geom/sql/Tests/functions/Tests/ST_IsSimple.stable.out Removed Files: geom/sql/Tests/functions/Tests/isSimple.sql geom/sql/Tests/functions/Tests/isSimple.stable.err geom/sql/Tests/functions/Tests/isSimple.stable.out Modified Files: geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: ST_IsSimple : mTest + bulk diffs (truncated from 319 to 300 lines): diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -135,6 +135,7 @@ geom_export str wkbIsEmpty(bit*, wkb**); geom_export str wkbIsEmpty_bat(bat *inBAT_id, bat *outBAT_id); geom_export str wkbIsSimple(bit*, wkb**); +geom_export str wkbIsSimple_bat(bat *inBAT_id, bat *outBAT_id); //Is3D //IsMeasured geom_export str wkbBoundary(wkb **outWKB, wkb **inWKB); diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal --- a/geom/monetdb5/geom.mal +++ b/geom/monetdb5/geom.mal @@ -508,6 +508,7 @@ command Boundary(w:bat[:oid,:wkb]) :bat[ command IsClosed(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsClosed_bat; command IsEmpty(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsEmpty_bat; +command IsSimple(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsSimple_bat; command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat; command geom.pbsmIndexLoad() address pbsmIndexLoad_bat; diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c --- a/geom/monetdb5/geomBulk.c +++ b/geom/monetdb5/geomBulk.c @@ -250,6 +250,9 @@ str wkbIsClosed_bat(bat *outBAT_id, bat str wkbIsEmpty_bat(bat *outBAT_id, bat *inBAT_id) { return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsEmpty, batgeom.wkbIsEmpty); } +str wkbIsSimple_bat(bat *outBAT_id, bat *inBAT_id) { + return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsSimple, batgeom.wkbIsSimple); +} /***/ /* Two inputs **/ diff --git a/geom/sql/Tests/functions/Tests/All b/geom/sql/Tests/functions/Tests/All --- a/geom/sql/Tests/functions/Tests/All +++ b/geom/sql/Tests/functions/Tests/All @@ -14,8 +14,8 @@ loadTestGeometries ST_AsText ST_IsClosed -#ST_IsSimple ST_IsEmpty +ST_IsSimple #isValid #isRing diff --git a/geom/sql/Tests/functions/Tests/isSimple.sql b/geom/sql/Tests/functions/Tests/ST_IsSimple.sql rename from geom/sql/Tests/functions/Tests/isSimple.sql rename to geom/sql/Tests/functions/Tests/ST_IsSimple.sql --- a/geom/sql/Tests/functions/Tests/isSimple.sql +++ b/geom/sql/Tests/functions/Tests/ST_IsSimple.sql @@ -13,7 +13,8 @@ drop table geo; create table geo (g geometry(multipoint, 4326)); insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 30 30)', 4326)); -insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 10 10)', 4326)); +insert into geo values (st_mpointfromtext('multipoint(10 10, 20 20, 10 5)', 4326)); select st_isvalid(g) from geo; drop table geo; +SELECT geom AS GEOMETRY FROM geometries WHERE id10 AND ST_IsSimple(geom); diff --git a/geom/sql/Tests/functions/Tests/ST_IsSimple.stable.err b/geom/sql/Tests/functions/Tests/ST_IsSimple.stable.err new file mode 100644 --- /dev/null +++ b/geom/sql/Tests/functions/Tests/ST_IsSimple.stable.err @@ -0,0 +1,36 @@ +stderr of test 'ST_IsSimple` in directory 'geom/sql/Tests/functions` itself: + + +# 14:37:11 +# 14:37:11 mserver5 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=38572 --set mapi_usock=/var/tmp/mtest-4305/.s.monetdb.38572 --set monet_prompt= --forcemito --set mal_listing=2 --dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions --set mal_listing=0 +# 14:37:11 + +# builtin opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = +# builtin opt monet_daemon = no +# builtin opt mapi_port = 5 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 38572 +# cmdline opt mapi_usock = /var/tmp/mtest-4305/.s.monetdb.38572 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions +# cmdline opt mal_listing = 0 +# cmdline opt gdk_debug = 536870922 + +# 14:37:11 +# 14:37:11 mclient -lsql -ftest -Eutf-8 -i -e
MonetDB: geo - new geometries loaded in geneeral table
Changeset: 3da762beeb8f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3da762beeb8f Added Files: geom/sql/Tests/functions/Tests/ST_IsRing.stable.err geom/sql/Tests/functions/Tests/ST_IsRing.stable.out Modified Files: geom/sql/Tests/functions/Tests/ST_Boundary.sql geom/sql/Tests/functions/Tests/ST_Boundary.stable.out geom/sql/Tests/functions/Tests/ST_Contains.stable.out geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out geom/sql/Tests/functions/Tests/ST_IsSimple.sql geom/sql/Tests/functions/Tests/ST_IsSimple.stable.out geom/sql/Tests/functions/Tests/loadTestGeometries.sql geom/sql/Tests/functions/Tests/loadTestGeometries.stable.out Branch: geo Log Message: new geometries loaded in geneeral table New outputs of tests approved diffs (238 lines): diff --git a/geom/sql/Tests/functions/Tests/ST_Boundary.sql b/geom/sql/Tests/functions/Tests/ST_Boundary.sql --- a/geom/sql/Tests/functions/Tests/ST_Boundary.sql +++ b/geom/sql/Tests/functions/Tests/ST_Boundary.sql @@ -6,6 +6,6 @@ SELECT ST_Boundary(ST_GeomFromText('POLY SELECT ST_Boundary(ST_GeomFromText('MULTILINESTRING((1 1 1,0 0 0.5, -1 1 1),(1 1 0.5,0 0 0.5, -1 1 0.5, 1 1 0.5) )')); -SELECT geom AS GEOMETRY, ST_Boundary(geom) AS BOUNDARY FROM geometries WHERE id9; +SELECT geom AS GEOMETRY, ST_Boundary(geom) AS BOUNDARY FROM geometries WHERE id12; diff --git a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Boundary.stable.out @@ -55,12 +55,15 @@ Ready. % 0, 0 # length [ POINT (10 20), GEOMETRYCOLLECTION EMPTY ] [ LINESTRING (10 20, 30 40, 50 60), MULTIPOINT (10 20, 50 60) ] +[ LINESTRING (10 20, 30 40, 50 60, 80 60, 60 40, 10 20), MULTIPOINT EMPTY ] +[ LINESTRING (10 10, 50 50, 30 80, 25 5),MULTIPOINT (10 10, 25 5) ] [ POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)), LINESTRING (10 10, 10 20, 20 20, 20 10, 10 10)] [ MULTIPOINT (10 20, 30 40), GEOMETRYCOLLECTION EMPTY ] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), MULTIPOINT (30 40, 40 50, 50 60, 60 70) ] [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 60 70)), MULTIPOINT (50 60, 60 70) ] [ MULTILINESTRING ((30 40, 40 50, 30 40), (50 60, 40 50, 20 30, 50 60)), MULTIPOINT EMPTY ] [ MULTIPOLYGON (((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))), MULTILINESTRING ((10 10, 10 20, 20 20, 20 10, 10 10), (30 30, 30 40, 40 40, 40 30, 30 30))] +[ MULTIPOLYGON EMPTY,MULTILINESTRING EMPTY ] # 16:00:23 # 16:00:23 Done. diff --git a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out --- a/geom/sql/Tests/functions/Tests/ST_Contains.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_Contains.stable.out @@ -59,6 +59,8 @@ Ready. % 0, 5 # length [ POINT (10 20), false ] [ LINESTRING (10 20, 30 40, 50 60), false ] +[ LINESTRING (10 20, 30 40, 50 60, 80 60, 60 40, 10 20), false ] +[ LINESTRING (10 10, 50 50, 30 80, 25 5),true] [ POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)), true] [ MULTIPOINT (10 20, 30 40), false ] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), false ] diff --git a/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out b/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out --- a/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out +++ b/geom/sql/Tests/functions/Tests/ST_IsClosed.stable.out @@ -96,6 +96,8 @@ Ready. % 0, 5 # length [ POINT (10 20), true] [ LINESTRING (10 20, 30 40, 50 60), false ] +[ LINESTRING (10 20, 30 40, 50 60, 80 60, 60 40, 10 20), true] +[ LINESTRING (10 10, 50 50, 30 80, 25 5),false ] [ POLYGON ((10 10, 10 20, 20 20, 20 10, 10 10)), true] [ MULTIPOINT (10 20, 30 40), true] [ MULTILINESTRING ((30 40, 40 50), (50 60, 60 70)), false ] diff --git a/geom/sql/Tests/functions/Tests/ST_IsRing.stable.err b/geom/sql/Tests/functions/Tests/ST_IsRing.stable.err new file mode 100644 --- /dev/null +++ b/geom/sql/Tests/functions/Tests/ST_IsRing.stable.err @@ -0,0 +1,36 @@ +stderr of test 'ST_IsRing` in directory 'geom/sql/Tests/functions` itself: + + +# 14:55:48 +# 14:55:48 mserver5 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=34702 --set mapi_usock=/var/tmp/mtest-5773/.s.monetdb.34702 --set monet_prompt= --forcemito --set mal_listing=2 --dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions --set mal_listing=0 +# 14:55:48 + +# builtin opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = no +# builtin opt monet_prompt = +# builtin opt
MonetDB: geo - merge with default
Changeset: 6ac68d66ab12 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ac68d66ab12 Modified Files: geom/monetdb5/geom.c Branch: geo Log Message: merge with default diffs (43 lines): diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -1597,7 +1597,6 @@ static str dumpPointsPolygon(BAT* idBAT, const GEOSGeometry* exteriorRingGeometry; int numInteriorRings=0, i=0; str err; - char* lvlStr = NULL; int lvlDigitsNum = 10; //MAX_UNIT = 4,294,967,295 size_t pathLength = strlen(path); char* newPath = NULL; @@ -1619,7 +1618,6 @@ static str dumpPointsPolygon(BAT* idBAT, strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); //get the points in the exterior ring @@ -1648,7 +1646,6 @@ static str dumpPointsPolygon(BAT* idBAT, strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); if((err = dumpPointsLineString(idBAT, geomBAT, GEOSGetInteriorRingN(geosGeometry, i), newPath)) != MAL_SUCCEED) { str msg = createException(MAL, geom.DumpPoints, %s, err); @@ -1668,7 +1665,6 @@ static str dumpPointsMultiGeometry(BAT* const GEOSGeometry* multiGeometry = NULL; str err; unsigned int lvl = 0; - char* lvlStr = NULL; size_t pathLength = strlen(path); char* newPath = NULL; char* extraStr = ,; @@ -1686,7 +1682,6 @@ static str dumpPointsMultiGeometry(BAT* strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); //*secondLevel = 0; if((err = dumpPointsGeometry(idBAT, geomBAT, multiGeometry, newPath)) != MAL_SUCCEED) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: geo - removed output of old tests
Changeset: 39d40d9f9e1c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=39d40d9f9e1c Modified Files: geom/sql/Tests/functions/Tests/coordinates.stable.err geom/sql/Tests/functions/Tests/geomFromText.stable.err geom/sql/Tests/functions/Tests/lineFromText.stable.err geom/sql/Tests/functions/Tests/makeBox2D.stable.err geom/sql/Tests/functions/Tests/makePoint.sql geom/sql/Tests/functions/Tests/makePoint.stable.err geom/sql/Tests/functions/Tests/mlineFromText.stable.err geom/sql/Tests/functions/Tests/mpointFromText.stable.err geom/sql/Tests/functions/Tests/mpolygonFromText.stable.err geom/sql/Tests/functions/Tests/numPoints.stable.err geom/sql/Tests/functions/Tests/numRings.stable.err geom/sql/Tests/functions/Tests/pointFromText.stable.err geom/sql/Tests/functions/Tests/polygonFromText.stable.err geom/sql/Tests/functions/Tests/srid.stable.err geom/sql/Tests/functions/Tests/transform.stable.err Branch: geo Log Message: removed output of old tests diffs (truncated from 660 to 300 lines): diff --git a/geom/sql/Tests/functions/Tests/coordinates.stable.err b/geom/sql/Tests/functions/Tests/coordinates.stable.err --- a/geom/sql/Tests/functions/Tests/coordinates.stable.err +++ b/geom/sql/Tests/functions/Tests/coordinates.stable.err @@ -29,7 +29,7 @@ stderr of test 'coordinates` in director # 10:52:10 mclient -lsql -ftest -Eutf-8 -i -e --host=/var/tmp/mtest-4010 --port=39851 # 10:52:10 -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = select st_x(g) as X, st_y(g) as Y, st_Z(g) as Z, g from geo; ERROR = !Geometry not a Point diff --git a/geom/sql/Tests/functions/Tests/geomFromText.stable.err b/geom/sql/Tests/functions/Tests/geomFromText.stable.err --- a/geom/sql/Tests/functions/Tests/geomFromText.stable.err +++ b/geom/sql/Tests/functions/Tests/geomFromText.stable.err @@ -29,184 +29,184 @@ stderr of test 'geomFromText` in directo # 10:52:04 mclient -lsql -ftest -Eutf-8 -i -e --host=/var/tmp/mtest-4010 --port=39851 # 10:52:04 -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20)', 4326)); ERROR = !column needs geometry(4, 0) and value is geometry(4, 4326) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('linestring(10 10, 20 20, 30 40)')); ERROR = !column needs geometry(4, 0) and value is geometry(8, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20)')); ERROR = !column needs geometry(4, 4326) and value is geometry(4, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20)', 0)); ERROR = !column needs geometry(4, 4326) and value is geometry(4, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('linestring(10 10, 20 20, 30 40)', 4329)); ERROR = !column needs geometry(4, 4326) and value is geometry(8, 4329) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20 20)', 4326)); ERROR = !column needs geometry(6, 0) and value is geometry(6, 4326) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('linestring(10 10, 20 20, 30 40)')); ERROR = !column needs geometry(6, 0) and value is geometry(8, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20 20)')); ERROR = !column needs geometry(6, 4326) and value is geometry(6, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('point(0 20 20)', 0)); ERROR = !column needs geometry(6, 4326) and value is geometry(6, 0) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into points_tbl values (st_geomfromtext('linestring(10 10, 20 20, 30 40)', 4326)); ERROR = !column needs geometry(6, 4326) and value is geometry(8, 4326) -MAPI = (monetdb) /var/tmp/mtest-4010/.s.monetdb.39851 +MAPI = (monetdb) /var/tmp/mtest-14230/.s.monetdb.38644 QUERY = insert into
MonetDB: geo - ST_IsRing : mTest + bulk
Changeset: 752f543236a0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=752f543236a0 Added Files: geom/sql/Tests/functions/Tests/ST_IsRing.sql Removed Files: geom/sql/Tests/functions/Tests/isRing.sql geom/sql/Tests/functions/Tests/isRing.stable.err geom/sql/Tests/functions/Tests/isRing.stable.out Modified Files: geom/monetdb5/geom.h geom/monetdb5/geom.mal geom/monetdb5/geomBulk.c geom/sql/Tests/functions/Tests/All Branch: geo Log Message: ST_IsRing : mTest + bulk diffs (156 lines): diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h --- a/geom/monetdb5/geom.h +++ b/geom/monetdb5/geom.h @@ -189,6 +189,8 @@ geom_export str wkbIsClosed(bit *out, wk geom_export str wkbIsClosed_bat(bat *inBAT_id, bat *outBAT_id); geom_export str wkbIsRing(bit *out, wkb **geom); +geom_export str wkbIsRing_bat(bat *inBAT_id, bat *outBAT_id); + geom_export str wkbIsValid(bit *out, wkb **geom); geom_export str wkbIsValidReason(char** out, wkb **geom); geom_export str wkbIsValidDetail(char** out, wkb **geom); diff --git a/geom/monetdb5/geom.mal b/geom/monetdb5/geom.mal --- a/geom/monetdb5/geom.mal +++ b/geom/monetdb5/geom.mal @@ -509,6 +509,7 @@ command Boundary(w:bat[:oid,:wkb]) :bat[ command IsClosed(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsClosed_bat; command IsEmpty(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsEmpty_bat; command IsSimple(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsSimple_bat; +command IsRing(w:bat[:oid,:wkb]) :bat[:oid,:bit] address wkbIsRing_bat; command pbsmIndexCreate(x:bat[:oid,:dbl], y:bat[:oid,:dbl], xmin:dbl, ymin:dbl, xmax:dbl, ymax:dbl) :bat[:oid,:int] address pbsmIndexCreate_bat; command geom.pbsmIndexLoad() address pbsmIndexLoad_bat; diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c --- a/geom/monetdb5/geomBulk.c +++ b/geom/monetdb5/geomBulk.c @@ -253,6 +253,9 @@ str wkbIsEmpty_bat(bat *outBAT_id, bat * str wkbIsSimple_bat(bat *outBAT_id, bat *inBAT_id) { return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsSimple, batgeom.wkbIsSimple); } +str wkbIsRing_bat(bat *outBAT_id, bat *inBAT_id) { + return wkbBitOut_bat(outBAT_id, inBAT_id, wkbIsRing, batgeom.wkbIsRing); +} /***/ /* Two inputs **/ diff --git a/geom/sql/Tests/functions/Tests/All b/geom/sql/Tests/functions/Tests/All --- a/geom/sql/Tests/functions/Tests/All +++ b/geom/sql/Tests/functions/Tests/All @@ -18,7 +18,9 @@ ST_IsEmpty ST_IsSimple #isValid -#isRing + +ST_IsRing + #coordinates #srid #geometryN diff --git a/geom/sql/Tests/functions/Tests/isRing.sql b/geom/sql/Tests/functions/Tests/ST_IsRing.sql rename from geom/sql/Tests/functions/Tests/isRing.sql rename to geom/sql/Tests/functions/Tests/ST_IsRing.sql --- a/geom/sql/Tests/functions/Tests/isRing.sql +++ b/geom/sql/Tests/functions/Tests/ST_IsRing.sql @@ -2,3 +2,5 @@ SELECT ST_IsRing(st_linefromtext('LINEST SELECT ST_IsRing(st_linefromtext('LINESTRING(0 0, 0 1, 1 0, 1 1, 0 0)')); select ST_IsRing(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')); +SELECT geom AS GEOMETRY FROM geometries WHERE ST_IsRing(geom); + diff --git a/geom/sql/Tests/functions/Tests/isRing.stable.err b/geom/sql/Tests/functions/Tests/isRing.stable.err deleted file mode 100644 --- a/geom/sql/Tests/functions/Tests/isRing.stable.err +++ /dev/null @@ -1,36 +0,0 @@ -stderr of test 'isRing` in directory 'geom/sql/Tests/functions` itself: - - -# 10:52:09 -# 10:52:09 mserver5 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=39851 --set mapi_usock=/var/tmp/mtest-4010/.s.monetdb.39851 --set monet_prompt= --forcemito --set mal_listing=2 --dbpath=/export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions --set mal_listing=0 -# 10:52:09 - -# builtin opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/monetdb5/dbfarm/demo -# builtin opt gdk_debug = 0 -# builtin opt gdk_vmtrim = no -# builtin opt monet_prompt = -# builtin opt monet_daemon = no -# builtin opt mapi_port = 5 -# builtin opt mapi_open = false -# builtin opt mapi_autosense = false -# builtin opt sql_optimizer = default_pipe -# builtin opt sql_debug = 0 -# cmdline opt gdk_nr_threads = 0 -# cmdline opt mapi_open = true -# cmdline opt mapi_port = 39851 -# cmdline opt mapi_usock = /var/tmp/mtest-4010/.s.monetdb.39851 -# cmdline opt monet_prompt = -# cmdline opt mal_listing = 2 -# cmdline opt gdk_dbpath = /export/scratch1/alvanaki/INSTALL/MonetDB-public/var/MonetDB/mTests_geom_sql_Tests_functions -# cmdline opt mal_listing = 0 -# cmdline opt gdk_debug = 536870922 - -# 10:52:10 -# 10:52:10 mclient -lsql -ftest -Eutf-8 -i -e --host=/var/tmp/mtest-4010 --port=39851 -# 10:52:10 - - -# 10:52:10 -# 10:52:10 Done. -# 10:52:10 - diff --git a/geom/sql/Tests/functions/Tests/isRing.stable.out b/geom/sql/Tests/functions/Tests/isRing.stable.out deleted
MonetDB: resultset - Merge with default branch.
Changeset: 7f816770f814 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f816770f814 Modified Files: buildtools/autogen/autogen/am.py clients/Tests/exports.stable.out common/stream/stream.c gdk/gdk.h gdk/gdk_atoms.c gdk/gdk_bat.c gdk/gdk_bbp.c gdk/gdk_delta.c gdk/gdk_delta.h gdk/gdk_heap.c gdk/gdk_imprints.c gdk/gdk_posix.c gdk/gdk_private.h gdk/gdk_storage.c gdk/gdk_system.c gdk/gdk_system.h gdk/gdk_utils.c sql/backends/monet5/sql_result.c sql/server/rel_dump.c Branch: resultset Log Message: Merge with default branch. diffs (truncated from 2197 to 300 lines): diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -977,7 +977,7 @@ def am_gem(fd, var, gem, am): for src in srcs: fd.write(\t[ '$(srcdir)' -ef . ] || rm -f '%s'\n % src) for d in sorted(dirs, reverse = True): -fd.write(\t[ '$(srcdir)' -ef . ] || rmdir '%s'\n % d) +fd.write(\t[ '$(srcdir)' -ef . -o ! -d '%s' ] || rmdir '%s'\n % (d, d)) fd.write(install-exec-local-%s: %s\n % (sf, f[:-4])) fd.write(\tmkdir -p $(DESTDIR)'%s'\n % rd) fd.write(\tgem install --local --install-dir $(DESTDIR)'%s' --force --rdoc '%s'\n % (rd, f[:-4])) @@ -1026,7 +1026,7 @@ def am_python_generic(fd, var, python, a fd.write(\trm '$(DESTDIR)$(prefix)/$(%s_LIBDIR)'/%s-*.egg-info\n % (PYTHON, name.replace('-', '_'))) fd.write('mostlyclean-local:\n') for pkgdir in sorted(pkgdirs, reverse = True): -fd.write(\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n % pkgdir) +fd.write(\t[ '$(srcdir)' -ef . -o ! -d '%s' ] || rm -r '%s'\n % (pkgdir, pkgdir)) def am_python2(fd, var, python, am): am_python_generic(fd, var, python, am, 'PYTHON2') diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -321,7 +321,7 @@ void PROPdestroy(PROPrec *p); BUN SORTfnd(BAT *b, const void *v); BUN SORTfndfirst(BAT *b, const void *v); BUN SORTfndlast(BAT *b, const void *v); -void *THRdata[16]; +void *THRdata[THREADDATA]; void THRdel(Thread t); Thread THRget(int tid); void *THRgetdata(int); diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -207,7 +207,7 @@ mnstr_read(stream *s, void *buf, size_t if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, read %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -226,7 +226,7 @@ mnstr_readline(stream *s, void *buf, siz if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); + fprintf(stderr, readline %s SZFMT \n, s-name ? s-name : unnamed, maxcnt); #endif assert(s-access == ST_READ); if (s-errnr) @@ -283,7 +283,7 @@ mnstr_write(stream *s, const void *buf, if (s == NULL || buf == NULL) return -1; #ifdef STREAM_DEBUG - printf(write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); + fprintf(stderr, write %s SZFMT SZFMT \n, s-name ? s-name : unnamed, elmsize, cnt); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -307,7 +307,7 @@ mnstr_close(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(close %s\n, s-name ? s-name : unnamed); + fprintf(stderr, close %s\n, s-name ? s-name : unnamed); #endif (*s-close) (s); } @@ -318,7 +318,7 @@ mnstr_destroy(stream *s) { if (s) { #ifdef STREAM_DEBUG - printf(destroy %s\n, s-name ? s-name : unnamed); + fprintf(stderr, destroy %s\n, s-name ? s-name : unnamed); #endif (*s-destroy) (s); } @@ -339,7 +339,7 @@ mnstr_flush(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(flush %s\n, s-name ? s-name : unnamed); + fprintf(stderr, flush %s\n, s-name ? s-name : unnamed); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -356,7 +356,7 @@ mnstr_fsync(stream *s) if (s == NULL) return -1; #ifdef STREAM_DEBUG - printf(fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); + fprintf(stderr, fsync %s (%d)\n, s-name ? s-name : unnamed, s-errnr); #endif assert(s-access == ST_WRITE); if (s-errnr) @@ -372,7 +372,7 @@ mnstr_fgetpos(stream *s, lng *p) if (s == NULL || p == NULL)
MonetDB: geo - removed dead code
Changeset: 7b7d7d82797e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b7d7d82797e Modified Files: geom/monetdb5/geom.c Branch: geo Log Message: removed dead code (remains after removal of int2str() and its use) diffs (43 lines): diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c --- a/geom/monetdb5/geom.c +++ b/geom/monetdb5/geom.c @@ -1597,7 +1597,6 @@ static str dumpPointsPolygon(BAT* idBAT, const GEOSGeometry* exteriorRingGeometry; int numInteriorRings=0, i=0; str err; - char* lvlStr = NULL; int lvlDigitsNum = 10; //MAX_UNIT = 4,294,967,295 size_t pathLength = strlen(path); char* newPath = NULL; @@ -1619,7 +1618,6 @@ static str dumpPointsPolygon(BAT* idBAT, strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); //get the points in the exterior ring @@ -1648,7 +1646,6 @@ static str dumpPointsPolygon(BAT* idBAT, strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, *lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); if((err = dumpPointsLineString(idBAT, geomBAT, GEOSGetInteriorRingN(geosGeometry, i), newPath)) != MAL_SUCCEED) { str msg = createException(MAL, geom.DumpPoints, %s, err); @@ -1668,7 +1665,6 @@ static str dumpPointsMultiGeometry(BAT* const GEOSGeometry* multiGeometry = NULL; str err; unsigned int lvl = 0; - char* lvlStr = NULL; size_t pathLength = strlen(path); char* newPath = NULL; char* extraStr = ,; @@ -1686,7 +1682,6 @@ static str dumpPointsMultiGeometry(BAT* strcpy(newPath, path); lvlDigitsNum = sprintf(newPath+pathLength, %u, lvl); strcpy(newPath+pathLength+lvlDigitsNum, extraStr); - GDKfree(lvlStr); //*secondLevel = 0; if((err = dumpPointsGeometry(idBAT, geomBAT, multiGeometry, newPath)) != MAL_SUCCEED) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - When growing a string heap, don't double the ...
Changeset: 40911aac3b02 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=40911aac3b02 Modified Files: gdk/gdk_atoms.c Branch: Oct2014 Log Message: When growing a string heap, don't double the size always. We want to grow, but doubling the size eats up the address space too fast. diffs (15 lines): diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c --- a/gdk/gdk_atoms.c +++ b/gdk/gdk_atoms.c @@ -1116,7 +1116,10 @@ strPut(Heap *h, var_t *dst, const char * /* double the heap size until we have enough space */ do { - newsize = 1; + if (newsize 4 * 1024 * 1024) + newsize = 1; + else + newsize += 4 * 1024 * 1024; } while (newsize = h-free + pad + len + extralen); assert(newsize); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Remove unnecessary BATextend and erroneous as...
Changeset: 8948090c571c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8948090c571c Modified Files: sql/backends/monet5/sql_result.c Branch: Oct2014 Log Message: Remove unnecessary BATextend and erroneous assert. The BATextend can fail, and we want proper error handling if it does. Moreover, just a few lines lower we do another BATextend with proper error handling. diffs (15 lines): diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -730,11 +730,6 @@ mvc_import_table(Client cntxt, mvc *m, b if (locked) { BAT *b = store_funcs.bind_col(m-session-tr, col, RDONLY); - if (sz (lng) BATTINY) - b = BATextend(b, (BUN) sz); - - assert(b != NULL); - HASHdestroy(b); fmt[i].c = b; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2014 - Fix possible race condition.
Changeset: 35121caaf32d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=35121caaf32d Modified Files: gdk/gdk_system.c Branch: Oct2014 Log Message: Fix possible race condition. diffs (13 lines): diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -592,8 +592,8 @@ MT_create_thread(MT_Id *t, void (*f) (vo p-func = f; p-arg = arg; p-exited = 0; + pthread_mutex_lock(posthread_lock); p-next = posthreads; - pthread_mutex_lock(posthread_lock); posthreads = p; f = thread_starter; pthread_mutex_unlock(posthread_lock); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Oct2014 branch.
Changeset: e82c6b72d1c5 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e82c6b72d1c5 Modified Files: gdk/gdk_atoms.c gdk/gdk_system.c sql/backends/monet5/sql_result.c Branch: default Log Message: Merge with Oct2014 branch. diffs (43 lines): diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c --- a/gdk/gdk_atoms.c +++ b/gdk/gdk_atoms.c @@ -1196,7 +1196,10 @@ strPut(Heap *h, var_t *dst, const char * /* double the heap size until we have enough space */ do { - newsize = 1; + if (newsize 4 * 1024 * 1024) + newsize = 1; + else + newsize += 4 * 1024 * 1024; } while (newsize = h-free + pad + len + extralen); assert(newsize); diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -592,8 +592,8 @@ MT_create_thread(MT_Id *t, void (*f) (vo p-func = f; p-arg = arg; p-exited = 0; + pthread_mutex_lock(posthread_lock); p-next = posthreads; - pthread_mutex_lock(posthread_lock); posthreads = p; f = thread_starter; pthread_mutex_unlock(posthread_lock); diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -772,11 +772,6 @@ mvc_import_table(Client cntxt, mvc *m, b if (locked) { BAT *b = store_funcs.bind_col(m-session-tr, col, RDONLY); - if (sz (lng) BATTINY) - b = BATextend(b, (BUN) sz); - - assert(b != NULL); - HASHdestroy(b); fmt[i].c = b; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list