Changeset: cbd6a861ff57 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cbd6a861ff57
Branch: default
Log Message:
merged
diffs (truncated from 2834 to 300 lines):
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -225,7 +225,9 @@ log_write_format(logger *lg, logformat *
{
assert(data->id || data->flag);
assert(!lg->inmemory);
- if (mnstr_write(lg->current->output_log, &data->flag, 1, 1) == 1 &&
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR &&
+ mnstr_write(lg->current->output_log, &data->flag, 1, 1) == 1 &&
mnstr_writeInt(lg->current->output_log, data->id))
return GDK_SUCCEED;
TRC_CRITICAL(GDK, "write failed\n");
@@ -271,7 +273,9 @@ log_write_id(logger *lg, int id)
{
assert(!lg->inmemory);
assert(id >= 0);
- if (mnstr_writeInt(lg->current->output_log, id))
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR &&
+ mnstr_writeInt(lg->current->output_log, id))
return GDK_SUCCEED;
TRC_CRITICAL(GDK, "write failed\n");
return GDK_FAIL;
@@ -2373,7 +2377,12 @@ log_activate(logger *lg)
bool flush_cleanup = false;
gdk_return res = GDK_SUCCEED;
rotation_lock(lg);
- if (!lg->flushnow && !lg->current->next && lg->current->drops > 100000
&& (ulng) ATOMIC_GET(&lg->current->last_ts) > 0 && lg->saved_id+1 == lg->id &&
ATOMIC_GET(&lg->current->refcount) == 1 /* no pending work on this file */) {
+ if (!lg->flushnow &&
+ !lg->current->next &&
+ lg->current->drops > 100000 &&
+ (ulng) ATOMIC_GET(&lg->current->last_ts) > 0 &&
+ lg->saved_id + 1 == lg->id &&
+ ATOMIC_GET(&lg->current->refcount) == 1 /* no pending work on this
file */) {
lg->id++;
/* start new file */
res = log_open_output(lg);
@@ -2521,7 +2530,9 @@ log_constant(logger *lg, int type, ptr v
gdk_return (*wt) (const void *, stream *, size_t) =
BATatoms[type].atomWrite;
- if (log_write_format(lg, &l) != GDK_SUCCEED ||
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR ||
+ log_write_format(lg, &l) != GDK_SUCCEED ||
!mnstr_writeLng(lg->current->output_log, nr) ||
mnstr_write(lg->current->output_log, &tpe, 1, 1) != 1 ||
!mnstr_writeLng(lg->current->output_log, offset)) {
@@ -2552,6 +2563,9 @@ string_writer(logger *lg, BAT *b, lng of
if (!buf)
return GDK_FAIL;
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR)
+ return GDK_FAIL;
BATiter bi = bat_iterator(b);
BUN p = (BUN)offset;
for ( ; p < end; ) {
@@ -2579,7 +2593,9 @@ string_writer(logger *lg, BAT *b, lng of
sz += len;
}
}
- if (sz && (!mnstr_writeLng(lg->current->output_log, (lng) sz)
|| mnstr_write(lg->current->output_log, buf, sz, 1) != 1)) {
+ if (sz &&
+ (!mnstr_writeLng(lg->current->output_log, (lng) sz) ||
+ mnstr_write(lg->current->output_log, buf, sz, 1) != 1)) {
res = GDK_FAIL;
break;
}
@@ -2609,11 +2625,17 @@ internal_log_bat(logger *lg, BAT *b, log
gdk_return (*wt) (const void *, stream *, size_t) =
BATatoms[b->ttype].atomWrite;
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR) {
+ ok = GDK_FAIL;
+ goto bailout;
+ }
+
if (lg->total_cnt == 0) /* signals single bulk message or first part of
bat logged in parts */
if (log_write_format(lg, &l) != GDK_SUCCEED ||
- !mnstr_writeLng(lg->current->output_log,
total_cnt?total_cnt:cnt) ||
- mnstr_write(lg->current->output_log, &tpe, 1, 1) != 1 ||
- !mnstr_writeLng(lg->current->output_log,
total_cnt?-1:offset)) { /* offset = -1 indicates bat was logged in parts */
+ !mnstr_writeLng(lg->current->output_log,
total_cnt?total_cnt:cnt) ||
+ mnstr_write(lg->current->output_log, &tpe, 1, 1) != 1 ||
+ !mnstr_writeLng(lg->current->output_log,
total_cnt?-1:offset)) { /* offset = -1 indicates bat was logged in parts */
ok = GDK_FAIL;
goto bailout;
}
@@ -2696,7 +2718,9 @@ log_bat_persists(logger *lg, BAT *b, log
l.flag = LOG_CREATE;
l.id = id;
if (!LOG_DISABLED(lg)) {
- if (log_write_format(lg, &l) != GDK_SUCCEED ||
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR ||
+ log_write_format(lg, &l) != GDK_SUCCEED ||
mnstr_write(lg->current->output_log, &ta, 1, 1) != 1) {
log_unlock(lg);
ATOMIC_DEC(&lg->current->refcount);
@@ -2819,7 +2843,9 @@ log_delta(logger *lg, BAT *uid, BAT *uva
gdk_return (*wh) (const void *, stream *, size_t) =
BATatoms[TYPE_oid].atomWrite;
gdk_return (*wt) (const void *, stream *, size_t) =
BATatoms[uval->ttype].atomWrite;
- if (log_write_format(lg, &l) != GDK_SUCCEED ||
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR ||
+ log_write_format(lg, &l) != GDK_SUCCEED ||
!mnstr_writeLng(lg->current->output_log, nr) ||
mnstr_write(lg->current->output_log, &tpe, 1, 1) != 1){
ok = GDK_FAIL;
@@ -2874,6 +2900,8 @@ check_rotation_conditions(logger *lg) {
if (lg->current->next)
return false; /* do not rotate if there is already a prepared
next current */
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR)
+ return true;
const lng p = (lng) getfilepos(getFile(lg->current->output_log));
const lng log_large = (ATOMIC_GET(&GDKdebug) &
FORCEMITOMASK)?LOG_MINI:LOG_LARGE;
@@ -3004,7 +3032,9 @@ log_tsequence_(logger *lg, int seq, lng
TRC_DEBUG(WAL, "tsequence(%d," LLFMT ")\n", seq, val);
- if (log_write_format(lg, &l) != GDK_SUCCEED ||
+ assert(mnstr_errnr(lg->current->output_log) == MNSTR_NO__ERROR);
+ if (mnstr_errnr(lg->current->output_log) != MNSTR_NO__ERROR ||
+ log_write_format(lg, &l) != GDK_SUCCEED ||
!mnstr_writeLng(lg->current->output_log, val)) {
TRC_CRITICAL(GDK, "write failed\n");
ATOMIC_DEC(&lg->current->refcount);
diff --git a/geom/sql/functions/Tests/All b/geom/sql/functions/Tests/All
--- a/geom/sql/functions/Tests/All
+++ b/geom/sql/functions/Tests/All
@@ -3,15 +3,18 @@ HAVE_GEOM?loadTestWKT
HAVE_GEOM?ST_PointFromText
HAVE_GEOM?ST_LineFromText
HAVE_GEOM?ST_PolygonFromText
-HAVE_GEOM?ST_MPointFromText
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_MPointFromText
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_MPointFromText-3.12
HAVE_GEOM?ST_MLineFromText
HAVE_GEOM?ST_MPolygonFromText
-HAVE_GEOM?ST_GeomFromText
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_GeomFromText
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_GeomFromText-3.12
HAVE_GEOM?dropTestWKT
HAVE_GEOM?ST_MakePoint
-HAVE_GEOM?ST_Collect
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_Collect
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_Collect-3.12
HAVE_GEOM?ST_MakeLine
HAVE_GEOM?loadTestPolygons
HAVE_GEOM?ST_Intersects
@@ -24,38 +27,50 @@ HAVE_GEOM?ST_DWithinRTree
HAVE_GEOM?loadTestGeometries
-HAVE_GEOM?ST_GeometryType
-HAVE_GEOM?ST_AsText
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_GeometryType
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_GeometryType-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_AsText
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_AsText-3.12
-HAVE_GEOM?ST_IsClosed
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_IsClosed
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_IsClosed-3.12
HAVE_GEOM?ST_IsEmpty
-HAVE_GEOM?ST_IsSimple
-HAVE_GEOM?ST_IsValid
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_IsSimple
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_IsSimple-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_IsValid
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_IsValid-3.12
HAVE_GEOM?ST_IsRing
HAVE_GEOM?XYZ
HAVE_GEOM?XYZMinMax
#HAVE_GEOM?srid
-HAVE_GEOM?ST_GeometryN
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_GeometryN
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_GeometryN-3.12
HAVE_GEOM?ST_NumGeometries
HAVE_GEOM?ST_NumPoints
HAVE_GEOM?ST_NPoints
-HAVE_GEOM?ST_NumInteriorRings
-HAVE_GEOM?ST_NRings
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_NumInteriorRings
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_NumInteriorRings-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_NRings
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_NRings-3.12
#HAVE_GEOM?transform
-HAVE_GEOM?ST_Contains
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_Contains
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_Contains-3.12
#HAVE_GEOM?equals
-HAVE_GEOM&GEOS_VERSION>=3.11.1?ST_Boundary
+HAVE_GEOM&GEOS_VERSION>=3.11.1&!GEOS_VERSION>=3.12.0?ST_Boundary
+HAVE_GEOM&GEOS_VERSION>=3.11.1&GEOS_VERSION>=3.12.0?ST_Boundary-3.12
HAVE_GEOM?ST_Dimension
-HAVE_GEOM?ST_CoordDim
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_CoordDim
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_CoordDim-3.12
-HAVE_GEOM?ST_AsEWKT
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_AsEWKT
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_AsEWKT-3.12
#HAVE_GEOM?ST_Covers #Look at ST_Covers.sql for more details on the problem
#HAVE_GEOM?ST_CoveredBy #Look at ST_CoveredBy.sql for more details on the
problem
@@ -77,6 +92,7 @@ HAVE_GEOM?ST_MakeBox2D
HAVE_GEOM?dropTestGeometries
HAVE_GEOM?ST_DWithin2
-HAVE_GEOM?ST_Transform
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_Transform
+HAVE_GEOM&GEOS_VERSION>=3.12.0?ST_Transform-3.12
HAVE_GEOM?geomcasts
diff --git a/geom/sql/functions/Tests/ST_AsEWKT-3.12.reqtests
b/geom/sql/functions/Tests/ST_AsEWKT-3.12.reqtests
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_AsEWKT-3.12.reqtests
@@ -0,0 +1,1 @@
+loadTestGeometries
diff --git a/geom/sql/functions/Tests/ST_AsEWKT-3.12.test
b/geom/sql/functions/Tests/ST_AsEWKT-3.12.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_AsEWKT-3.12.test
@@ -0,0 +1,219 @@
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(10 10)'))
+----
+SRID:0;POINT (10 10)
+
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(20 20)', 4326))
+----
+SRID:4326;POINT (20 20)
+
+query T rowsort
+select st_asEWKT(st_pointfromtext('point(10 10 10)'))
+----
+SRID:0;POINT Z (10 10 10)
+
+query T rowsort
+select st_asEWKT(st_makepoint(10, 10))
+----
+SRID:0;POINT (10 10)
+
+query T rowsort
+select st_asEWKT(st_point(20, 20))
+----
+SRID:0;POINT (20 20)
+
+query T rowsort
+select st_asEWKT(st_makepoint(10, 10, 10))
+----
+SRID:0;POINT Z (10 10 10)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(10 10, 20 20, 30 30)'))
+----
+SRID:0;LINESTRING (10 10, 20 20, 30 30)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(20 20, 30 30, 40 40)', 4326))
+----
+SRID:4326;LINESTRING (20 20, 30 30, 40 40)
+
+query T rowsort
+select st_asEWKT(st_linefromtext('linestring(20 20 20, 30 30 30, 40 40 40)',
4326))
+----
+SRID:4326;LINESTRING Z (20 20 20, 30 30 30, 40 40 40)
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((10 10, 20 20, 30 30, 10 10))'))
+----
+SRID:0;POLYGON ((10 10, 20 20, 30 30, 10 10))
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((20 20, 30 30, 40 40, 20 20))',
4326))
+----
+SRID:4326;POLYGON ((20 20, 30 30, 40 40, 20 20))
+
+query T rowsort
+select st_asEWKT(st_polygonfromtext('polygon((10 10 10, 20 20 20, 30 30 30, 10
10 10))'))
+----
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]