Changeset: 31024dcf32c1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/31024dcf32c1
Branch: resource_management
Log Message:

merge upstream


diffs (truncated from 12394 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -839,3 +839,5 @@ 30e6380820842b9e0325536eb22d7cb3843ab095
 30e6380820842b9e0325536eb22d7cb3843ab095 Aug2024_SP2_release
 fd30df6fc710aa7615a995dd826389a67cddd47f Mar2025_root
 11a26808ab1bc96546077899924e5c31d7f2553c Mar2025_1
+ad290be8174693266b1e4eeab06af0266686af38 Mar2025_3
+ad290be8174693266b1e4eeab06af0266686af38 Mar2025_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1056,6 +1056,15 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Mon Mar 24 2025 Sjoerd Mullender <[email protected]> - 11.53.3-20250324
+- Rebuilt.
+- GH#7622: In PREPARE queries with many parameters, information about
+  parameters is truncated when sent to client.
+- GH#7623: Database crashed when using UPDATE xxx SET xxx RETURNING xx
+
+* Thu Mar 20 2025 Martin van Dinther <[email protected]> 
- 11.53.3-20250324
+- sql: Added scalar functions: dayname(d date) and monthname(d date) returns 
varchar(10).
+
 * Mon Mar 17 2025 Sjoerd Mullender <[email protected]> - 11.53.1-20250317
 - Rebuilt.
 - GH#7101: Feature request: nextafter() in SQL
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
@@ -1666,6 +1666,7 @@ list *sa_list(allocator *sa);
 char *sa_message(allocator *sa, _In_z_ _Printf_format_string_ const char 
*format, ...) __attribute__((__format__(__printf__, 2, 3)));
 msettings *sa_msettings_create(allocator *sa);
 char *sa_msettings_to_string(const msettings *mp, allocator *sa, size_t 
size_hint);
+sql_type *schema_bind_type(mvc *sql, sql_schema *s, const char *name);
 str sht_dec2_bte(bte *res, const int *s1, const sht *v);
 str sht_dec2_dbl(dbl *res, const int *s1, const sht *v);
 str sht_dec2_flt(flt *res, const int *s1, const sht *v);
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -8,7 +8,7 @@
 .\" Copyright August 2008 - 2023 MonetDB B.V.;
 .\" Copyright 1997 - July 2008 CWI.
 .\"
-.TH MCLIENT 1 2025-03-17 MonetDB "MonetDB Applications"
+.TH MCLIENT 1 2025-03-24 MonetDB "MonetDB Applications"
 .SH NAME
 mclient \- the MonetDB command-line tool
 .SH SYNOPSIS
diff --git a/clients/odbc/driver/ODBCConvert.c 
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -2806,15 +2806,14 @@ ODBCFetch(ODBCStmt *stmt,
                ODBCLOG("Writing 16 bytes to %p\n", ptr);
 #endif
                SQLGUID su;
+               unsigned int sudata1; /* DWORD su.Data1 either long or int */
                sscanf(data,
-                      "%8"SCNx32
-                      "-%4"SCNx16
-                      "-%4"SCNx16
-                      "-%2"SCNx8"%2"SCNx8
-                      "-%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8"%2"SCNx8,
-                      &su.Data1, &su.Data2, &su.Data3,
+                      "%8x-%4hx-%4hx-%2hhx%2hhx"
+                      "-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
+                      &sudata1, &su.Data2, &su.Data3,
                       &su.Data4[0], &su.Data4[1],
                       &su.Data4[2], &su.Data4[3], &su.Data4[4], &su.Data4[5], 
&su.Data4[6], &su.Data4[7]);
+               su.Data1 = sudata1;
                WriteData(ptr, su, SQLGUID);
                if (lenp)
                        *lenp = sizeof(SQLGUID);
@@ -3348,11 +3347,9 @@ ODBCStore(ODBCStmt *stmt,
                case SQL_C_GUID:
                        u = *(SQLGUID *)ptr;
                        snprintf(data, sizeof(data),
-                                "%08"PRIx32"-%04"PRIx16"-%04"PRIx16
-                                "-%02"PRIx8"%02"PRIx8
-                                "-%02"PRIx8"%02"PRIx8"%02"PRIx8
-                                "%02"PRIx8"%02"PRIx8"%02"PRIx8,
-                                u.Data1, u.Data2, u.Data3,
+                                "%08x-%04x-%04x-%02x%02x"
+                                "-%02x%02x%02x%02x%02x%02x",
+                                (unsigned int) u.Data1, u.Data2, u.Data3,
                                 u.Data4[0], u.Data4[1],
                                 u.Data4[2], u.Data4[3],
                                 u.Data4[4], u.Data4[5],
@@ -3899,12 +3896,9 @@ ODBCStore(ODBCStmt *stmt,
                        u = *(SQLGUID *)ptr;
                        snprintf(data, sizeof(data),
                                 "UUID '"
-                                "%08"PRIx32"-%04"PRIx16"-%04"PRIx16
-                                "-%02"PRIx8"%02"PRIx8
-                                "-%02"PRIx8"%02"PRIx8"%02"PRIx8
-                                "%02"PRIx8"%02"PRIx8"%02"PRIx8
-                                "'",
-                                u.Data1, u.Data2, u.Data3,
+                                "%08x-%04x-%04x-%02x%02x"
+                                "-%02x%02x%02x%02x%02x%02x'",
+                                (unsigned int) u.Data1, u.Data2, u.Data3,
                                 u.Data4[0], u.Data4[1],
                                 u.Data4[2], u.Data4[3],
                                 u.Data4[4], u.Data4[5],
diff --git a/clients/odbc/tests/ODBCtester.c b/clients/odbc/tests/ODBCtester.c
--- a/clients/odbc/tests/ODBCtester.c
+++ b/clients/odbc/tests/ODBCtester.c
@@ -29,7 +29,7 @@
 static void
 prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
 {
-       SQLCHAR state[6];
+       SQLCHAR state[SQL_SQLSTATE_SIZE +1];
        SQLINTEGER errnr;
        SQLCHAR msg[256];
        SQLSMALLINT msglen;
@@ -207,6 +207,9 @@ testGetDataTruncatedString(SQLHANDLE stm
                        "SQLstate 01004, Errnr 0, Message [MonetDB][ODBC Driver 
11.##.#][MonetDB-Test]String data, right truncated\n");
        }
 
+       ret = SQLCloseCursor(stmt);
+       check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
+
        /* cleanup */
        free(outp);
        return ret;
@@ -266,7 +269,7 @@ testGetDataGUID(SQLHANDLE stmt)
                        pos += snprintf(outp + pos, outp_len - pos, "NULL\n");
                else
                        pos += snprintf(outp + pos, outp_len - pos, 
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
-                               guid_val.Data1, guid_val.Data2, guid_val.Data3,
+                                       (unsigned int) guid_val.Data1, 
guid_val.Data2, guid_val.Data3,
                                guid_val.Data4[0], guid_val.Data4[1], 
guid_val.Data4[2], guid_val.Data4[3], guid_val.Data4[4], guid_val.Data4[5], 
guid_val.Data4[6], guid_val.Data4[7]);
                check(ret, SQL_HANDLE_STMT, stmt, "SQLGetData(col)");
        }
@@ -286,6 +289,9 @@ testGetDataGUID(SQLHANDLE stmt)
                        "SQLGetData(3, SQL_C_CHAR, 36) returns 0, vallen 36, 
str_val: 'beefc4f7-0264-4735-9b7a-75fd371ef803'\n"
                        "SQLGetData(3, SQL_C_GUID, 16) returns 0, vallen 16, 
data_val: beefc4f7-0264-4735-9b7a-75fd371ef803\n");
 
+       ret = SQLCloseCursor(stmt);
+       check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
+
        /* cleanup */
        free(outp);
        return ret;
@@ -335,19 +341,13 @@ main(int argc, char **argv)
        ret = SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt);
        check(ret, SQL_HANDLE_DBC, dbc, "SQLAllocHandle (STMT)");
 
-       /* run tests */
+       /**** run tests ****/
        ret = testGetDataTruncatedString(stmt, SQL_C_CHAR);
        check(ret, SQL_HANDLE_STMT, stmt, "testGetDataTruncatedString(STMT, 
SQL_C_CHAR)");
 
-       ret = SQLCloseCursor(stmt);
-       check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
-
        ret = testGetDataTruncatedString(stmt, SQL_C_WCHAR);
        check(ret, SQL_HANDLE_STMT, stmt, "testGetDataTruncatedString(STMT, 
SQL_C_WCHAR)");
 
-       ret = SQLCloseCursor(stmt);
-       check(ret, SQL_HANDLE_STMT, stmt, "SQLCloseCursor");
-
        ret = testGetDataGUID(stmt);
        check(ret, SQL_HANDLE_STMT, stmt, "testGetDataGUID(STMT)");
 
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,7 +44,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "30")
 set(GDK_VERSION_MINOR "0")
-set(GDK_VERSION_PATCH "0")
+set(GDK_VERSION_PATCH "1")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
@@ -74,7 +74,7 @@ set(MUTILS_VERSION "${MUTILS_VERSION_MAJ
 
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "16")
-set(SQL_VERSION_MINOR "0")
+set(SQL_VERSION_MINOR "1")
 set(SQL_VERSION_PATCH "0")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
 
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+monetdb (11.53.3) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7622: In PREPARE queries with many parameters, information about
+    parameters is truncated when sent to client.
+  * GH#7623: Database crashed when using UPDATE xxx SET xxx RETURNING xx
+
+ -- Sjoerd Mullender <[email protected]>  Mon, 24 Mar 2025 15:03:01 +0100
+
+monetdb (11.53.3) unstable; urgency=low
+
+  * sql: Added scalar functions: dayname(d date) and monthname(d date) returns 
varchar(10).
+
+ -- Martin van Dinther <[email protected]>  Thu, 20 Mar 
2025 15:03:01 +0100
+
 monetdb (11.53.1) unstable; urgency=low
 
   * Rebuilt.
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1640,7 +1640,7 @@ BUNinplacemulti(BAT *b, const oid *posit
                                        b->tseqbase = * (oid *) t;
                                }
                        }
-               } else if (b->tnosorted >= p)
+               } else if (b->tnosorted == p || b->tnosorted == p + 1)
                        b->tnosorted = 0;
                if (b->trevsorted) {
                        if (prv != BUN_NONE &&
@@ -1652,7 +1652,7 @@ BUNinplacemulti(BAT *b, const oid *posit
                                b->trevsorted = false;
                                b->tnorevsorted = nxt;
                        }
-               } else if (b->tnorevsorted >= p)
+               } else if (b->tnorevsorted == p || b->tnorevsorted == p + 1)
                        b->tnorevsorted = 0;
                if (((b->ttype != TYPE_void) & b->tkey) && b->batCount > 1) {
                        BATkey(b, false);
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -767,9 +767,11 @@ la_bat_updates(logger *lg, logaction *la
                                        const void *t = BUNtail(vi, p);
 
                                        if (q < cnt) {
-                                               if (b->tnosorted == q)
+                                               if (b->tnosorted == q ||
+                                                   b->tnosorted == q + 1)
                                                        b->tnosorted = 0;
-                                               if (b->tnorevsorted == q)
+                                               if (b->tnorevsorted == q ||
+                                                   b->tnorevsorted == q + 1)
                                                        b->tnorevsorted = 0;
                                                if (b->tnokey[0] == q ||
                                                    b->tnokey[1] == q) {
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -88,12 +88,13 @@
 #define RMTT_64_OIDS    (1<<3)
 #define RMTT_HGE           (1<<4)
 
+#define MAXTYPE 64
 typedef struct _connection {
        MT_Lock lock;                           /* lock to avoid interference */
        str name;                                       /* the handle for this 
connection */
        Mapi mconn;                                     /* the Mapi handle for 
the connection */
        unsigned char type;                     /* binary profile of the 
connection target */
-       bool int128;                            /* has int128 support */
+       int typemap[MAXTYPE];           /* map types from remote back to local 
types */
        size_t nextid;                          /* id counter */
        struct _connection *next;       /* the next connection in the list */
 } *connection;
@@ -108,7 +109,6 @@ static MT_Lock mal_remoteLock = MT_LOCK_
 
 static connection conns = NULL;
 static unsigned char localtype = 0177;
-static bool int128 = false;
 
 static inline str RMTquery(MapiHdl *ret, const char *func, Mapi conn,
                                                   const char *query);
@@ -284,36 +284,28 @@ RMTconnectScen(str *ret,
        c->next = conns;
        conns = c;
 
-       msg = RMTquery(&hdl, "remote.connect", m, "remote.bintype();");
+       msg = RMTquery(&hdl, "remote.connect", m, "x := inspect.getAtomNames(); 
io.print(x);");
        if (msg) {
                MT_lock_unset(&mal_remoteLock);
                return msg;
        }
-       if (hdl != NULL && mapi_fetch_row(hdl)) {
-               char *val = mapi_fetch_field(hdl, 0);
-               c->type = (unsigned char) atoi(val);
-               mapi_close_handle(hdl);
-       } else {
-               c->type = 0;
+       int i = 0;
+       while (hdl != NULL && mapi_fetch_row(hdl)) {
+               if (i>=MAXTYPE) {
+                       mapi_close_handle(hdl);
+                       GDKfree(c);
+                       mapi_destroy(m);
+                       MT_lock_unset(&mal_remoteLock);
+                       throw(MAL, "remote.connect", "too many types");
+               }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to