Changeset: b7b30d092109 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b7b30d092109
Modified Files:
        .bumpversion.cfg
        MonetDB.spec
        clients/Tests/exports.stable.out
        clients/mapilib/mapi.rc
        clients/odbc/driver/driver.rc
        clients/odbc/winsetup/setup.rc
        cmake/monetdb-versions.cmake
        gdk/libbat.rc
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_support.c
        monetdb5/tools/libmonetdb5.rc
Branch: default
Log Message:

Merge with Sep2022 branch.


diffs (truncated from 459 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -776,3 +776,4 @@ 9785fa2a471fe32495e07479edf110335ddaa750
 26ffeb5af5240c807a6583fd6eb4ee2c9cd210d2 Jan2022_19
 3191fee438036ac0da1e6f31481b9681399123b5 Jan2022_21
 3191fee438036ac0da1e6f31481b9681399123b5 Jan2022_SP4_release
+bdd04053973daa8a786a30e07b2bf1bd8aa6ebf1 Jul2021_27
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
@@ -1336,7 +1336,6 @@ str setScenario(Client c, str nme);
 const char *setVariableRef;
 void setVariableScope(MalBlkPtr mb);
 void setVariableType(MalBlkPtr mb, const int idx, malType type);
-const char *setWriteModeRef;
 const char *set_protocolRef;
 void setprofilerlimit(int limit);
 void showAllScenarios(stream *f);
diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c
--- a/gdk/gdk_cand.c
+++ b/gdk/gdk_cand.c
@@ -1098,6 +1098,8 @@ canditer_slice(const struct canditer *ci
                return BATdense(0, 0, 0);
        if (hi > ci->ncand)
                hi = ci->ncand;
+       if (hi - lo == 1)
+               return BATdense(0, canditer_idx(ci, lo), 1);
        switch (ci->tpe) {
        case cand_materialized:
                if (ci->s) {
diff --git a/gdk/gdk_cross.c b/gdk/gdk_cross.c
--- a/gdk/gdk_cross.c
+++ b/gdk/gdk_cross.c
@@ -36,6 +36,54 @@ BATsubcross(BAT **r1p, BAT **r2p, BAT *l
                return GDK_FAIL;
        }
 
+       /* first some special cases */
+       if (ci1.ncand == 0 || ci2.ncand == 0) {
+               if ((bn1 = BATdense(0, 0, 0)) == NULL)
+                       return GDK_FAIL;
+               if (r2p) {
+                       if ((bn2 = BATdense(0, 0, 0)) == NULL) {
+                               BBPreclaim(bn1);
+                               return GDK_FAIL;
+                       }
+                       *r2p = bn2;
+               }
+               *r1p = bn1;
+               return GDK_SUCCEED;
+       }
+       if (ci2.ncand == 1) {
+               if ((bn1 = canditer_slice(&ci1, 0, ci1.ncand)) == NULL)
+                       return GDK_FAIL;
+               if (r2p) {
+                       if (ci1.ncand == 1) {
+                               bn2 = canditer_slice(&ci2, 0, ci2.ncand);
+                       } else {
+                               bn2 = BATconstant(0, TYPE_oid, &ci2.seq, 
ci1.ncand, TRANSIENT);
+                       }
+                       if (bn2 == NULL) {
+                               BBPreclaim(bn1);
+                               return GDK_FAIL;
+                       }
+                       *r2p = bn2;
+               }
+               *r1p = bn1;
+               return GDK_SUCCEED;
+       }
+       if (ci1.ncand == 1) {
+               bn1 = BATconstant(0, TYPE_oid, &ci1.seq, ci2.ncand, TRANSIENT);
+               if (bn1 == NULL)
+                       return GDK_FAIL;
+               if (r2p) {
+                       bn2 = canditer_slice(&ci2, 0, ci2.ncand);
+                       if (bn2 == NULL) {
+                               BBPreclaim(bn1);
+                               return GDK_FAIL;
+                       }
+                       *r2p = bn2;
+               }
+               *r1p = bn1;
+               return GDK_SUCCEED;
+       }
+
        bn1 = COLnew(0, TYPE_oid, ci1.ncand * ci2.ncand, TRANSIENT);
        if (r2p)
                bn2 = COLnew(0, TYPE_oid, ci1.ncand * ci2.ncand, TRANSIENT);
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -153,7 +153,6 @@ tst401
 tst500
 tst501
 tst560
-tst611
 #tst620  word size problems on different platforms
 tst660
 tst661
diff --git a/monetdb5/mal/Tests/tst611.maltest 
b/monetdb5/mal/Tests/tst611.maltest
deleted file mode 100644
--- a/monetdb5/mal/Tests/tst611.maltest
+++ /dev/null
@@ -1,9 +0,0 @@
-statement error
-function foo();
-RKA:bat[:int]:= bat.new(:int,1048576);
-bat.append(RKA,360:int);
-io.print(RKA);
-#the next one should fail
-bat.setWriteMode(RKB);
-end foo;
-
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -60,11 +60,9 @@ static void logjsonInternal(char *logbuf
        size_t len;
        len = strlen(logbuffer);
 
-       if (maleventstream) {
-               (void) mnstr_write(maleventstream, logbuffer, 1, len);
-               if (flush)
-                       (void) mnstr_flush(maleventstream, MNSTR_FLUSH_DATA);
-       }
+       (void) mnstr_write(maleventstream, logbuffer, 1, len);
+       if (flush)
+               (void) mnstr_flush(maleventstream, MNSTR_FLUSH_DATA);
 }
 
 /*
@@ -295,10 +293,6 @@ prepareMalEvent(Client cntxt, MalBlkPtr 
        clk = pci->clock;
        mclk = (uint64_t)clk - ((uint64_t)startup_time.tv_sec*1000000 - 
(uint64_t)startup_time.tv_usec);
        /* make profile event tuple  */
-       /* TODO: This could probably be optimized somehow to avoid the
-        * function call to mercurial_revision().
-        */
-       // No comma at the beginning
        if (!logadd(&logbuf,
                                "{"                             // fill in 
later with the event counter
                                "\"sessionid\":\"%d\""
@@ -651,8 +645,8 @@ profilerEvent(MalEvent *me, NonMalEvent 
        if (me != NULL && me->cntxt != NULL && getModuleId(me->pci) == myname)
                return;
 
+       MT_lock_set(&mal_profileLock);
        if (maleventstream) {
-               MT_lock_set(&mal_profileLock);
                if (me != NULL && me->mb != NULL && nme == NULL) {
                        if (me->stk == NULL ||
                                me->pci == NULL ||
@@ -669,8 +663,8 @@ profilerEvent(MalEvent *me, NonMalEvent 
                        logjsonInternal(event, true);
                        free(event);
                }
-               MT_lock_unset(&mal_profileLock);
        }
+       MT_lock_unset(&mal_profileLock);
 }
 
 /* The first scheme dumps the events on a stream (and in the pool)
@@ -752,10 +746,11 @@ startProfiler(Client cntxt)
 #endif
        (void) cntxt;
 
+       MT_lock_set(&mal_profileLock);
        if(maleventstream){
+               MT_lock_unset(&mal_profileLock);
                throw(MAL,"profiler.start","Profiler already running, stream 
not available");
        }
-       MT_lock_set(&mal_profileLock);
        if (myname == 0){
                myname = putName("profiler");
        }
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -275,7 +275,6 @@ const char *semijoinRef;
 const char *seriesRef;
 const char *setAccessRef;
 const char *setVariableRef;
-const char *setWriteModeRef;
 const char *set_protocolRef;
 const char *singleRef;
 const char *sinkRef;
@@ -591,7 +590,6 @@ void optimizerInit(void)
        seriesRef = putName("series");
        setAccessRef = putName("setAccess");
        setVariableRef = putName("setVariable");
-       setWriteModeRef= putName("setWriteMode");
        set_protocolRef= putName("set_protocol");
        singleRef = putName("single");
        sinkRef = putName("sink");
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -273,7 +273,6 @@ mal_export  const char *semijoinRef;
 mal_export  const char *seriesRef;
 mal_export  const char *setAccessRef;
 mal_export  const char *setVariableRef;
-mal_export  const char *setWriteModeRef;
 mal_export  const char *set_protocolRef;
 mal_export  const char *singleRef;
 mal_export  const char *sinkRef;
diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -388,8 +388,7 @@ hasSideEffects(MalBlkPtr mb, InstrPtr p,
                return TRUE;
 
        if ( (getModuleId(p) == batRef || getModuleId(p)==sqlRef) &&
-                (getFunctionId(p) == setAccessRef ||
-                 getFunctionId(p) == setWriteModeRef ))
+                (getFunctionId(p) == setAccessRef ))
                return TRUE;
 
        if (getModuleId(p) == malRef && getFunctionId(p) == multiplexRef)
diff --git a/sql/ChangeLog.Sep2022 b/sql/ChangeLog.Sep2022
--- a/sql/ChangeLog.Sep2022
+++ b/sql/ChangeLog.Sep2022
@@ -1,6 +1,26 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Fri Aug 26 2022 Lucas Pereira <lucas.pere...@monetdbsolutions.com>
+- Extended the built-in profiler to emit non-MAL events related to query
+  compilation, optimization, transactions and client connections. To
+  minimize, simplify and optimize the process of generating and processing
+  profiler output, only the events marking the end of an operation are
+  emitted in most cases and the emitted json messages themselves are
+  trimmed down to their essential fields. Furthermore the MAL instruction
+  profiler.openstream now has an overload that takes a single string
+  argument which can be set to "min" to turn on the profiler in minimal
+  mode which causes it to only emit general events and excludes individual
+  MAL instruction execution events from the profiler streams.
+
+* Thu Aug 25 2022 Martin van Dinther <martin.van.dint...@monetdbsolutions.com>
+- Extended system view sys.users with columns: schema_path, max_memory,
+  max_workers, optimizer and default_role.
+  Extended system table sys.db_user_info with columns: schema_path,
+  max_memory, max_workers, optimizer, default_role and password.
+  The password is encrypted. This table can only be queried when the
+  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
 
diff --git a/sql/test/miscellaneous/Tests/unlogged.py 
b/sql/test/miscellaneous/Tests/unlogged.py
--- a/sql/test/miscellaneous/Tests/unlogged.py
+++ b/sql/test/miscellaneous/Tests/unlogged.py
@@ -19,13 +19,16 @@ with tempfile.TemporaryDirectory() as fa
             node1_cur = node1_conn.cursor()
 
             node1_cur.execute("CREATE unlogged TABLE foo (i INT)")
-            if node1_cur.execute("INSERT INTO foo VALUES (10), (20)") != 2:
-                sys.stderr.write("2 rows inserted expected")
-            if node1_cur.execute("UPDATE foo set i = i + 20 WHERE i = 10") != 
1:
-                sys.stderr.write("1 rows updated expected")
+            res = node1_cur.execute("INSERT INTO foo VALUES (10), (20)")
+            if res != 2:
+                sys.stderr.write(f"2 rows inserted expected, {res} received")
+            res = node1_cur.execute("UPDATE foo set i = i + 20 WHERE i = 10")
+            if res != 1:
+                sys.stderr.write(f"1 row updated expected, {res} received")
             node1_cur.execute("SELECT i FROM foo ORDER BY i")
-            if node1_cur.fetchall() != [(20,), (30,)]:
-                sys.stderr.write("[(20), (30)] expected")
+            res = node1_cur.fetchall()
+            if res != [(20,), (30,)]:
+                sys.stderr.write(f"[(20), (30)] expected, {res} received")
             node1_cur.close()
             node1_conn.close()
 
@@ -40,8 +43,9 @@ with tempfile.TemporaryDirectory() as fa
             node1_cur = node1_conn.cursor()
 
             node1_cur.execute("SELECT i FROM foo ORDER BY i")
-            if node1_cur.fetchall() != []:
-                sys.stderr.write("[] expected")
+            res = node1_cur.fetchall()
+            if res != []:
+                sys.stderr.write(f"[] expected, {res} received")
             node1_cur.close()
             node1_conn.close()
 
@@ -59,13 +63,16 @@ with tempfile.TemporaryDirectory() as fa
             node1_cur = node1_conn.cursor()
 
             node1_cur.execute("CREATE unlogged TABLE foo (i) AS VALUES (10), 
(20)")
-            if node1_cur.execute("INSERT INTO foo VALUES (30), (40)") != 2:
-                sys.stderr.write("2 rows inserted expected")
-            if node1_cur.execute("UPDATE foo set i = 50 WHERE i = 10") != 1:
-                sys.stderr.write("1 rows updated expected")
+            res = node1_cur.execute("INSERT INTO foo VALUES (30), (40)")
+            if res != 2:
+                sys.stderr.write(f"2 rows inserted expected, {res} received")
+            res = node1_cur.execute("UPDATE foo set i = 50 WHERE i = 10")
+            if res != 1:
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to