Changeset: 461dfc261129 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/461dfc261129
Added Files:
        common/utils/monetdb-mutils.pc.in
        debian/libmonetdb-mutils-dev.install
        debian/libmonetdb-mutils1.install
Modified Files:
        MonetDB.spec
        NT/mkodbcwxs.py
        NT/mksqlwxs.py
        clients/mapiclient/CMakeLists.txt
        clients/mapiclient/ReadlineTools.c
        clients/mapiclient/dotmonetdb.c
        clients/mapiclient/mclient.c
        clients/mapiclient/msqldump.c
        clients/mapilib/CMakeLists.txt
        clients/odbc/driver/CMakeLists.txt
        clients/odbc/tests/CMakeLists.txt
        cmake/monetdb-versions.cmake
        common/stream/CMakeLists.txt
        common/stream/monetdb-stream.pc.in
        common/stream/stdio_stream.c
        common/utils/CMakeLists.txt
        common/utils/mcrypt.h
        common/utils/mprompt.h
        common/utils/msabaoth.h
        common/utils/mutf8.h
        common/utils/mutils.h
        common/utils/muuid.h
        common/utils/ripemd160.h
        ctest/monetdb5/mal/CMakeLists.txt
        debian/control
        monetdb5/mal/CMakeLists.txt
        monetdb5/modules/atoms/CMakeLists.txt
        monetdb5/modules/mal/CMakeLists.txt
        monetdb5/tools/CMakeLists.txt
        sql/backends/monet5/CMakeLists.txt
        sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
        sql/server/CMakeLists.txt
        tools/merovingian/client/CMakeLists.txt
        tools/merovingian/daemon/CMakeLists.txt
        tools/monetdbe/CMakeLists.txt
        tools/mserver/CMakeLists.txt
Branch: Mar2025
Log Message:

Created new shared library libmutils.
This library combines the old static libraries mutils, mcrypt, msabaoth,
mprompt and mutf8.  The reason for this change is so that we don't get
multiple definitions of the same thing.  The sanitizer was not happy
with the two copies of the mutf8 library that resulted from loading the
odbc loader.  Also, we had to go through lots of hoops in order to get
the old version sort-of working.


diffs (truncated from 1128 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -219,6 +219,49 @@ functionality of MonetDB.
 %{_datadir}/monetdb/cmake/monetdb_config_headerTargets.cmake
 %endif
 
+%package mutils
+Summary: MonetDB mutils library
+Group: Applications/Databases
+
+%description mutils
+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 a shared library (libmutils) which is needed by
+various other components.
+
+%ldconfig_scriptlets mutils
+
+%files mutils
+%license COPYING
+%defattr(-,root,root)
+%{_libdir}/libmutils*.so.*
+
+%if %{without compat}
+%package mutils-devel
+Summary: MonetDB mutils library
+Group: Applications/Databases
+Requires: %{name}-mutils%{?_isa} = %{version}-%{release}
+
+%description mutils-devel
+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 files to develop with the %{name}-mutils
+library.
+
+%files mutils-devel
+%defattr(-,root,root)
+%dir %{_includedir}/monetdb
+%{_libdir}/libmutils*.so
+%{_libdir}/pkgconfig/monetdb-mutils.pc
+%{_datadir}/monetdb/cmake/mutilsTargets*.cmake
+%endif
+
 %package stream
 Summary: MonetDB stream library
 Group: Applications/Databases
@@ -244,6 +287,7 @@ various other components.
 Summary: MonetDB stream library
 Group: Applications/Databases
 Requires: %{name}-stream%{?_isa} = %{version}-%{release}
+Requires: %{name}-mutils-devel%{?_isa} = %{version}-%{release}
 Requires: bzip2-devel
 Requires: libcurl-devel
 Requires: zlib-devel
diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -93,6 +93,7 @@ def main():
                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\mutils-{version}.dll', rf'lib\mutils-{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
@@ -159,6 +159,7 @@ def main():
                r'bin\monetdbe.dll',
                rf'bin\monetdbsql-{version}.dll',
                rf'bin\stream-{version}.dll',
+               rf'bin\mutils-{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
@@ -178,7 +179,8 @@ def main():
                rf'lib\mapi-{version}.pdb',
                rf'lib\monetdb5-{version}.pdb',
                rf'lib\monetdbsql-{version}.pdb',
-               rf'lib\stream-{version}.pdb'])
+               rf'lib\stream-{version}.pdb',
+               rf'lib\mutils-{version}.pdb'])
     id = comp(geom, id, 14,
               [vcpkg.format(r'bin\geos_c.dll'),
                vcpkg.format(r'bin\geos.dll')])
@@ -220,6 +222,7 @@ def main():
                r'lib\monetdbe.lib',
                rf'lib\monetdbsql-{version}.lib',
                rf'lib\stream-{version}.lib',
+               rf'lib\mutils-{version}.lib',
                vcpkg.format(r'lib\iconv.lib'),
                vcpkg.format(r'lib\bz2.lib'),
                vcpkg.format(r'lib\charset.lib'),
diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -51,10 +51,8 @@ target_link_libraries(mclient
   PRIVATE
   monetdb_config_header
   mcutil
-  mprompt
   moptions
   mutils
-  mutf8
   mapi
   stream
   $<$<BOOL:${READLINE_FOUND}>:Readline::Readline>
@@ -81,7 +79,6 @@ target_link_libraries(msqldump
   mutils
   mapi
   stream
-  mprompt
   $<$<PLATFORM_ID:Windows>:${GETOPT_LIB}>)
 
 set_target_properties(mclient msqldump
diff --git a/clients/mapiclient/ReadlineTools.c 
b/clients/mapiclient/ReadlineTools.c
--- a/clients/mapiclient/ReadlineTools.c
+++ b/clients/mapiclient/ReadlineTools.c
@@ -22,7 +22,6 @@
 #include <readline/readline.h>
 #include <readline/history.h>
 #include "ReadlineTools.h"
-#define LIBMUTILS 1
 #include "mutils.h"
 
 #ifdef HAVE_STRINGS_H
diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -12,7 +12,6 @@
 
 #include "monetdb_config.h"
 #include "dotmonetdb.h"
-#define LIBMUTILS 1
 #include "mutils.h"
 #include <string.h>
 
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -36,7 +36,6 @@
 #include "ReadlineTools.h"
 #endif
 #include "msqldump.h"
-#define LIBMUTILS 1
 #include "mprompt.h"
 #include "mutils.h"            /* mercurial_revision */
 #include "dotmonetdb.h"
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -22,7 +22,6 @@
 
 #include "stream.h"
 #include "msqldump.h"
-#define LIBMUTILS 1
 #include "mprompt.h"
 #include "mutils.h"            /* mercurial_revision */
 #include "dotmonetdb.h"
diff --git a/clients/mapilib/CMakeLists.txt b/clients/mapilib/CMakeLists.txt
--- a/clients/mapilib/CMakeLists.txt
+++ b/clients/mapilib/CMakeLists.txt
@@ -50,7 +50,6 @@ target_link_libraries(mapi
   PRIVATE
   monetdb_config_header
   moptions
-  mcrypt
   stream
   mutils
   $<$<BOOL:${OPENSSL_FOUND}>:OpenSSL::SSL>
diff --git a/clients/odbc/driver/CMakeLists.txt 
b/clients/odbc/driver/CMakeLists.txt
--- a/clients/odbc/driver/CMakeLists.txt
+++ b/clients/odbc/driver/CMakeLists.txt
@@ -131,7 +131,7 @@ target_link_libraries(MonetODBC
   PRIVATE
   monetdb_config_header
   mapi
-  mutf8
+  mutils
   ${ODBCINST_LIBRARIES})
 
 install(TARGETS
diff --git a/clients/odbc/tests/CMakeLists.txt 
b/clients/odbc/tests/CMakeLists.txt
--- a/clients/odbc/tests/CMakeLists.txt
+++ b/clients/odbc/tests/CMakeLists.txt
@@ -44,7 +44,7 @@ add_executable(odbcconnect
 
 target_link_libraries(odbcconnect
   PRIVATE
-  mutf8
+  mutils
   ODBC::ODBC)
 
 install(TARGETS
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -66,6 +66,12 @@ set(MONETDBE_VERSION_MINOR "0")
 set(MONETDBE_VERSION_PATCH "0")
 set(MONETDBE_VERSION 
"${MONETDBE_VERSION_MAJOR}.${MONETDBE_VERSION_MINOR}.${MONETDBE_VERSION_PATCH}")
 
+# version of the MUTILS library (subdirectory common/utils)
+set(MUTILS_VERSION_MAJOR "1")
+set(MUTILS_VERSION_MINOR "0")
+set(MUTILS_VERSION_PATCH "0")
+set(MUTILS_VERSION 
"${MUTILS_VERSION_MAJOR}.${MUTILS_VERSION_MINOR}.${MUTILS_VERSION_PATCH}")
+
 # version of the STREAM library (subdirectory common/stream)
 set(STREAM_VERSION_MAJOR "27")
 set(STREAM_VERSION_MINOR "0")
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -70,7 +70,7 @@ target_link_libraries(stream
   $<$<BOOL:${LZ4_FOUND}>:LZ4::LZ4>
   $<$<BOOL:${OPENSSL_FOUND}>:OpenSSL::SSL>
   matomic
-  mutf8
+  mutils
   monetdb_config_header
   $<$<PLATFORM_ID:Windows>:ws2_32>
   Threads::Threads)
diff --git a/common/stream/monetdb-stream.pc.in 
b/common/stream/monetdb-stream.pc.in
--- a/common/stream/monetdb-stream.pc.in
+++ b/common/stream/monetdb-stream.pc.in
@@ -16,7 +16,7 @@ Name: monetdb-stream
 Description: MonetDB streams library
 URL: https://www.monetdb.org/
 Version: @MONETDB_VERSION@
-Requires.private: @PKG_ZLIB@ @PKG_BZIP2@ @PKG_LZMA@
+Requires.private: monetdb-utils = @MONETDB_VERSION@ @PKG_ZLIB@ @PKG_BZIP2@ 
@PKG_LZMA@
 
 Libs: -L${libdir} -lstream-@MONETDB_VERSION@
 Libs.private: @SOCKET_LIBS@
diff --git a/common/stream/stdio_stream.c b/common/stream/stdio_stream.c
--- a/common/stream/stdio_stream.c
+++ b/common/stream/stdio_stream.c
@@ -15,7 +15,7 @@
 #include "monetdb_config.h"
 #include "stream.h"
 #include "stream_internal.h"
-#include "mutf8.h"
+#include "mutils.h"
 
 
 /* ------------------------------------------------------------------ */
@@ -170,65 +170,6 @@ file_fsetpos(stream *restrict s, fpos_t 
        return fsetpos(fp, p) ? -1 : 0;
 }
 
-/* convert a string from UTF-8 to wide characters; the return value is
- * freshly allocated */
-#ifdef NATIVE_WIN32
-static wchar_t *
-utf8towchar(const char *src)
-{
-       wchar_t *dest;
-       size_t i = 0;
-       uint32_t state = 0, codepoint = 0;
-
-       /* count how many wchar_t's we need, while also checking for
-        * correctness of the input */
-       for (size_t j = 0; src[j]; j++) {
-               switch (decode(&state, &codepoint, (uint8_t) src[j])) {
-               case UTF8_ACCEPT:
-                       i++;
-#if SIZEOF_WCHAR_T == 2
-                       i += (codepoint > 0xFFFF);
-#endif
-                       break;
-               case UTF8_REJECT:
-                       return NULL;
-               default:
-                       break;
-               }
-       }
-       dest = malloc((i + 1) * sizeof(wchar_t));
-       if (dest == NULL)
-               return NULL;
-       /* go through the source string again, this time we can skip
-        * the correctness tests */
-       i = 0;
-       for (size_t j = 0; src[j]; j++) {
-               switch (decode(&state, &codepoint, (uint8_t) src[j])) {
-               case UTF8_ACCEPT:
-#if SIZEOF_WCHAR_T == 2
-                       if (codepoint <= 0xFFFF) {
-                               dest[i++] = (wchar_t) codepoint;
-                       } else {
-                               dest[i++] = (wchar_t) (0xD7C0 + (codepoint >> 
10));
-                               dest[i++] = (wchar_t) (0xDC00 + (codepoint & 
0x3FF));
-                       }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to