MonetDB: Dec2023 - Approve 64 bit upgrade.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: f824abac8ddc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f824abac8ddc
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: Dec2023
Log Message:

Approve 64 bit upgrade.


diffs (32 lines):

diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
@@ -0,0 +1,4 @@
+Running database upgrade commands:
+delete from sys.dependencies where (id, depend_id) in (select c.id, f.id from 
sys.functions f, sys._tables t, sys._columns c, sys.dependencies d where 
c.table_id = t.id and f.id = d.depend_id and c.id = d.id and f.schema_id = 2000 
and t.schema_id = 2000 and (f.name, t.name, c.name) in (values 
('describe_columns', '_columns', 'storage'), ('describe_function', 
'function_languages', 'language_name'), ('describe_function', 'function_types', 
'function_type_name'), ('describe_function', 'functions', 'func'), 
('describe_function', 'functions', 'mod'), ('describe_function', 'functions', 
'semantics'), ('describe_function', 'functions', 'side_effect'), 
('describe_function', 'functions', 'system'), ('describe_function', 
'functions', 'vararg'), ('describe_function', 'functions', 'varres'), 
('describe_function', 'schemas', 'authorization'), ('describe_function', 
'schemas', 'owner'), ('describe_function', 'schemas', 'system'), 
('describe_table', '_tables', 'access'), ('describe_table', '_tables',
  'commit_action'), ('describe_table', '_tables', 'system')));
+delete from sys.dependencies where (id, depend_id) in (select c.id, v.id from 
sys._tables v, sys._tables t, sys._columns c, sys.dependencies d where 
c.table_id = t.id and v.id = d.depend_id and c.id = d.id and v.schema_id = 2000 
and t.schema_id = 2000 and (v.name, t.name, c.name) in (values 
('dependency_columns_on_indexes', '_columns', 'name'), 
('dependency_columns_on_indexes', '_columns', 'number'), 
('dependency_columns_on_indexes', '_columns', 'storage'), 
('dependency_columns_on_indexes', '_columns', 'table_id'), 
('dependency_columns_on_indexes', '_columns', 'type_digits'), 
('dependency_columns_on_indexes', 'keys', 'id'), 
('dependency_columns_on_indexes', 'triggers', 'name'), 
('dependency_columns_on_indexes', 'triggers', 'orientation'), 
('dependency_columns_on_indexes', 'triggers', 'table_id'), 
('dependency_columns_on_indexes', 'triggers', 'time'), 
('dependency_columns_on_keys', '_columns', 'name'), 
('dependency_columns_on_keys', '_columns', 'table_id'), 
('dependency_columns_on_ke
 ys', '_columns', 'type'), ('dependency_columns_on_keys', '_columns', 
'type_digits'), ('dependency_columns_on_keys', '_columns', 'type_scale'), 
('dependency_columns_on_keys', 'triggers', 'name'), 
('dependency_columns_on_keys', 'triggers', 'orientation'), 
('dependency_columns_on_keys', 'triggers', 'table_id'), 
('dependency_columns_on_keys', 'triggers', 'time'), 
('dependency_columns_on_triggers', 'keys', 'name'), 
('dependency_columns_on_triggers', 'keys', 'rkey'), 
('dependency_columns_on_triggers', 'keys', 'type'), 
('dependency_functions_on_triggers', 'keys', 'action'), 
('dependency_functions_on_triggers', 'keys', 'name'), 
('dependency_functions_on_triggers', 'keys', 'rkey'), 
('dependency_functions_on_triggers', 'keys', 'type'), 
('dependency_keys_on_foreignkeys', '_columns', 'default'), 
('dependency_keys_on_foreignkeys', '_columns', 'name'), 
('dependency_keys_on_foreignkeys', '_columns', 'table_id'), 
('dependency_keys_on_foreignkeys', '_columns', 'type'), 
('dependency_keys_on_foreignke
 ys', '_columns', 'type_digits'), ('dependency_keys_on_foreignkeys', 
'_columns', 'type_scale'), ('dependency_tables_on_foreignkeys', '_columns', 
'default'), ('dependency_tables_on_foreignkeys', '_columns', 'name'), 
('dependency_tables_on_foreignkeys', '_columns', 'table_id'), 
('dependency_tables_on_foreignkeys', '_columns', 'type'), 
('dependency_tables_on_foreignkeys', '_columns', 'type_digits'), 
('dependency_tables_on_foreignkeys', '_columns', 'type_scale'), 
('dependency_tables_on_indexes', '_columns', 'name'), 
('dependency_tables_on_indexes', '_columns', 'number'), 
('dependency_tables_on_indexes', '_columns', 'storage'), 
('dependency_tables_on_indexes', '_columns', 'table_id'), 
('dependency_tables_on_indexes', '_columns', 'type_digits'), 
('dependency_tables_on_indexes', 'keys', 'id'), 
('dependency_tables_on_triggers', 'keys', 'action'), 
('dependency_tables_on_triggers', 'keys', 'name'), 
('dependency_tables_on_triggers', 'keys', 'rkey'), 
('dependency_tables_on_triggers', 'keys', 'ty
 pe')));
+
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/emptyd

MonetDB: default - Merge with Dec2023 branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: d5c90fe141d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d5c90fe141d5
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: default
Log Message:

Merge with Dec2023 branch.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Merge with default branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: a3396b4096a6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a3396b4096a6
Modified Files:
gdk/gdk.h
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 1876 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Wed May  8 2024 Sjoerd Mullender 
+- Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
+  names have been changed to plain monetdb, and libmonetdb5-server-*
+  packages have been renamed monetdb-*.
+- The names of some of the provided RPM files have been changed.
+  References to the old MonetDB5 name have been removed.  All packages
+  are now just MonetDB.
+
+* Wed May  8 2024 Niels Nes 
+- Add support for select exp, count(*) group by 1 order by 1; ie. using
+  numeric references Added support for group by all and order by all. The
+  later is ordering on all columns of the selection.  The group by all
+  finds all expressions from the selections which aren't aggregations
+  and groups on those.  All can also be replaced by '*'.
+
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -57,7 +57,7 @@
 # available.  However, the geos library is available in the Extra
 # Packages for Enterprise Linux (EPEL).
 %if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8)
-# By default create the MonetDB-geom-MonetDB5 package on Fedora and RHEL 7
+# By default create the MonetDB-geom package on Fedora and RHEL 7
 %bcond_without geos
 %endif
 
@@ -154,8 +154,8 @@ BuildRequires: pkgconfig(libR)
 # BuildRequires: pkgconfig(valgrind)# -DWITH_VALGRIND=ON
 
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 Suggests: %{name}-client%{?_isa} = %{version}-%{release}
 %endif
 
@@ -167,8 +167,8 @@ accelerators.  It also has an SQL front 
 
 This package contains the core components of MonetDB in the form of a
 single shared library.  If you want to use MonetDB, you will certainly
-need this package, but you will also need at least the MonetDB5-server
-package, and most likely also %{name}-SQL-server5, as well as one or
+need this package, but you will also need at least the %{name}-server
+package, and most likely also %{name}-SQL, as well as one or
 more client packages.
 
 %ldconfig_scriptlets
@@ -254,8 +254,8 @@ library.
 Summary: MonetDB - Monet Database Management System Client Programs
 Group: Applications/Databases
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client-lib
@@ -280,8 +280,8 @@ Summary: MonetDB - Monet Database Manage
 Group: Applications/Databases
 Requires: %{name}-client-lib%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client
@@ -368,14 +368,14 @@ fi
 %package client-tests
 Summary: MonetDB Client tests package
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
 Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
 %endif
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7
 Recommends: python3dist(lz4)
 Recommends: python3dist(scipy)
@@ -414,21 +414,24 @@ developer.
 %{_bindir}/sqlsample.pl
 
 %if %{with geos}
-%package geom-MonetDB5
-Summary: MonetDB5 SQL GIS support module
+%package geom
+Summary: SQL GIS support module for MonetDB
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Obsoletes: MonetDB-geom-MonetDB5 < 11.50.0
+Provides: %{name}-geom-MonetDB5 = %{version}-%{release}
+Provides: %{name}-geom-MonetDB5%{?_isa} = %{version}-%{release}
 
-%description geom-MonetDB5
+%description geom
 MonetDB is a database management system that is developed from a
 main-memory perspective with use of a fully decomposed storage model,
 automatic index management, extensibility of data types and search
 accelerators.  It also has an SQL front end.
 
 This package contains the GIS (Geographic Info

MonetDB: ascii-flag - Merge with default branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 48157ba5cd44 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/48157ba5cd44
Modified Files:
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 2231 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -826,3 +826,4 @@ dcc8c702e685a4faf21ccf663028d1bc3d1165d1
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
 9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_9
+9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_SP3_release
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # This file is updated with Maddlog
 
 * Wed May  8 2024 Sjoerd Mullender 
+- The shared library (.dll aka .so files) now have the version number
+  as part of the name.  This should allow the building of compatibility
+  versions that can be installed in parallel to the latest version.
 - Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
   names have been changed to plain monetdb, and libmonetdb5-server-*
   packages have been renamed monetdb-*.
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -176,7 +176,7 @@ more client packages.
 %files
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libbat.so.*
+%{_libdir}/libbat*.so.*
 
 %package devel
 Summary: MonetDB development files
@@ -202,7 +202,7 @@ functionality of MonetDB.
 %{_includedir}/monetdb/mstring.h
 %exclude %{_includedir}/monetdb/monetdbe.h
 %{_includedir}/monetdb/monet*.h
-%{_libdir}/libbat.so
+%{_libdir}/libbat*.so
 %{_libdir}/pkgconfig/monetdb-gdk.pc
 
 %package stream
@@ -223,7 +223,7 @@ various other components.
 %files stream
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libstream.so.*
+%{_libdir}/libstream*.so.*
 
 %package stream-devel
 Summary: MonetDB stream library
@@ -245,7 +245,7 @@ library.
 %files stream-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libstream.so
+%{_libdir}/libstream*.so
 %{_includedir}/monetdb/stream.h
 %{_includedir}/monetdb/stream_socket.h
 %{_libdir}/pkgconfig/monetdb-stream.pc
@@ -273,7 +273,7 @@ you will very likely need this package.
 %files client-lib
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libmapi.so.*
+%{_libdir}/libmapi*.so.*
 
 %package client
 Summary: MonetDB - Monet Database Management System Client Programs
@@ -298,8 +298,8 @@ MonetDB, you will very likely need this 
 %files client
 %license COPYING
 %defattr(-,root,root)
-%{_bindir}/mclient
-%{_bindir}/msqldump
+%{_bindir}/mclient*
+%{_bindir}/msqldump*
 %{_mandir}/man1/mclient.1*
 %{_mandir}/man1/msqldump.1*
 
@@ -321,7 +321,7 @@ This package contains the files needed t
 %files client-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libmapi.so
+%{_libdir}/libmapi*.so
 %{_includedir}/monetdb/mapi*.h
 %{_includedir}/monetdb/msettings.h
 %{_libdir}/pkgconfig/monetdb-mapi.pc
@@ -433,7 +433,7 @@ extensions for %{name}-server.
 
 %files geom
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_geom.so
+%{_libdir}/monetdb5*/lib_geom.so
 %endif
 
 %if %{with rintegration}
@@ -457,8 +457,8 @@ install it.
 
 %files R
 %defattr(-,root,root)
-%{_libdir}/monetdb5/rapi.R
-%{_libdir}/monetdb5/lib_rapi.so
+%{_libdir}/monetdb5*/rapi.R
+%{_libdir}/monetdb5*/lib_rapi.so
 %endif
 
 %if %{with py3integration}
@@ -483,7 +483,7 @@ install it.
 
 %files python3
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_pyapi3.so
+%{_libdir}/monetdb5*/lib_pyapi3.so
 %endif
 
 %if %{with fits}
@@ -503,7 +503,7 @@ format.
 
 %files cfitsio
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_fits.so
+%{_libdir}/monetdb5*/lib_fits.so
 %endif
 
 %package libs
@@ -528,14 +528,14 @@ embedded library (%{name}-embedded).
 
 %files libs
 %defattr(-,root,root)
-%{_libdir}/libmonetdb5.so.*
-%{_libdir}/libmonetdbsql.so*
-%dir %{_libdir}/monetdb5
+%{_libdir}/libmonetdb5*.so.*
+%{_libdir}/libmonetdbsql*.so*
+%dir %{_libdir}/monetdb5%{version}
 %if %{with cintegration}
-%{_libdir}/monetdb5/lib_capi.so
+%{_libdir}/monetdb5*/lib_capi.so
 %endif
-%{_libdir}/monetdb5/lib_csv.so
-%{_libdir}/monetdb5/lib_generator.so
+%{_libdir}/monetdb5*/lib_csv.so
+%{_libdir}/monetdb5*/lib_generator.so
 
 %package server
 Summary: MonetDB - Monet Database Management System
@@ -590,7 +590,7 @@ exit 0
 %attr(2750,monetdb,monetdb) %dir %{_localstatedir}/lib/monetdb
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5/dbfarm
-%{_bindir}/mserver5
+%{_bindir}/mserver5*
 %{_mandir}/man1/mserver5.1*
 %dir %{_datadir}/doc/MonetDB
 %docdir %{_datadir}/doc/MonetDB
@@ -618,7 +618,7 @@ used from the MAL level.
 %defattr(-,root,root)
 %{_includedir}/monetdb/mal*.h
 %{_includedir}/monetdb/mel.h
-%{_libdir}/libmonetdb5.so
+%{_libdir}/libmonetdb5*.so
 %{_libdir}/pkgconfig/monetdb5.pc
 
 %package SQL
@@ -653,8 +653,7 @@ configuration.
 
 %files

MonetDB: default - Merge branch ascii-flag into default.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 3b2c82d4448b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b2c82d4448b
Branch: default
Log Message:

Merge branch ascii-flag into default.


diffs (truncated from 19798 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -34319,6 +34319,16 @@ pattern batstr.asciify(X_0:bat[:str], X_
 BATSTRasciify;
 Transform BAT of strings from UTF8 to ASCII
 batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
 contains
 pattern batstr.contains(X_0:bat[:str], X_1:bat[:str]):bat[:bit]
 BATSTRcontains;
@@ -50299,6 +50309,11 @@ command str.asciify(X_0:str):str
 STRasciify;
 Transform string from UTF8 to ASCII
 str
+caseFold
+command str.caseFold(X_0:str):str
+STRcasefold;
+Fold the case of a string.
+str
 contains
 pattern str.contains(X_0:str, X_1:str):bit
 STRcontains;
@@ -50379,11 +50394,6 @@ pattern str.endswithselect(X_0:bat[:str]
 STRendswithselect;
 Select all head values of the first input BAT for which the@tail value end 
with the given suffix + icase.
 str
-epilogue
-command str.epilogue():void
-STRepilogue;
-(empty)
-str
 insert
 command str.insert(X_0:str, X_1:int, X_2:int, X_3:str):str
 STRinsert;
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -25409,6 +25409,16 @@ pattern batstr.asciify(X_0:bat[:str], X_
 BATSTRasciify;
 Transform BAT of strings from UTF8 to ASCII
 batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
 contains
 pattern batstr.contains(X_0:bat[:str], X_1:bat[:str]):bat[:bit]
 BATSTRcontains;
@@ -38664,6 +38674,11 @@ command str.asciify(X_0:str):str
 STRasciify;
 Transform string from UTF8 to ASCII
 str
+caseFold
+command str.caseFold(X_0:str):str
+STRcasefold;
+Fold the case of a string.
+str
 contains
 pattern str.contains(X_0:str, X_1:str):bit
 STRcontains;
@@ -38744,11 +38759,6 @@ pattern str.endswithselect(X_0:bat[:str]
 STRendswithselect;
 Select all head values of the first input BAT for which the@tail value end 
with the given suffix + icase.
 str
-epilogue
-command str.epilogue():void
-STRepilogue;
-(empty)
-str
 insert
 command str.insert(X_0:str, X_1:int, X_2:int, X_3:str):str
 STRinsert;
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
@@ -16,6 +16,7 @@ BAT *BATallnotequal_grp2(BAT *l, BAT *r,
 BAT *BATanyequal_grp(BAT *l, BAT *r, BAT *g, BAT *e, BAT *s);
 BAT *BATanyequal_grp2(BAT *l, BAT *r, BAT *rid, BAT *g, BAT *e, BAT *s);
 gdk_return BATappend(BAT *b, BAT *n, BAT *s, bool force) 
__attribute__((__warn_unused_result__));
+BAT *BATasciify(BAT *b, BAT *s);
 void BATassertProps(BAT *b);
 atomDesc BATatoms[MAXATOMS];
 BAT *BATattach(int tt, const char *heapfile, role_t role);
@@ -108,6 +109,7 @@ dbl BATcalcvariance_population(dbl *avgp
 dbl BATcalcvariance_sample(dbl *avgp, BAT *b);
 BAT *BATcalcxor(BAT *b1, BAT *b2, BAT *s1, BAT *s2);
 BAT *BATcalcxorcst(BAT *b, const ValRecord *v, BAT *s);
+BAT *BATcasefold(BAT *b, BAT *s);
 bool BATcheckorderidx(BAT *b);
 gdk_return BATclear(BAT *b, bool force);
 void BATcommit(BAT *b, BUN size);
@@ -204,6 +206,8 @@ gdk_return BATsum(void *res, int tp, BAT
 const char *BATtailname(const BAT *b);
 gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT 
*sr, int op, bool nil_matches, BUN estimate) 
__attribute__((__warn_unused_result__));
 BAT *BATthetaselect(BAT *b, BAT *s, const void *val, const char *op);
+BAT *BATtolower(BAT *b, BAT *s);
+BAT *BATtoupper(BAT *b, BAT *s);
 void BATtseqbase(BAT *b, oid o);
 BAT *BATunique(BAT *b, BAT *s);
 BAT *BATunmask(BAT *b);
@@ -265,7 +269,9 @@ gdk_return GDKanalyticalntile(BAT *r, BA
 gdk_return GDKanalyticalprod(BAT *r, BAT *p, BAT *o, BAT *b, BAT *s, BAT *e, 
int tp1, int tp2, int frame_type);
 gdk_return GDKanalyticalsum(BAT *r, BAT *p, BAT *o, BAT *b, BAT *s, BAT *e, 
int tp1, int tp2, int frame_type);
 gdk_return GDKanalyticalwindowbounds(BAT *r, BAT *b, BAT *p, BAT *l, const 
void *restrict bound, int tp1, int tp2, int unit, bool preceding, oid 
first_half);
+gdk_return GDKasciify(char **restrict buf, size_t *restrict buflen, const char 
*restrict s);
 int GDKatomcnt;
+gdk_return GDKcasefold(char **restrict buf, size_t *restrict buflen, const 
char *restrict s);
 void GDKclrerr(void);
 gdk_return GDKcopyenv(BAT **key, BAT **val, bool writable);
 gdk_return GDKcreatedir(const char *nme);
@@ -317,8 +323,13 @@ 

MonetDB: ascii-flag - Closing branch ascii-flag.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 772d4d7ddbd5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/772d4d7ddbd5
Branch: ascii-flag
Log Message:

Closing branch ascii-flag.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - add generate_series for dates, ie steps of 1 ...

2024-05-13 Thread Niels Nes via checkin-list
Changeset: f7406735f6d8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f7406735f6d8
Added Files:
sql/backends/monet5/generator/Tests/generator05.test
Modified Files:
sql/backends/monet5/generator/90_generator.sql
sql/backends/monet5/generator/Tests/All
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

add generate_series for dates, ie steps of 1 or more days or months.


diffs (truncated from 670 to 300 lines):

diff --git a/sql/backends/monet5/generator/90_generator.sql 
b/sql/backends/monet5/generator/90_generator.sql
--- a/sql/backends/monet5/generator/90_generator.sql
+++ b/sql/backends/monet5/generator/90_generator.sql
@@ -54,6 +54,14 @@ create function sys.generate_series(firs
 returns table (value decimal(10,2))
 external name generator.series;
 
+create function sys.generate_series(first date, "limit" date, stepsize 
interval month)
+returns table (value date)
+external name generator.series;
+
+create function sys.generate_series(first date, "limit" date, stepsize 
interval day)
+returns table (value date)
+external name generator.series;
+
 create function sys.generate_series(first timestamp, "limit" timestamp, 
stepsize interval second)
 returns table (value timestamp)
 external name generator.series;
diff --git a/sql/backends/monet5/generator/Tests/All 
b/sql/backends/monet5/generator/Tests/All
--- a/sql/backends/monet5/generator/Tests/All
+++ b/sql/backends/monet5/generator/Tests/All
@@ -3,6 +3,7 @@ generator01
 generator02
 generator03
 generator04
+generator05
 
 rangejoin
 
diff --git a/sql/backends/monet5/generator/Tests/generator05.test 
b/sql/backends/monet5/generator/Tests/generator05.test
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/generator/Tests/generator05.test
@@ -0,0 +1,24 @@
+query T nosort
+select * from generate_series(date '2023-01-01',date '2024-01-01', interval 
'1' month) where value < date '2023-06-06'
+
+2023-01-01
+2023-02-01
+2023-03-01
+2023-04-01
+2023-05-01
+
+query T nosort
+select * from generate_series(date '2023-01-01',date '2024-01-01', interval 
'15' day) where value < date '2023-06-06'
+
+2023-01-01
+2023-01-16
+2023-01-31
+2023-02-15
+2023-03-02
+2023-03-17
+2023-04-01
+2023-04-16
+2023-05-01
+2023-05-16
+2023-05-31
+
diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -12,7 +12,7 @@
 
 /*
  * (c) Martin Kersten, Sjoerd Mullender
- * Series generating module for integer, decimal, real, double and timestamps.
+ * Series generating module for integer, decimal, real, double, date and 
timestamps.
  */
 
 #include "monetdb_config.h"
@@ -51,11 +51,21 @@ VLTgenerator_noop(Client cntxt, MalBlkPt
case TYPE_flt: VLTnoop(flt); break;
case TYPE_dbl: VLTnoop(dbl); break;
default:
-   if (tpe == TYPE_timestamp){
+   if (tpe == TYPE_date) {
+   /* with date, step is of SQL type "interval month or 
day",
+* i.e., MAL / C type "int" or "lng" */
+   int steptpe = pci->argc==4 ? getArgType(mb,pci,3) : 0;
+   if (steptpe == TYPE_int)
+   VLTnoop(int);
+   else /* default interval days */
+   VLTnoop(lng);
+   } else if (tpe == TYPE_timestamp) {
/* with timestamp, step is of SQL type "interval 
seconds",
 * i.e., MAL / C type "lng" */
 VLTnoop(lng);
-   } else throw(MAL,"generator.noop", SQLSTATE(42000) "unknown 
data type %d", getArgType(mb,pci,1));
+   } else {
+   throw(MAL,"generator.noop", SQLSTATE(42000) "unknown 
data type %d", getArgType(mb,pci,1));
+   }
}
if( zeroerror)
throw(MAL,"generator.noop", SQLSTATE(42000) "Zero step size not 
allowed");
@@ -204,7 +214,77 @@ VLTgenerator_table_(BAT **result, Client
VLTmaterialize_flt(dbl);
break;
default:
-   if (tpe == TYPE_timestamp) {
+   if (tpe == TYPE_date && pci->argc == 3)
+   throw(MAL,"generator.table", SQLSTATE(42000) "Date step 
missing");
+   if (tpe == TYPE_date && getArgType(mb, pci, 3) == TYPE_int) { 
/* months */
+   date *v,f,l;
+   int s;
+   ValRecord ret;
+   if (VARcalccmp(&ret, &stk->stk[pci->argv[1]],
+  &stk->stk[pci->argv[2]]) != GDK_SUCCEED)
+   throw(MAL, "generator.table",
+ SQLSTATE(42000) "Illegal generator 
expression range");
+   f = *getArgReference_TYPE(stk, pci, 1, date);
+   l = 

MonetDB: default - approved new signatures

2024-05-13 Thread Niels Nes via checkin-list
Changeset: 4311aa896c2d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4311aa896c2d
Modified Files:
clients/Tests/MAL-signatures-hge.test
Branch: default
Log Message:

approved new signatures


diffs (78 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44980,6 +44980,16 @@ VLTgenerator_noop;
 (empty)
 generator
 parameters
+pattern generator.parameters(X_0:date, X_1:date, X_2:int):bat[:date]
+VLTgenerator_noop;
+Retain the table definition, but don't materialize (months)
+generator
+parameters
+pattern generator.parameters(X_0:date, X_1:date, X_2:lng):bat[:date]
+VLTgenerator_noop;
+Retain the table definition, but don't materialize (days)
+generator
+parameters
 pattern generator.parameters(X_0:dbl, X_1:dbl):bat[:dbl]
 VLTgenerator_noop;
 (empty)
@@ -45050,6 +45060,11 @@ VLTgenerator_projection;
 (empty)
 generator
 projection
+pattern generator.projection(X_0:bat[:oid], X_1:bat[:date]):bat[:date]
+VLTgenerator_projection;
+(empty)
+generator
+projection
 pattern generator.projection(X_0:bat[:oid], X_1:bat[:dbl]):bat[:dbl]
 VLTgenerator_projection;
 (empty)
@@ -45095,6 +45110,16 @@ VLTgenerator_subselect;
 (empty)
 generator
 select
+pattern generator.select(X_0:bat[:date], X_1:bat[:oid], X_2:date, X_3:date, 
X_4:bit, X_5:bit, X_6:bit):bat[:oid]
+VLTgenerator_subselect;
+(empty)
+generator
+select
+pattern generator.select(X_0:bat[:date], X_1:date, X_2:date, X_3:bit, X_4:bit, 
X_5:bit):bat[:oid]
+VLTgenerator_subselect;
+(empty)
+generator
+select
 pattern generator.select(X_0:bat[:dbl], X_1:bat[:oid], X_2:dbl, X_3:dbl, 
X_4:bit, X_5:bit, X_6:bit):bat[:oid]
 VLTgenerator_subselect;
 (empty)
@@ -45175,6 +45200,16 @@ VLTgenerator_table;
 (empty)
 generator
 series
+pattern generator.series(X_0:date, X_1:date, X_2:int):bat[:date]
+VLTgenerator_table;
+date generator with step size in months
+generator
+series
+pattern generator.series(X_0:date, X_1:date, X_2:lng):bat[:date]
+VLTgenerator_table;
+date generator with step size in days
+generator
+series
 pattern generator.series(X_0:dbl, X_1:dbl):bat[:dbl]
 VLTgenerator_table;
 (empty)
@@ -45245,6 +45280,11 @@ VLTgenerator_thetasubselect;
 (empty)
 generator
 thetaselect
+pattern generator.thetaselect(X_0:bat[:date], X_1:bat[:oid], X_2:date, 
X_3:str):bat[:oid]
+VLTgenerator_thetasubselect;
+Overloaded selection routine
+generator
+thetaselect
 pattern generator.thetaselect(X_0:bat[:dbl], X_1:bat[:oid], X_2:dbl, 
X_3:str):bat[:oid]
 VLTgenerator_thetasubselect;
 (empty)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Move looking up function pointer out of the i...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: efc00e7b6e61 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/efc00e7b6e61
Modified Files:
gdk/gdk_calc_convert.c
gdk/gdk_hash.c
Branch: Dec2023
Log Message:

Move looking up function pointer out of the inner loop.


diffs (78 lines):

diff --git a/gdk/gdk_calc_convert.c b/gdk/gdk_calc_convert.c
--- a/gdk/gdk_calc_convert.c
+++ b/gdk/gdk_calc_convert.c
@@ -865,6 +865,7 @@ convert_str_fix(BATiter *bi, int tp, voi
return 0;
}
 
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(tp);
TIMEOUT_LOOP(ci->ncand, timeoffset) {
oid x = canditer_next(ci) - candoff;
const char *s = BUNtvar(*bi, x);
@@ -878,7 +879,7 @@ convert_str_fix(BATiter *bi, int tp, voi
goto conversion_failed;
}
assert(len == ATOMsize(tp));
-   if (ATOMcmp(tp, dst, nil) == 0)
+   if (atomcmp(dst, nil) == 0)
nils++;
}
dst = (void *) ((char *) dst + len);
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -899,7 +899,8 @@ BAThash_impl(BAT *restrict b, struct can
case TYPE_uuid:
starthash(uuid);
break;
-   default:
+   default: {
+   int (*atomcmp)(const void *, const void *) = 
ATOMcompare(h->type);
TIMEOUT_LOOP(p, timeoffset) {
const void *restrict v = BUNtail(bi, o - 
b->hseqbase);
c = hash_any(h, v);
@@ -913,8 +914,7 @@ BAThash_impl(BAT *restrict b, struct can
for (hb = hget;
 hb != BUN_NONE;
 hb = HASHgetlink(h, hb)) {
-   if (ATOMcmp(h->type,
-   v,
+   if (atomcmp(v,
BUNtail(bi, hb)) == 
0)
break;
}
@@ -928,6 +928,7 @@ BAThash_impl(BAT *restrict b, struct can
  GOTO_LABEL_TIMEOUT_HANDLER(bailout));
break;
}
+   }
TRC_DEBUG_IF(ACCELERATOR) if (p < cnt1)
TRC_DEBUG_ENDIF(ACCELERATOR,
"%s: abort starthash with "
@@ -975,7 +976,8 @@ BAThash_impl(BAT *restrict b, struct can
case TYPE_uuid:
finishhash(uuid);
break;
-   default:
+   default: {
+   int (*atomcmp)(const void *, const void *) = 
ATOMcompare(h->type);
TIMEOUT_LOOP(ci->ncand - p, timeoffset) {
const void *restrict v = BUNtail(bi, o - b->hseqbase);
c = hash_any(h, v);
@@ -985,7 +987,7 @@ BAThash_impl(BAT *restrict b, struct can
for (hb = hget;
 hb != BUN_NONE;
 hb = HASHgetlink(h, hb)) {
-   if (ATOMcmp(h->type, v, BUNtail(bi, 
hb)) == 0)
+   if (atomcmp(v, BUNtail(bi, hb)) == 0)
break;
}
h->nunique += hb == BUN_NONE;
@@ -999,6 +1001,7 @@ BAThash_impl(BAT *restrict b, struct can
  GOTO_LABEL_TIMEOUT_HANDLER(bailout));
break;
}
+   }
bat_iterator_end(&bi);
/* if the number of unique values is equal to the bat count,
 * all values are necessarily distinct */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Updated spec file so that we can build compat...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: b08535a1b139 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b08535a1b139
Modified Files:
MonetDB.spec
Branch: default
Log Message:

Updated spec file so that we can build compat packages (--with compat).


diffs (232 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -8,8 +8,12 @@
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
-%global name MonetDB
 %global version 11.50.0
+
+%bcond_with compat
+
+%global name MonetDB%{?with_compat:%version}
+
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
@@ -91,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -117,7 +121,9 @@ BuildRequires: unixODBC-devel
 BuildRequires: readline-devel
 %else
 BuildRequires: pkgconfig(bzip2)
+%if %{without compat}
 BuildRequires: pkgconfig(odbc)
+%endif
 BuildRequires: pkgconfig(readline)
 %endif
 %if %{with fits}
@@ -178,6 +184,7 @@ more client packages.
 %defattr(-,root,root)
 %{_libdir}/libbat*.so.*
 
+%if %{without compat}
 %package devel
 Summary: MonetDB development files
 Group: Applications/Databases
@@ -204,6 +211,7 @@ functionality of MonetDB.
 %{_includedir}/monetdb/monet*.h
 %{_libdir}/libbat*.so
 %{_libdir}/pkgconfig/monetdb-gdk.pc
+%endif
 
 %package stream
 Summary: MonetDB stream library
@@ -225,6 +233,7 @@ various other components.
 %defattr(-,root,root)
 %{_libdir}/libstream*.so.*
 
+%if %{without compat}
 %package stream-devel
 Summary: MonetDB stream library
 Group: Applications/Databases
@@ -249,6 +258,7 @@ library.
 %{_includedir}/monetdb/stream.h
 %{_includedir}/monetdb/stream_socket.h
 %{_libdir}/pkgconfig/monetdb-stream.pc
+%endif
 
 %package client-lib
 Summary: MonetDB - Monet Database Management System Client Programs
@@ -300,9 +310,12 @@ MonetDB, you will very likely need this 
 %defattr(-,root,root)
 %{_bindir}/mclient*
 %{_bindir}/msqldump*
+%if %{without compat}
 %{_mandir}/man1/mclient.1*
 %{_mandir}/man1/msqldump.1*
+%endif
 
+%if %{without compat}
 %package client-devel
 Summary: MonetDB - Monet Database Management System Client Programs
 Group: Applications/Databases
@@ -325,7 +338,9 @@ This package contains the files needed t
 %{_includedir}/monetdb/mapi*.h
 %{_includedir}/monetdb/msettings.h
 %{_libdir}/pkgconfig/monetdb-mapi.pc
+%endif
 
+%if %{without compat}
 %package client-odbc
 Summary: MonetDB ODBC driver
 Group: Applications/Databases
@@ -364,7 +379,9 @@ fi
 %defattr(-,root,root)
 %{_libdir}/libMonetODBC.so
 %{_libdir}/libMonetODBCs.so
+%endif
 
+%if %{without compat}
 %package client-tests
 Summary: MonetDB Client tests package
 Group: Applications/Databases
@@ -412,6 +429,7 @@ developer.
 %{_bindir}/malsample.pl
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
+%endif
 
 %if %{with geos}
 %package geom
@@ -586,16 +604,21 @@ exit 0
 
 %files server
 %defattr(-,root,root)
+%if %{without compat}
 %{_sysusersdir}/monetdb.conf
 %attr(2750,monetdb,monetdb) %dir %{_localstatedir}/lib/monetdb
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5/dbfarm
+%endif
 %{_bindir}/mserver5*
+%if %{without compat}
 %{_mandir}/man1/mserver5.1*
 %dir %{_datadir}/doc/MonetDB
 %docdir %{_datadir}/doc/MonetDB
 %{_datadir}/doc/MonetDB/*
+%endif
 
+%if %{without compat}
 %package server-devel
 Summary: MonetDB development files
 Group: Applications/Databases
@@ -620,6 +643,7 @@ used from the MAL level.
 %{_includedir}/monetdb/mel.h
 %{_libdir}/libmonetdb5*.so
 %{_libdir}/pkgconfig/monetdb5.pc
+%endif
 
 %package SQL
 Summary: MonetDB SQL server modules
@@ -654,6 +678,7 @@ configuration.
 %files SQL
 %defattr(-,root,root)
 %{_bindir}/monetdb*
+%if %{without compat}
 %dir %attr(775,monetdb,monetdb) %{_localstatedir}/log/monetdb
 %dir %attr(775,monetdb,monetdb) %{_rundir}/monetdb
 # RHEL >= 7, and all current Fedora
@@ -667,7 +692,9 @@ configuration.
 %dir %{_datadir}/doc/MonetDB-SQL
 %docdir %{_datadir}/doc/MonetDB-SQL
 %{_datadir}/doc/MonetDB-SQL/*
+%endif
 
+%if %{without compat}
 %package SQL-devel
 Summary: MonetDB SQL server modules development files
 Group: Applications/Databases
@@ -688,7 +715,9 @@ This package contains files needed to de
 %{_includedir}/monetdb/rel_*.h
 %{_includedir}/monetdb/sql*.h
 %{_includedir}/monetdb/store_*.h
+%endif
 
+%if %{without compat}
 %package embedded
 Summary: MonetDB as an embedded library
 Group: Applications/Databases
@@ -754,7 +783,9 @@ Group: Applications/Databases
 Requires: %{name}-client-tests = %{version}-%{release}
 

MonetDB: balanced_union - Implements push_join_down_munion optim...

2024-05-13 Thread stefanos mavros via checkin-list
Changeset: 1407c0aa2015 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1407c0aa2015
Modified Files:
sql/server/rel_optimize_proj.c
Branch: balanced_union
Log Message:

Implements push_join_down_munion optimizer WIP


diffs (116 lines):

diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -3524,7 +3524,8 @@ rel_push_join_down_union(visitor *v, sql
nl = rel_project(v->sql->sa, nl, 
rel_projections(v->sql, nl, NULL, 1, 1));
nr = rel_project(v->sql->sa, nr, 
rel_projections(v->sql, nr, NULL, 1, 1));
v->changes++;
-   return rel_inplace_setop(v->sql, rel, nl, nr, op_union, 
rel_projections(v->sql, rel, NULL, 1, 1));
+   return rel_inplace_setop(v->sql, rel, nl, nr, op_union,
+   rel_projections(v->sql, rel, NULL, 1, 
1));
} else if (is_union(l->op) && !need_distinct(l) && 
!is_single(l) &&
   is_union(r->op) && !need_distinct(r) && 
!is_single(r) && je) {
sql_rel *nl, *nr;
@@ -3684,6 +3685,102 @@ rel_push_join_down_union(visitor *v, sql
return rel;
 }
 
+/*
+ * Push (semi)joins down unions, this is basically for merge tables, where
+ * we know that the fk-indices are split over two clustered merge tables.
+ */
+static inline sql_rel *
+rel_push_join_down_munion(visitor *v, sql_rel *rel)
+{
+   if ((is_join(rel->op) && !is_outerjoin(rel->op) && !is_single(rel)) || 
is_semi(rel->op)) {
+   sql_rel *l = rel->l, *r = rel->r, *ol = l, *or = r;
+   list *exps = rel->exps, *attr = rel->attr;
+   sql_exp *je = NULL;
+
+   /* we would like to optimize in place reference rels which point
+* to replica tables and let the replica optimizer handle those
+* later. otherwise we miss the push join down optimization due
+* to the rel_is_ref bailout
+*/
+   if (rel_is_ref(l) && is_basetable(l->op) && l->l && 
isReplicaTable((sql_table*)l->l)) {
+   rel->l = rel_copy(v->sql, l, true);
+   rel_destroy(l);
+   }
+   if (rel_is_ref(r) && is_basetable(r->op) && r->l && 
isReplicaTable((sql_table*)r->l)) {
+   rel->r = rel_copy(v->sql, r, true);
+   rel_destroy(r);
+   }
+
+   // TODO: do we need to check if it's l/r are refs?
+   if (!l || !r || need_distinct(l) || need_distinct(r) || 
rel_is_ref(l) || rel_is_ref(r))
+   return rel;
+   if (l->op == op_project)
+   l = l->l;
+   if (r->op == op_project)
+   r = r->l;
+
+   /* both sides only if we have a join index ASSUMING pkey-fkey 
are aligned */
+   // TODO: we could also check if the join cols are (not) unique
+   bool aligned_pk_fk = true;
+   if (!l || !r || (is_munion(l->op) && is_munion(r->op) &&
+   !(je = rel_is_join_on_pkey(rel, aligned_pk_fk
+   return rel;
+
+   // TODO: why? bailout for no semijoin without pkey joins
+   if (is_semi(rel->op) && is_munion(l->op) && !je)
+   return rel;
+
+   if (is_munion(l->op) && !need_distinct(l) && !is_single(l) &&
+  !is_munion(r->op)){
+   /* join(munion(a,b,c), d) -> munion(join(a,d), 
join(b,d), join(c,d)) */
+   for (node *n = ((list*)l->l)->h; n; n = n->next) {
+   sql_rel *pc = rel_dup(n->data);
+   if (!is_project(pc->op))
+   pc = rel_project(v->sql->sa, pc, 
rel_projections(v->sql, pc, NULL, 1, 1));
+   rel_rename_exps(v->sql, l->exps, pc->exps);
+   if (l != ol) {
+   pc = rel_project(v->sql->sa, pc, NULL);
+   pc->exps = exps_copy(v->sql, ol->exps);
+   set_processed(pc);
+   }
+   pc = rel_crossproduct(v->sql->sa, pc, 
rel_dup(or), rel->op);
+   pc->exps = exps_copy(v->sql, exps);
+   pc->attr = exps_copy(v->sql, attr);
+   set_processed(pc);
+   pc = rel_project(v->sql->sa, pc, 
rel_projections(v->sql, pc, NULL, 1, 1));
+   n->data = pc;
+   }
+   v->changes++;
+   return rel_inplace_setop_n_ary(v->sql, rel, l->l, 
op_munion,
+

MonetDB: default - Add some casts.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 65d648432f63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65d648432f63
Modified Files:
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Add some casts.


diffs (39 lines):

diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -275,7 +275,7 @@ VLTgenerator_table_(BAT **result, Client
v = (date *) Tloc(bn, 0);
for (c = 0; c < n && f < l; c++) {
*v++ = f;
-   f = date_add_day(f, s);
+   f = date_add_day(f, (int) s);
if (is_date_nil(f)) {
BBPreclaim(bn);
throw(MAL, "generator.table", 
SQLSTATE(22003) "overflow in calculation");
@@ -635,7 +635,7 @@ VLTgenerator_subselect(Client cntxt, Mal
n++;
}
}
-   tsf = date_add_day(tsf, tss);
+   tsf = date_add_day(tsf, (int) tss);
if (is_date_nil(tsf)) {
BBPreclaim(cand);
BBPreclaim(bn);
@@ -1052,7 +1052,7 @@ str VLTgenerator_thetasubselect(Client c
c++;
}
}
-   val = date_add_day(val, s);
+   val = date_add_day(val, (int) s);
if (is_date_nil(val)) {
BBPreclaim(cand);
BBPreclaim(bn);
@@ -1308,7 +1308,7 @@ str VLTgenerator_projection(Client cntxt
 
for(; cnt-- > 0; o++){
t = ((int) (ol == NULL ? o : ol[o])) * s;
-   val = date_add_day(f, t);
+   val = date_add_day(f, (int) t);
if (is_date_nil(val)) {
BBPunfix(b->batCacheid);
BBPreclaim(bn);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Use CMake target property to create versioned...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 27d52e3434e7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/27d52e3434e7
Modified Files:
MonetDB.spec
NT/mkodbcwxs.py
NT/mksqlwxs.py
clients/NT/mclient.bat.in
clients/NT/msqldump.bat.in
clients/mapiclient/CMakeLists.txt
clients/mapilib/CMakeLists.txt
clients/mapilib/monetdb-mapi.pc.in
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
gdk/CMakeLists.txt
gdk/monetdb-gdk.pc.in
geom/monetdb5/CMakeLists.txt
monetdb5/NT/M5server.bat.in
monetdb5/extras/mal_optimizer_template/CMakeLists.txt
monetdb5/extras/rapi/CMakeLists.txt
monetdb5/modules/kernel/CMakeLists.txt
monetdb5/tools/CMakeLists.txt
monetdb5/tools/monetdb5.pc.in
sql/backends/monet5/CMakeLists.txt
sql/backends/monet5/UDF/capi/CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
sql/backends/monet5/UDF/udf/CMakeLists.txt
sql/backends/monet5/generator/CMakeLists.txt
sql/backends/monet5/vaults/csv/CMakeLists.txt
sql/backends/monet5/vaults/fits/CMakeLists.txt
sql/backends/monet5/vaults/netcdf/CMakeLists.txt
sql/backends/monet5/vaults/shp/CMakeLists.txt
tools/merovingian/client/CMakeLists.txt
tools/merovingian/daemon/CMakeLists.txt
tools/merovingian/daemon/config/monetdbd.service.in
tools/mserver/CMakeLists.txt
Branch: default
Log Message:

Use CMake target property to create versioned binary + symlink.
Also, add a dash to the .so names before the version number so that they
look like the names CMake uses for the binaries.


diffs (truncated from 584 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -548,7 +548,7 @@ embedded library (%{name}-embedded).
 %defattr(-,root,root)
 %{_libdir}/libmonetdb5*.so.*
 %{_libdir}/libmonetdbsql*.so*
-%dir %{_libdir}/monetdb5%{version}
+%dir %{_libdir}/monetdb5-%{version}
 %if %{with cintegration}
 %{_libdir}/monetdb5*/lib_capi.so
 %endif
@@ -939,11 +939,6 @@ rm -f %{buildroot}%{_libdir}/monetdb5*/l
 rm -f %{buildroot}%{_bindir}/monetdb_mtest.sh
 rm -rf %{buildroot}%{_datadir}/monetdb # /cmake
 
-for f in monetdbd monetdb mserver5 mclient msqldump; do
-mv %{buildroot}%{_bindir}/${f} %{buildroot}%{_bindir}/${f}%{version}
-ln -s ${f}%{version} %{buildroot}%{_bindir}/${f}
-done
-
 if [ -x /usr/sbin/hardlink ]; then
 /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
 else
diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -89,10 +89,10 @@ def main():
 id = 1
 print(r'')
 id = comp(features, id, 14,
-  [rf'bin\mapi{version}.dll', rf'lib\mapi{version}.pdb',
+  [rf'bin\mapi-{version}.dll', rf'lib\mapi-{version}.pdb',
r'lib\MonetODBC.dll', r'lib\MonetODBC.pdb',
r'lib\MonetODBCs.dll', r'lib\MonetODBCs.pdb',
-   rf'bin\stream{version}.dll', rf'lib\stream{version}.pdb',
+   rf'bin\stream-{version}.dll', rf'lib\stream-{version}.pdb',
vcpkg.format(r'bin\iconv-2.dll'),
vcpkg.format(r'bin\bz2.dll'),
vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -102,12 +102,12 @@ def main():
 print(r'  ')
 print(r'')
 print(r'')
-print(rf'  ')
+print(rf'  ')
 print(r'')
 print(r'  ')
 print(r'')
 print(r'')
-print(rf'  ')
+print(rf'  ')
 print(r'')
 print(r'  ')
 print(r'')
@@ -153,12 +153,12 @@ def main():
   [r'bin\mclient.exe',
r'bin\mserver5.exe',
r'bin\msqldump.exe',
-   rf'bin\bat{version}.dll',
-   rf'bin\mapi{version}.dll',
-   rf'bin\monetdb5{version}.dll',
+   rf'bin\bat-{version}.dll',
+   rf'bin\mapi-{version}.dll',
+   rf'bin\monetdb5-{version}.dll',
r'bin\monetdbe.dll',
-   rf'bin\monetdbsql{version}.dll',
-   rf'bin\stream{version}.dll',
+   rf'bin\monetdbsql-{version}.dll',
+   rf'bin\stream-{version}.dll',
vcpkg.format(r'bin\iconv-2.dll'),
vcpkg.format(r'bin\bz2.dll'),
vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
@@ -174,11 +174,11 @@ def main():
   [r'bin\mclient.pdb',
r'bin\mserver5.pdb',
r'bin\msqldump.pdb',
-   rf'lib\bat{version}.pdb',
-   rf'lib\mapi{version}.pdb',
-   rf'lib\monetdb5{version}.pdb',
-   rf'lib\monetdbsql{version}.pdb',
-   rf'lib\stream{version}.pdb'])
+   rf'lib\bat-{version}.pdb',
+   rf'lib\mapi