Changeset: ec76a4d1403c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec76a4d1403c
Modified Files:
        MonetDB.spec
        debian/control
        gdk/gdk_batop.c
        gdk/gdk_bbp.c
        gdk/gdk_logger.c
        gdk/gdk_posix.c
        gdk/gdk_private.h
        gdk/gdk_storage.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_prelude.c
        monetdb5/modules/kernel/batmmath.c
        monetdb5/modules/kernel/mmath.c
        monetdb5/modules/mal/mal_mapi.c
        monetdb5/modules/mal/tablet.c
        sql/backends/monet5/UDF/capi/capi.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_user.c
        sql/include/sql_mem.h
        sql/server/rel_dump.c
        sql/server/rel_optimizer.c
        sql/server/rel_rel.c
        sql/server/rel_semantic.c
        sql/server/rel_updates.c
        sql/server/rel_updates.h
        sql/server/sql_parser.y
Branch: default
Log Message:

Merge with Oct2020 branch.


diffs (truncated from 1685 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -187,6 +187,8 @@ need this package, but you will also nee
 package, and most likely also %{name}-SQL-server5, as well as one or
 more client packages.
 
+%ldconfig_scriptlets
+
 %files
 %license COPYING
 %defattr(-,root,root)
@@ -572,6 +574,7 @@ used from the MAL level.
 %files -n MonetDB5-server-devel
 %defattr(-,root,root)
 %{_includedir}/monetdb/mal*.h
+%{_includedir}/monetdb/mel.h
 %{_libdir}/libmonetdb5.so
 %{_libdir}/pkgconfig/monetdb5.pc
 
@@ -635,6 +638,24 @@ configuration.
 %docdir %{_datadir}/doc/MonetDB-SQL
 %{_datadir}/doc/MonetDB-SQL/*
 
+%package SQL-server5-devel
+Summary: MonetDB5 SQL server modules
+Group: Applications/Databases
+Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
+Requires: MonetDB5-server-devel%{?_isa} = %{version}-%{release}
+
+%description SQL-server5-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 files needed to develop SQL extensions.
+
+%files SQL-server5-devel
+%defattr(-,root,root)
+%{_includedir}/monetdb/sql*.h
+
 %package embedded
 Summary: MonetDB as an embedded library
 Group: Applications/Databases
@@ -847,10 +868,6 @@ sed -i 's|/var/run|/run|' \
     %{buildroot}%{_unitdir}/monetdbd.service
 %endif
 
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
 %changelog
 * Wed Nov 18 2020 Sjoerd Mullender <[email protected]> - 11.39.7-20201118
 - Rebuilt.
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -173,9 +173,10 @@ def main():
     print(r'            <Directory Id="include" Name="include">')
     print(r'              <Directory Id="monetdb" Name="monetdb">')
     id = comp(extend, id, 16,
-              sorted([r'include\monetdb\{}'.format(x) for x in filter(lambda 
x: (x.startswith('gdk') or x.startswith('monet') or x.startswith('mal')) and 
x.endswith('.h'), os.listdir(os.path.join(sys.argv[3], 'include', 'monetdb')))] 
+
+              sorted([r'include\monetdb\{}'.format(x) for x in filter(lambda 
x: (x.startswith('gdk') or x.startswith('monet') or x.startswith('mal') or 
x.startswith('sql')) and x.endswith('.h'), os.listdir(os.path.join(sys.argv[3], 
'include', 'monetdb')))] +
                      [r'include\monetdb\mapi.h',
                       r'include\monetdb\matomic.h',
+                      r'include\monetdb\mel.h',
                       r'include\monetdb\mstring.h',
                       r'include\monetdb\stream.h',
                       r'include\monetdb\stream_socket.h']),
diff --git a/buildtools/coverity_model.c b/buildtools/coverity_model.c
--- a/buildtools/coverity_model.c
+++ b/buildtools/coverity_model.c
@@ -20,8 +20,13 @@
  * author: Sjoerd Mullender
  */
 
+int
+rand(void)
+{
+       /* ignore */
+}
+
 typedef enum { GDK_FAIL, GDK_SUCCEED } gdk_return;
-typedef struct {} *MalBlkPtr;
 
 void
 GDKfree(void *blk)
@@ -51,7 +56,8 @@ GDKzalloc(size_t size)
 {
        void *p = GDKmalloc(size);
        if (p) {
-               for (size_t i = 0; i < size; i++)
+               size_t i;
+               for (i = 0; i < size; i++)
                        ((char *) p)[i] = 0;
        }
        return p;
@@ -136,6 +142,24 @@ GDKmremap(const char *path, int mode, vo
        return p;
 }
 
+typedef struct {} *MalBlkPtr;
+enum malexception {
+       MAL,
+       ILLARG /*,
+       OUTOFBNDS,
+       IO,
+       INVCRED,
+       OPTIMIZER,
+       STKOF,
+       SYNTAX,
+       TYPE,
+       LOADER,
+       PARSE,
+       ARITH,
+       PERMD,
+       SQL */
+};
+
 char *
 createException(enum malexception type, const char *fcn, const char *format, 
...)
 {
@@ -177,8 +201,8 @@ freeException(char *p)
 char *
 concatErrors(char *err1, const char *err2)
 {
+       char *p;
        freeException(err1);
-       char *p;
        p = __coverity_alloc_nosize__();
        __coverity_mark_as_afm_allocated__(p, "freeException");
        return p;
diff --git a/clients/odbc/driver/SQLGetDescField.c 
b/clients/odbc/driver/SQLGetDescField.c
--- a/clients/odbc/driver/SQLGetDescField.c
+++ b/clients/odbc/driver/SQLGetDescField.c
@@ -126,7 +126,7 @@ MNDBGetDescField(ODBCDesc *desc,
                WriteData(ValuePtr, rec->sql_desc_concise_type, SQLSMALLINT);
                return SQL_SUCCESS;
        case SQL_DESC_DATA_PTR:                 /* SQLPOINTER */
-#ifndef STATIC_CODE_ANALYSIS
+#ifndef __COVERITY__
                /* Coverity doesn't like the debug print in WriteData,
                 * so we hide this whole thing */
                if (!isIRD(desc))
diff --git a/clients/odbc/driver/SQLGetStmtAttr.c 
b/clients/odbc/driver/SQLGetStmtAttr.c
--- a/clients/odbc/driver/SQLGetStmtAttr.c
+++ b/clients/odbc/driver/SQLGetStmtAttr.c
@@ -41,7 +41,7 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
         * StringLengthPtr */
 
        switch (Attribute) {
-#ifndef STATIC_CODE_ANALYSIS
+#ifndef __COVERITY__
        /* Coverity doesn't like the debug print in WriteData, so we
         * hide this whole thing */
        case SQL_ATTR_APP_PARAM_DESC:           /* SQLHANDLE */
@@ -72,7 +72,7 @@ MNDBGetStmtAttr(ODBCStmt *stmt,
                /* SQL_CURSOR_TYPE */
                WriteData(ValuePtr, stmt->cursorType, SQLULEN);
                break;
-#ifndef STATIC_CODE_ANALYSIS
+#ifndef __COVERITY__
        /* Coverity doesn't like the debug print in WriteData, so we
         * hide this whole thing */
        case SQL_ATTR_IMP_PARAM_DESC:           /* SQLHANDLE */
diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake
--- a/cmake/monetdb-options.cmake
+++ b/cmake/monetdb-options.cmake
@@ -65,10 +65,6 @@ option(SANITIZER
   "Enable support for the GCC address sanitizer (default=OFF)"
   OFF)
 
-option(STATIC_CODE_ANALYSIS
-  "configure for static code analysis (use only if you know what you are 
doing) (default=OFF)"
-  OFF)
-
 option(STRICT
   "Enable strict compiler flags (default=ON for development sources, OFF for 
tarball installation)"
   "${DEVELOPMENT}")
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -215,6 +215,19 @@ Description: MonetDB SQL support for mon
  This package contains the monetdb and monetdbd programs and the systemd
  configuration.
 
+Package: monetdb5-sql-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ monetdb5-server-dev (= ${source:Version}),
+ monetdb5-sql (= ${source:Version})
+Description: MonetDB SQL support for monetdb5
+ 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 files needed to develop SQL extensions.
+
 Package: monetdb-python3
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
diff --git a/debian/monetdb5-server-dev.install 
b/debian/monetdb5-server-dev.install
--- a/debian/monetdb5-server-dev.install
+++ b/debian/monetdb5-server-dev.install
@@ -1,3 +1,4 @@
 debian/tmp/usr/lib/x86_64-linux-gnu/libmonetdb5.so usr/lib/x86_64-linux-gnu
 debian/tmp/usr/include/monetdb/mal*.h usr/include/monetdb
+debian/tmp/usr/include/monetdb/mel.h usr/include/monetdb
 debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/monetdb5.pc 
usr/lib/x86_64-linux-gnu/pkgconfig
diff --git a/debian/monetdb5-sql-dev.install b/debian/monetdb5-sql-dev.install
new file mode 100644
--- /dev/null
+++ b/debian/monetdb5-sql-dev.install
@@ -0,0 +1,1 @@
+debian/tmp/usr/include/monetdb/sql*.h usr/include/monetdb
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -49,10 +49,6 @@ unshare_string_heap(BAT *b)
  * it makes sense to just quickly copy the whole string heap instead
  * of inserting individual strings.  See the comments in the code for
  * more information. */
-#ifdef STATIC_CODE_ANALYSIS
-#define rand()         0
-#endif
-
 static gdk_return
 insert_string_bat(BAT *b, BAT *n, struct canditer *ci, bool force, bool 
mayshare)
 {
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -980,7 +980,7 @@ BBPreadEntries(FILE *fp, unsigned bbpver
                }
                /* tailname is ignored */
                strcpy_len(BBP_physical(bid), filename, 
sizeof(BBP_physical(bid)));
-#ifdef STATIC_CODE_ANALYSIS
+#ifdef __COVERITY__
                /* help coverity */
                BBP_physical(bid)[sizeof(BBP_physical(bid)) - 1] = 0;
 #endif
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1841,8 +1841,14 @@ logger_load(int debug, const char *fn, c
 #elif defined(HAVE_FSYNC)
                             && fsync(fileno(fp)) < 0
 #endif
-                                   ) ||
-                           fclose(fp) < 0) {
+                                   )) {
+                               remove(filename);
+                               (void) fclose(fp);
+                               GDKerror("flushing log file %s failed",
+                                        filename);
+                               goto error;
+                       }
+                       if (fclose(fp) < 0) {
                                remove(filename);
                                GDKerror("closing log file %s failed",
                                         filename);
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -373,7 +373,7 @@ MT_mremap(const char *path, int mode, vo
        assert(mode & MMAP_WRITABLE);
 
        if (*new_size < old_size) {
-#ifndef STATIC_CODE_ANALYSIS   /* hide this from static code analyzer */
+#ifndef __COVERITY__   /* hide this from static code analyzer */
                /* shrink */
                VALGRIND_RESIZEINPLACE_BLOCK(old_address, old_size, *new_size, 
0);
                if (munmap((char *) old_address + *new_size,
@@ -388,7 +388,7 @@ MT_mremap(const char *path, int mode, vo
                if (path && truncate(path, *new_size) < 0)
                        TRC_WARNING(GDK, "MT_mremap(%s): truncate failed: %s\n",
                                    path, GDKstrerror(errno, (char[64]){0}, 
64));
-#endif /* !STATIC_CODE_ANALYSIS */
+#endif /* !__COVERITY__ */
                return old_address;
        }
        if (*new_size == old_size) {
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -374,7 +374,7 @@ extern MT_Lock GDKtmLock;
  * incompatible) */
 #define EXTRALEN ((SIZEOF_BUN + GDK_VARALIGN - 1) & ~(GDK_VARALIGN - 1))
 
-#if !defined(NDEBUG) && !defined(STATIC_CODE_ANALYSIS)
+#if !defined(NDEBUG) && !defined(__COVERITY__)
 /* see comment in gdk.h */
 #ifdef __GNUC__
 #define GDKmremap(p, m, oa, os, ns)                                    \
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to