Changeset: 19771cb5c15e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/19771cb5c15e
Modified Files:
        MonetDB.spec
Branch: default
Log Message:

Merge with Sep2022 branch.


diffs (150 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -355,6 +355,9 @@ developer.
 
 %files client-tests
 %defattr(-,root,root)
+%{_bindir}/ODBCStmtAttr
+%{_bindir}/ODBCgetInfo
+%{_bindir}/ODBCmetadata
 %{_bindir}/arraytest
 %{_bindir}/bincopydata
 %{_bindir}/odbcsample1
@@ -366,8 +369,6 @@ developer.
 %{_bindir}/smack01
 %{_bindir}/streamcat
 %{_bindir}/testcondvar
-%{_bindir}/testgetinfo
-%{_bindir}/testStmtAttr
 %{_bindir}/malsample.pl
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -83,7 +83,7 @@ SQLhelp sqlhelp1[] = {
         "ALTER USER SET [ENCRYPTED | UNENCRYPTED] PASSWORD string USING OLD 
PASSWORD string\n"
         "ALTER USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string\n"
         "ALTER USER ident [WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string] SET 
SCHEMA ident\n"
-        "ALTER USER ident [WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string] 
SCHEMA PATH string",
+        "ALTER USER ident [WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string] 
SCHEMA PATH string [DEFAULT ROLE ident]",
         "ident",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-definition/privileges/"},
        {"ANALYZE",
@@ -237,7 +237,8 @@ SQLhelp sqlhelp1[] = {
         NULL},
        {"CREATE USER",
         "Create a new database user",
-        "CREATE USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string NAME 
string SCHEMA ident [SCHEMA PATH string]",
+        "CREATE USER ident WITH [ENCRYPTED | UNENCRYPTED] PASSWORD string NAME 
string SCHEMA ident [SCHEMA PATH string]\n"
+        "[MAX_MEMORY poslng] [MAX_WORKERS posint] [OPTIMIZER string] [DEFAULT 
ROLE ident]",
         "ident",
         "See also 
https://www.monetdb.org/documentation/user-guide/sql-manual/data-definition/privileges/"},
        {"CREATE VIEW",
diff --git a/debian/monetdb-client-testing.install 
b/debian/monetdb-client-testing.install
--- a/debian/monetdb-client-testing.install
+++ b/debian/monetdb-client-testing.install
@@ -1,3 +1,6 @@
+debian/tmp/usr/bin/ODBCStmtAttr usr/bin
+debian/tmp/usr/bin/ODBCgetInfo usr/bin
+debian/tmp/usr/bin/ODBCmetadata usr/bin
 debian/tmp/usr/bin/arraytest usr/bin
 debian/tmp/usr/bin/bincopydata usr/bin
 debian/tmp/usr/bin/odbcsample1 usr/bin
@@ -8,8 +11,7 @@ debian/tmp/usr/bin/shutdowntest usr/bin
 debian/tmp/usr/bin/smack00 usr/bin
 debian/tmp/usr/bin/smack01 usr/bin
 debian/tmp/usr/bin/streamcat usr/bin
-debian/tmp/usr/bin/testgetinfo usr/bin
-debian/tmp/usr/bin/testStmtAttr usr/bin
+debian/tmp/usr/bin/testcondvar usr/bin
 debian/tmp/usr/bin/malsample.pl usr/bin
 debian/tmp/usr/bin/sqlsample.php usr/bin
 debian/tmp/usr/bin/sqlsample.pl usr/bin
diff --git a/sql/ChangeLog.Sep2022 b/sql/ChangeLog.Sep2022
--- a/sql/ChangeLog.Sep2022
+++ b/sql/ChangeLog.Sep2022
@@ -22,7 +22,9 @@
   user has been granted the select privilege from monetdb.
 
 * Fri Aug 19 2022 svetlin <svetlin.stali...@monetdbsolutions.com>
-- Added default role to create user statement
+- CREATE USER statement has been extended to take more optional arguments
+  like MAX_MEMORY, MAX_WORKERS, OPTIMIZER, DEFAULT ROLE. ALTER USER statement
+  has also been extended with DEFAULT ROLE.
 
 * Mon Aug 15 2022 Sjoerd Mullender <sjo...@acm.org>
 - A new function sys.url_extract_host(string, bool) which returns the
diff --git a/sql/backends/monet5/UDF/pyapi3/pyapi3.c 
b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyapi3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
@@ -1383,12 +1383,36 @@ static str
 PYAPI3PyAPIprelude(void) {
        MT_lock_set(&pyapiLock);
        if (!pyapiInitialized) {
-               wchar_t* program = Py_DecodeLocale("mserver5", NULL);
-               wchar_t* argv[] = { program };
+               wchar_t* program = L"mserver5";
+               wchar_t* argv[] = { program, NULL };
                str msg = MAL_SUCCEED;
                PyObject *tmp;
+
+               static_assert(PY_MAJOR_VERSION == 3, "Python 3.X required");
+#if PY_MINOR_VERSION >= 9
+               /* introduced in 3.8, we use it for 3.9 and later */
+               PyStatus status;
+               PyConfig config;
+
+               PyConfig_InitPythonConfig(&config);
+               config.isolated = 1;
+               status = PyConfig_SetArgv(&config, 1, argv);
+               if (PyStatus_Exception(status)) {
+                       MT_lock_unset(&pyapiLock);
+                       throw(MAL, "pyapi3.eval", SQLSTATE(PY000) "Python 
initialization failed.");
+               }
+               status = Py_InitializeFromConfig(&config);
+               if (PyStatus_Exception(status)) {
+                       MT_lock_unset(&pyapiLock);
+                       throw(MAL, "pyapi3.eval", SQLSTATE(PY000) "Python 
initialization failed.");
+               }
+               PyConfig_Clear(&config);
+#else
+               /* PySys_SetArgvEx deprecated in 3.11 */
                Py_Initialize();
                PySys_SetArgvEx(1, argv, 0);
+#endif
+
                _import_array();
                msg = _connection_init();
                if (msg != MAL_SUCCEED) {
diff --git a/sql/backends/monet5/UDF/pyapi3/type_conversion3.c 
b/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
--- a/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
+++ b/sql/backends/monet5/UDF/pyapi3/type_conversion3.c
@@ -10,7 +10,11 @@
 #include "type_conversion.h"
 #include "unicode.h"
 
+#if PY_MINOR_VERSION >= 11
+#include <cpython/longintrepr.h>
+#else
 #include <longintrepr.h>
+#endif
 
 bool pyapi3_string_copy(const char *source, char *dest, size_t max_size, bool 
allow_unicode)
 {
@@ -51,8 +55,13 @@ PyObject *PyLong_FromHge(hge h)
                prev = prev - ((prev >> (PyLong_SHIFT * i)) << (PyLong_SHIFT * 
i));
                z->ob_digit[i] = result;
        }
-       if (h < 0)
+       if (h < 0) {
+#if PY_MINOR_VERSION >= 9
+               Py_SET_SIZE(z, -Py_SIZE(z));
+#else
                Py_SIZE(z) = -(Py_SIZE(z));
+#endif
+       }
        return (PyObject *)z;
 }
 #endif
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to