Changeset: af4e06649a72 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/af4e06649a72
Modified Files:
        gdk/gdk_bbp.c
        testing/Mtest.py.in
Branch: ustr
Log Message:

Merge with default branch.


diffs (101 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -573,8 +573,7 @@ heapinit(BAT *b, const char *buf,
        b->tnosorted = (BUN) nosorted;
        b->tnorevsorted = (BUN) norevsorted;
        b->tunique_est = 0.0;
-       /* (properties & 0x0200) is the old tdense flag */
-       b->tseqbase = (properties & 0x0200) == 0 || base >= (uint64_t) oid_nil 
? oid_nil : (oid) base;
+       b->tseqbase = base >= (uint64_t) oid_nil ? oid_nil : (oid) base;
        b->theap->free = (size_t) free;
        b->theap->hasfile = free > 0;
        /* set heap size to match capacity */
@@ -2125,7 +2124,6 @@ heap_entry(FILE *fp, BATiter *bi, BUN si
                       (((uint16_t) bi->sorted << 0) |
                        ((uint16_t) bi->revsorted << 7) |
                        ((uint16_t) bi->key << 8) |
-                       ((uint16_t) BATtdensebi(bi) << 9) |
                        ((uint16_t) bi->nonil << 10) |
                        ((uint16_t) bi->nil << 11) |
                        ((uint16_t) bi->ascii << 12) |
diff --git a/sql/test/mapi/Tests/python3_dbapi.SQL.bat 
b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
--- a/sql/test/mapi/Tests/python3_dbapi.SQL.bat
+++ b/sql/test/mapi/Tests/python3_dbapi.SQL.bat
@@ -4,4 +4,4 @@ rem must be aligned with the installatio
 rem clients/examples/python
 set testpath=%TSTSRCBASE%\clients\examples\python
 
-sqlsample.py %MAPIPORT% %TSTDB% %MAPIHOST%
+"%PYTHON%" "%testpath%\sqlsample.py" %MAPIPORT% %TSTDB% %MAPIHOST%
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -75,8 +75,22 @@ def prgreen(str):
     print(str, end='')
 def prpurple(str):
     print(str, end='')
+use_esc = False
 if isatty:
-    if os.name != 'nt':
+    if os.name == 'nt':
+        try:
+            import ctypes
+            kernel32 = ctypes.windll.kernel32
+            origmode = ctypes.c_long()
+            handle = kernel32.GetStdHandle(-11) # STD_OUTPUT_HANDLE
+            if kernel32.GetConsoleMode(handle, ctypes.byref(origmode)):
+                if kernel32.SetConsoleMode(handle, origmode.value | 0x0004):
+                    use_esc = True
+        except (ImportError, AttributeError):
+            pass
+    else:
+        use_esc = True
+    if use_esc:
         # color output a little
         RED = '\033[1;31m'
         GREEN = '\033[0;32m'
@@ -3024,33 +3038,31 @@ def mapi_ping(port, host='localhost', tr
 
 
 threadids = {}
-up = '\033[A'
-down = '\033[B'
 
 
 def progress(count, errors, total, test, spaces=' '*(ttywidth or 100)):
     errs = '\r'
-    if os.name == 'nt':
-        nl = ''
-        line = 0
-    else:
+    if use_esc:
         tid = threading.get_ident()
-        nl = ''
         if tid not in threadids:
             threadids[tid] = len(threadids)
             nl = '\n'
+        else:
+            nl = ''
         line = len(threadids) - threadids[tid]
-        if errors == 1:
-            errs = f'\r{errors} error'
-        elif errors > 1:
-            errs = f'\r{errors} errors'
+        if errors:
+            errs = f'\r{errors} error{"" if errors == 1 else "s"}'
+        up = f'\033[{line}A' if line > 1 else '\033[A'
+        down = f'\033[{line}B' if line > 1 else '\033[B'
+    else:
+        nl = up = down = ''
     perc = int(count*100/total) if total and count else 0
     width = len(str(total))
     s = f'[{count:{width}}/{total}] ({perc:2}%)    {test}'
     if len(s) > ttywidth:
         test = test[len(s)-ttywidth:]
         s = f'[{count:{width}}/{total}] ({perc:2}%)    {test}'
-    sys.stdout.write(nl + '\r' + up*line + spaces + '\r' + s + down*line + 
errs)
+    sys.stdout.write(nl + '\r' + up + spaces + '\r' + s + down + errs)
 
 
 def DoIt(env, SERVER, CALL, TST, EXT, TestOutFile, TestErrFile, TIMEOUT, ME, 
length, nomito, threads, user, passwd, COND, PSRVR, total_tests, options, 
TSTDB, TSTDIR, TSTTRGDIR, TSTSRCDIR, environ):
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to