MonetDB: default - Deal with version 3.12 of the geos library.

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: 85babf396b8f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/85babf396b8f
Added Files:
geom/sql/functions/Tests/ST_Collect-3.12.test
geom/sql/functions/Tests/ST_Transform-3.12.reqtests
geom/sql/functions/Tests/ST_Transform-3.12.test
Modified Files:
geom/sql/functions/Tests/All
Branch: default
Log Message:

Deal with version 3.12 of the geos library.


diffs (271 lines):

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
@@ -13,7 +13,8 @@ HAVE_GEOM_VERSION>=3.12.0?ST_GeomFr
 HAVE_GEOM?dropTestWKT
 
 HAVE_GEOM?ST_MakePoint
-HAVE_GEOM?ST_Collect
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_Collect
+HAVE_GEOM_VERSION>=3.12.0?ST_Collect-3.12
 HAVE_GEOM?ST_MakeLine
 HAVE_GEOM?loadTestPolygons
 HAVE_GEOM?ST_Intersects
@@ -91,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_VERSION>=3.12.0?ST_Transform-3.12
 
 HAVE_GEOM?geomcasts
diff --git a/geom/sql/functions/Tests/ST_Collect-3.12.test 
b/geom/sql/functions/Tests/ST_Collect-3.12.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_Collect-3.12.test
@@ -0,0 +1,185 @@
+# column aggregation
+
+## points
+query T rowsort
+SELECT
+ST_COLLECT(pts)
+FROM (
+VALUES
+(ST_GeomFromText('POINT(1 1)')),
+(ST_GeomFromText('POINT(2 2)'))
+) AS REL(pts)
+
+MULTIPOINT ((1 1), (2 2))
+
+## lines
+query T rowsort
+SELECT
+ST_COLLECT(lns)
+FROM (
+VALUES
+(ST_GeomFromText('LINESTRING(10 20, 30 40, 60 40, 10 20)')),
+(ST_GeomFromText('LINESTRING(10 10, 50 50)'))
+) AS REL(lns)
+
+MULTILINESTRING ((10 20, 30 40, 60 40, 10 20), (10 10, 50 50))
+
+## polygons
+query T rowsort
+SELECT
+ST_COLLECT(pgs)
+FROM (
+VALUES
+(ST_GeomFromText('POLYGON((10 10, 30 40, 50 50, 40 30, 10 10))')),
+(ST_GeomFromText('POLYGON( EMPTY )')),
+(ST_GeomFromText('POLYGON((30 30, 30 50, 50 30, 30 30))'))
+) AS REL(pgs)
+
+MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), EMPTY, ((30 30, 30 50, 50 
30, 30 30)))
+
+## multi-types
+query T rowsort
+SELECT
+ST_COLLECT(pgs)
+FROM (
+VALUES
+(ST_GeomFromText('MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), 
EMPTY, ((30 30, 30 50, 50 30, 30 30)))')),
+(ST_GeomFromText('MULTILINESTRING ((10 20, 30 40, 60 40, 10 20), (10 
10, 50 50))')),
+(ST_GeomFromText('POLYGON((30 30, 30 50, 50 30, 30 30))'))
+) AS REL(pgs)
+
+GEOMETRYCOLLECTION (MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), 
EMPTY, ((30 30, 30 50, 50 30, 30 30))), MULTILINESTRING ((10 20, 30 40, 60 40, 
10 20), (10 10, 50 50)), POLYGON ((30 30, 30 50, 50 30, 30 30)))
+
+query T rowsort
+SELECT
+ST_COLLECT(pgs)
+FROM (
+VALUES
+(ST_GeomFromText('MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), 
EMPTY, ((30 30, 30 50, 50 30, 30 30)))')),
+(ST_GeomFromText('MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 
10)))')),
+(ST_GeomFromText('MULTIPOLYGON( EMPTY )'))
+) AS REL(pgs)
+
+GEOMETRYCOLLECTION (MULTIPOLYGON (((10 10, 30 40, 50 50, 40 30, 10 10)), 
EMPTY, ((30 30, 30 50, 50 30, 30 30))), MULTIPOLYGON (((10 10, 30 40, 50 50, 40 
30, 10 10))), MULTIPOLYGON EMPTY)
+
+# per row aggregation
+
+## points-points
+query T rowsort
+SELECT
+ST_COLLECT(p1, p2) AS points
+FROM (
+VALUES
+(
+ST_GeomFromText('POINT(1 2)'),
+ST_GeomFromText('POINT(3 4)')
+),
+(
+ST_GeomFromText('POINT(10 20)'),
+ST_GeomFromText('POINT(30 40)')
+)
+) AS REL(p1, p2)
+
+MULTIPOINT ((1 2), (3 4))
+MULTIPOINT ((10 20), (30 40))
+
+## points-lines
+query T rowsort
+SELECT
+ST_COLLECT(p1, p2) AS points
+FROM (
+VALUES
+(
+ST_GeomFromText('POINT(1 2)'),
+ST_GeomFromText('LINESTRING(10 20, 30 40, 60 40, 10 20)')
+),
+(
+ST_GeomFromText('POINT(10 20)'),
+ST_GeomFromText('LINESTRING(10 10, 50 50)')
+)
+) AS REL(p1, p2)
+
+GEOMETRYCOLLECTION (POINT (1 2), LINESTRING (10 20, 30 40, 60 40, 10 20))
+GEOMETRYCOLLECTION (POINT (10 20), LINESTRING (10 10, 50 50))
+
+## points-polygons
+query T rowsort
+SELECT
+ST_COLLECT(p1, p2) AS points
+FROM (
+VALUES
+(
+ST_GeomFromText('POINT(1 2)'),
+ST_GeomFromText('POLYGON( EMPTY )')
+),
+(
+ST_GeomFromText('POINT(10 20)'),
+ST_GeomFromText('POLYGON((10 10, 30 40, 50 50, 40 30, 10 10))')
+)
+) AS REL(p1, p2)
+
+GEOMETRYCOLLECTION (POINT (1 2), POLYGON EMPTY)
+GEOMETRYCOLLECTION (POINT (10 20), POLYGON ((10 10, 30 40, 50 50, 40 30, 10 
10)))
+
+## lines-lines
+query T rowsort
+SELECT
+ST_COLLECT(p1, p2) AS points
+FROM (
+VALUES
+(
+ST_GeomFromText('LINESTRING(0 0, 30 30, 40 

MonetDB: default - Merge with Jun2023 branch.

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: 609009d02a6d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/609009d02a6d
Modified Files:
geom/sql/functions/Tests/All
sql/scripts/52_describe.sql
sql/storage/store.c
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Merge with Jun2023 branch.


diffs (truncated from 2569 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, >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, >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 > 10 
&& (ulng) ATOMIC_GET(>current->last_ts) > 0 && lg->saved_id+1 == lg->id && 
ATOMIC_GET(>current->refcount) == 1 /* no pending work on this file */) {
+   if (!lg->flushnow &&
+   !lg->current->next &&
+   lg->current->drops > 10 &&
+   (ulng) ATOMIC_GET(>current->last_ts) > 0 &&
+   lg->saved_id + 1 == lg->id &&
+   ATOMIC_GET(>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, ) != 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, ) != GDK_SUCCEED ||
!mnstr_writeLng(lg->current->output_log, nr) ||
mnstr_write(lg->current->output_log, , 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, ) != GDK_SUCCEED ||
-   !mnstr_writeLng(lg->current->output_log, 
total_cnt?total_cnt:cnt) ||
-   mnstr_write(lg->current->output_log, , 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, , 1, 1) != 

MonetDB: Jun2023 - Backed out changeset 1129290efb9c: we don't w...

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: afcc5016977e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/afcc5016977e
Modified Files:
sql/scripts/52_describe.sql
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/sql_dump/Tests/dump.test
Branch: Jun2023
Log Message:

Backed out changeset 1129290efb9c: we don't want the necessary upgrade code.


diffs (103 lines):

diff --git a/sql/scripts/52_describe.sql b/sql/scripts/52_describe.sql
--- a/sql/scripts/52_describe.sql
+++ b/sql/scripts/52_describe.sql
@@ -171,8 +171,7 @@ CREATE VIEW sys.describe_constraints AS
AND k.table_id = t.id
AND s.id = t.schema_id
AND t.system = FALSE
-   AND k.type in (0, 1)
-   ORDER BY k.name, kc.nr;
+   AND k.type in (0, 1);
 
 CREATE VIEW sys.describe_indices AS
WITH it (id, idx) AS (VALUES (0, 'INDEX'), (4, 'IMPRINTS INDEX'), (5, 
'ORDERED INDEX')) --UNIQUE INDEX wraps to INDEX.
diff --git a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test 
b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
--- a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
+++ b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
@@ -129,7 +129,7 @@ DEP_FUNC
 query TTT rowsort
 SELECT c.name, v.name, 'DEP_VIEW' from sys.columns as c, sys.tables as v, 
sys.dependencies as dep where c.id = dep.id AND v.id = dep.depend_id AND 
dep.depend_type = 5 AND v.type in (1, 11, 21, 31) order by c.name, v.name
 
-2292 values hashing to 4ee99a9b4d0f0c8db6376eb0be833f01
+2289 values hashing to e640ec7c86f357c8f9135af496fc3b2b
 
 query TTT rowsort
 SELECT c.name, k.name, 'DEP_KEY' from sys.columns as c,  sys.objects as kc, 
sys.keys as k where kc."name" = c.name AND kc.id = k.id AND k.table_id = 
c.table_id AND k.rkey = -1 order by c.name, k.name
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -482,7 +482,7 @@ select 'null in fkeys.delete_action', de
 [ "sys._tables",   "sys",  "dependency_views_on_views","create view 
sys.dependency_views_on_views as select v1.schema_id as view1_schema_id, v1.id 
as view1_id, v1.name as view1_name, v2.schema_id as view2_schema_id, v2.id as 
view2_id, v2.name as view2_name, dep.depend_type as depend_type from sys.tables 
as v1, sys.tables as v2, sys.dependencies as dep where v1.id = dep.id and v2.id 
= dep.depend_id and dep.depend_type = 5 and v1.type in (1, 11) and v2.type in 
(1, 11) order by v1.schema_id, v1.name, v2.schema_id, v2.name;","VIEW", 
true,   "COMMIT",   "WRITABLE", NULL]
 [ "sys._tables",   "sys",  "describe_column_defaults", "create view 
sys.describe_column_defaults as select s.name sch, t.name tbl, c.name col, 
c.\"default\" def from sys.schemas s, sys.tables t, sys.columns c where s.id = 
t.schema_id and t.id = c.table_id and s.name <> 'tmp' and not t.system and 
c.\"default\" is not null;",  "VIEW", true,   "COMMIT",   "WRITABLE", 
NULL]
 [ "sys._tables",   "sys",  "describe_comments","create view 
sys.describe_comments as select o.id id, o.tpe tpe, o.nme fqn, c.remark rem 
from (select id, 'SCHEMA', sys.dq(name) from sys.schemas union all select t.id, 
ifthenelse(ts.table_type_name = 'VIEW', 'VIEW', 'TABLE'), sys.fqn(s.name, 
t.name) from sys.schemas s join sys.tables t on s.id = t.schema_id join 
sys.table_types ts on t.type = ts.table_type_id where s.name <> 'tmp' union all 
select c.id, 'COLUMN', sys.fqn(s.name, t.name) || '.' || sys.dq(c.name) from 
sys.columns c, sys.tables t, sys.schemas s where c.table_id = t.id and 
t.schema_id = s.id union all select idx.id, 'INDEX', sys.fqn(s.name, idx.name) 
from sys.idxs idx, sys._tables t, sys.schemas s where idx.table_id = t.id and 
t.schema_id = s.id union all select seq.id, 'SEQUENCE', sys.fqn(s.name, 
seq.name) from sys.sequences seq, sys.schemas s where seq.schema_id = s.id 
union all select f.id, ft.function_type_keyword, qf.nme from sys.functions f, 
sys.function_types ft, sys.
 schemas s, sys.fully_qualified_functions qf where f.type = ft.function_type_id 
and f.schema_id = s.id and qf.id = f.id) as o(id, tpe, nme) join sys.comments c 
on c.id = o.id;",   "VIEW", true,   "COMMIT",   "WRITABLE", NULL
]
-[ "sys._tables",   "sys",  "describe_constraints", "create view 
sys.describe_constraints as select s.name sch, t.name tbl, kc.name col, k.name 
con, case k.type when 0 then 'PRIMARY KEY' when 1 then 'UNIQUE' end tpe from 
sys.schemas s, sys._tables t, sys.objects kc, sys.keys k where kc.id = k.id and 
k.table_id = t.id and s.id = t.schema_id and t.system = false and k.type in (0, 
1) order by k.name, kc.nr;",   "VIEW", true,   "COMMIT",   "WRITABLE",

MonetDB: Jun2023 - Deal with version 3.12 of the geos library.

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: 9476815fdb6a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9476815fdb6a
Added Files:
geom/sql/functions/Tests/ST_AsEWKT-3.12.reqtests
geom/sql/functions/Tests/ST_AsEWKT-3.12.test
geom/sql/functions/Tests/ST_AsText-3.12.reqtests
geom/sql/functions/Tests/ST_AsText-3.12.test
geom/sql/functions/Tests/ST_Boundary-3.12.reqtests
geom/sql/functions/Tests/ST_Boundary-3.12.test
geom/sql/functions/Tests/ST_Contains-3.12.reqtests
geom/sql/functions/Tests/ST_Contains-3.12.test
geom/sql/functions/Tests/ST_CoordDim-3.12.reqtests
geom/sql/functions/Tests/ST_CoordDim-3.12.test
geom/sql/functions/Tests/ST_GeomFromText-3.12.reqtests
geom/sql/functions/Tests/ST_GeomFromText-3.12.test
geom/sql/functions/Tests/ST_GeometryN-3.12.reqtests
geom/sql/functions/Tests/ST_GeometryN-3.12.test
geom/sql/functions/Tests/ST_GeometryType-3.12.reqtests
geom/sql/functions/Tests/ST_GeometryType-3.12.test
geom/sql/functions/Tests/ST_IsClosed-3.12.reqtests
geom/sql/functions/Tests/ST_IsClosed-3.12.test
geom/sql/functions/Tests/ST_IsSimple-3.12.reqtests
geom/sql/functions/Tests/ST_IsSimple-3.12.test
geom/sql/functions/Tests/ST_IsValid-3.12.reqtests
geom/sql/functions/Tests/ST_IsValid-3.12.test
geom/sql/functions/Tests/ST_MPointFromText-3.12.reqtests
geom/sql/functions/Tests/ST_MPointFromText-3.12.test
geom/sql/functions/Tests/ST_NRings-3.12.reqtests
geom/sql/functions/Tests/ST_NRings-3.12.test
geom/sql/functions/Tests/ST_NumInteriorRings-3.12.reqtests
geom/sql/functions/Tests/ST_NumInteriorRings-3.12.test
geom/sql/pg_regression/Tests/boundary-3.12.test
Modified Files:
geom/sql/functions/Tests/All
geom/sql/pg_regression/Tests/All
sql/test/testdb-previous-upgrade-chain-hge/Tests/All
sql/test/testdb-previous-upgrade-chain/Tests/All
sql/test/testdb-previous-upgrade-hge/Tests/All
sql/test/testdb-previous-upgrade/Tests/All
sql/test/testdb-upgrade-chain-hge/Tests/All
sql/test/testdb-upgrade-chain/Tests/All
sql/test/testdb-upgrade-hge/Tests/All
sql/test/testdb-upgrade/Tests/All
sql/test/testdb/Tests/All
Branch: Jun2023
Log Message:

Deal with version 3.12 of the geos library.


diffs (truncated from 2132 to 300 lines):

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,10 +3,12 @@ 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_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_VERSION>=3.12.0?ST_GeomFromText-3.12
 
 HAVE_GEOM?dropTestWKT
 
@@ -15,38 +17,50 @@ HAVE_GEOM?ST_MakePoint
 HAVE_GEOM?loadTestGeometries
 
 
-HAVE_GEOM?ST_GeometryType
-HAVE_GEOM?ST_AsText
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_GeometryType
+HAVE_GEOM_VERSION>=3.12.0?ST_GeometryType-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_AsText
+HAVE_GEOM_VERSION>=3.12.0?ST_AsText-3.12
 
-HAVE_GEOM?ST_IsClosed
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_IsClosed
+HAVE_GEOM_VERSION>=3.12.0?ST_IsClosed-3.12
 HAVE_GEOM?ST_IsEmpty
-HAVE_GEOM_VERSION>=3.8?ST_IsSimple
-HAVE_GEOM?ST_IsValid
+HAVE_GEOM_VERSION>=3.8&!GEOS_VERSION>=3.12.0?ST_IsSimple
+HAVE_GEOM_VERSION>=3.8_VERSION>=3.12.0?ST_IsSimple-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_IsValid
+HAVE_GEOM_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_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_VERSION>=3.12.0?ST_NumInteriorRings-3.12
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_NRings
+HAVE_GEOM_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_VERSION>=3.12.0?ST_Contains-3.12
 
 #HAVE_GEOM?equals
 
-HAVE_GEOM_VERSION>=3.11.1?ST_Boundary
+HAVE_GEOM_VERSION>=3.11.1&!GEOS_VERSION>=3.12.0?ST_Boundary
+HAVE_GEOM_VERSION>=3.11.1_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_VERSION>=3.12.0?ST_CoordDim-3.12
 
-HAVE_GEOM?ST_AsEWKT
+HAVE_GEOM&!GEOS_VERSION>=3.12.0?ST_AsEWKT
+HAVE_GEOM_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

MonetDB: Jun2023 - Fix negated version test.

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: 8e87d6376494 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8e87d6376494
Modified Files:
testing/Mtest.py.in
Branch: Jun2023
Log Message:

Fix negated version test.


diffs (22 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2047,6 +2047,8 @@ def RunTest(env, TST, COND, oktests, len
 else:
 for i in range(len(geos_version)):
 if i >= len(req_vers):
+reason = "geos version too high"
+elem = SkipTest(env, TST, EXT, reason, length)
 break
 if int(geos_version[i]) < int(req_vers[i]):
 break
@@ -2054,6 +2056,9 @@ def RunTest(env, TST, COND, oktests, len
 reason = "geos version too high"
 elem = SkipTest(env, TST, EXT, reason, length)
 break
+else:
+reason = "geos version too high"
+elem = SkipTest(env, TST, EXT, reason, length)
 if reason is not None:
 break
 elif cond.startswith('R_VERSION>='):
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jun2023 - add order by on describe_constraints

2023-07-28 Thread Niels Nes via checkin-list
Changeset: 1129290efb9c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1129290efb9c
Modified Files:
sql/scripts/52_describe.sql
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/sql_dump/Tests/dump.test
Branch: Jun2023
Log Message:

add order by on describe_constraints


diffs (103 lines):

diff --git a/sql/scripts/52_describe.sql b/sql/scripts/52_describe.sql
--- a/sql/scripts/52_describe.sql
+++ b/sql/scripts/52_describe.sql
@@ -171,7 +171,8 @@ CREATE VIEW sys.describe_constraints AS
AND k.table_id = t.id
AND s.id = t.schema_id
AND t.system = FALSE
-   AND k.type in (0, 1);
+   AND k.type in (0, 1)
+   ORDER BY k.name, kc.nr;
 
 CREATE VIEW sys.describe_indices AS
WITH it (id, idx) AS (VALUES (0, 'INDEX'), (4, 'IMPRINTS INDEX'), (5, 
'ORDERED INDEX')) --UNIQUE INDEX wraps to INDEX.
diff --git a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test 
b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
--- a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
+++ b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
@@ -129,7 +129,7 @@ DEP_FUNC
 query TTT rowsort
 SELECT c.name, v.name, 'DEP_VIEW' from sys.columns as c, sys.tables as v, 
sys.dependencies as dep where c.id = dep.id AND v.id = dep.depend_id AND 
dep.depend_type = 5 AND v.type in (1, 11, 21, 31) order by c.name, v.name
 
-2289 values hashing to e640ec7c86f357c8f9135af496fc3b2b
+2292 values hashing to 4ee99a9b4d0f0c8db6376eb0be833f01
 
 query TTT rowsort
 SELECT c.name, k.name, 'DEP_KEY' from sys.columns as c,  sys.objects as kc, 
sys.keys as k where kc."name" = c.name AND kc.id = k.id AND k.table_id = 
c.table_id AND k.rkey = -1 order by c.name, k.name
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -482,7 +482,7 @@ select 'null in fkeys.delete_action', de
 [ "sys._tables",   "sys",  "dependency_views_on_views","create view 
sys.dependency_views_on_views as select v1.schema_id as view1_schema_id, v1.id 
as view1_id, v1.name as view1_name, v2.schema_id as view2_schema_id, v2.id as 
view2_id, v2.name as view2_name, dep.depend_type as depend_type from sys.tables 
as v1, sys.tables as v2, sys.dependencies as dep where v1.id = dep.id and v2.id 
= dep.depend_id and dep.depend_type = 5 and v1.type in (1, 11) and v2.type in 
(1, 11) order by v1.schema_id, v1.name, v2.schema_id, v2.name;","VIEW", 
true,   "COMMIT",   "WRITABLE", NULL]
 [ "sys._tables",   "sys",  "describe_column_defaults", "create view 
sys.describe_column_defaults as select s.name sch, t.name tbl, c.name col, 
c.\"default\" def from sys.schemas s, sys.tables t, sys.columns c where s.id = 
t.schema_id and t.id = c.table_id and s.name <> 'tmp' and not t.system and 
c.\"default\" is not null;",  "VIEW", true,   "COMMIT",   "WRITABLE", 
NULL]
 [ "sys._tables",   "sys",  "describe_comments","create view 
sys.describe_comments as select o.id id, o.tpe tpe, o.nme fqn, c.remark rem 
from (select id, 'SCHEMA', sys.dq(name) from sys.schemas union all select t.id, 
ifthenelse(ts.table_type_name = 'VIEW', 'VIEW', 'TABLE'), sys.fqn(s.name, 
t.name) from sys.schemas s join sys.tables t on s.id = t.schema_id join 
sys.table_types ts on t.type = ts.table_type_id where s.name <> 'tmp' union all 
select c.id, 'COLUMN', sys.fqn(s.name, t.name) || '.' || sys.dq(c.name) from 
sys.columns c, sys.tables t, sys.schemas s where c.table_id = t.id and 
t.schema_id = s.id union all select idx.id, 'INDEX', sys.fqn(s.name, idx.name) 
from sys.idxs idx, sys._tables t, sys.schemas s where idx.table_id = t.id and 
t.schema_id = s.id union all select seq.id, 'SEQUENCE', sys.fqn(s.name, 
seq.name) from sys.sequences seq, sys.schemas s where seq.schema_id = s.id 
union all select f.id, ft.function_type_keyword, qf.nme from sys.functions f, 
sys.function_types ft, sys.
 schemas s, sys.fully_qualified_functions qf where f.type = ft.function_type_id 
and f.schema_id = s.id and qf.id = f.id) as o(id, tpe, nme) join sys.comments c 
on c.id = o.id;",   "VIEW", true,   "COMMIT",   "WRITABLE", NULL
]
-[ "sys._tables",   "sys",  "describe_constraints", "create view 
sys.describe_constraints as select s.name sch, t.name tbl, kc.name col, k.name 
con, case k.type when 0 then 'PRIMARY KEY' when 1 then 'UNIQUE' end tpe from 
sys.schemas s, sys._tables t, sys.objects kc, sys.keys k where kc.id = k.id and 
k.table_id = t.id and s.id = t.schema_id and t.system = false and k.type in (0, 
1);",  "VIEW", true,   "COMMIT",   "WRITABLE", NULL]
+[ "sys._tables",   "sys",  

MonetDB: Jun2023 - Make sure we don't write to a WAL file after ...

2023-07-28 Thread Sjoerd Mullender via checkin-list
Changeset: 92bd79411168 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/92bd79411168
Modified Files:
gdk/gdk_logger.c
Branch: Jun2023
Log Message:

Make sure we don't write to a WAL file after an earlier write failed.
Also, a write failure is a reason to rotate the log files.


diffs (134 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, >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, >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 > 10 
&& (ulng) ATOMIC_GET(>current->last_ts) > 0 && lg->saved_id+1 == lg->id && 
ATOMIC_GET(>current->refcount) == 1 /* no pending work on this file */) {
+   if (!lg->flushnow &&
+   !lg->current->next &&
+   lg->current->drops > 10 &&
+   (ulng) ATOMIC_GET(>current->last_ts) > 0 &&
+   lg->saved_id + 1 == lg->id &&
+   ATOMIC_GET(>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, ) != 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, ) != GDK_SUCCEED ||
!mnstr_writeLng(lg->current->output_log, nr) ||
mnstr_write(lg->current->output_log, , 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, ) != GDK_SUCCEED ||
-   !mnstr_writeLng(lg->current->output_log, 
total_cnt?total_cnt:cnt) ||
-   mnstr_write(lg->current->output_log, , 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, , 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;