Changeset: d03ca7aa07a0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d03ca7aa07a0
Modified Files:
gdk/gdk_bbp.c
Branch: default
Log Message:
Merge with Dec2023 branch.
diffs (163 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4875,9 +4875,14 @@ BBPprintinfo(void)
ATOMIC_BASE_TYPE status = BBP_status(i);
struct counters *bt = &bats[r > 0][BATdirty(b)][(status
& BBPPERSISTENT) != 0][(status & BBPLOADED) != 0][(status & BBPHOT) != 0];
bt->nr++;
- bt->sz += HEAPmemsize(b->theap) +
HEAPmemsize(b->tvheap);
- bt->vmsz += HEAPvmsize(b->theap) +
HEAPvmsize(b->tvheap);
- MT_lock_unset(&b->theaplock);
+ if (b->theap && b->batCacheid == b->theap->parentid) {
+ bt->sz += HEAPmemsize(b->theap);
+ bt->vmsz += HEAPvmsize(b->theap);
+ }
+ if (b->tvheap && b->batCacheid == b->tvheap->parentid) {
+ bt->sz += HEAPmemsize(b->tvheap);
+ bt->vmsz += HEAPvmsize(b->tvheap);
+ }
MT_lock_unset(&b->theaplock);
}
MT_lock_unset(&GDKswapLock(i));
diff --git a/misc/python/fixlicense.py b/misc/python/fixlicense.py
--- a/misc/python/fixlicense.py
+++ b/misc/python/fixlicense.py
@@ -141,7 +141,7 @@ def getcomments(file, pre=None, post=Non
f = open(file) # can raise IOError
line = f.readline()
f.close()
- if line[:2] == '#!':
+ if line.startswith('#!'):
if 'bash' in line or '/sh' in line:
ext = '.sh'
elif 'python' in line or 'PYTHON' in line:
@@ -236,7 +236,7 @@ def addlicense(file, pre=None, post=None
if pre:
g.write(pre + '\n')
for l in license:
- if l[:1] == '\t' or (not l and (not end or end[:1] == '\t')):
+ if l.startswith('\t') or (not l and (not end or
end.startswith('\t'))):
# if text after start begins with tab, remove spaces from start
g.write(start.rstrip() + l + end + '\n')
else:
diff --git
a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
--- a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
+++ b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
@@ -36,7 +36,8 @@ class Client(threading.Thread):
def output(self):
if self.error == 0 and self.result != [(1,), (2,), (3,), (4,), (5,),
(6,), (7,), (8,), (9,), (0,)]:
- sys.stderr.write('[(1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,),
(9,), (0,)] expected')
+ print(f'received: {self.result}', file=sys.stderr)
+ print('expected: [(1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,),
(9,), (0,)]', file=sys.stderr)
def main():
C = []
diff --git a/sql/test/mapi/Tests/python3_dec38.SQL.bat
b/sql/test/mapi/Tests/python3_dec38.SQL.bat
deleted file mode 100755
--- a/sql/test/mapi/Tests/python3_dec38.SQL.bat
+++ /dev/null
@@ -1,9 +0,0 @@
-@echo off
-
-rem must be aligned with the installation directory chosen in
-rem clients/python/test/Makefile.ag
-set testpath=%TSTSRCDIR%
-
-prompt # $t $g
-
-"%PYTHON%" "%testpath%/python_dec38.py %MAPIPORT% %TSTDB% %MAPIHOST%"
diff --git a/sql/test/mapi/Tests/python_dec38.py
b/sql/test/mapi/Tests/python3_dec38.SQL.py
rename from sql/test/mapi/Tests/python_dec38.py
rename to sql/test/mapi/Tests/python3_dec38.SQL.py
--- a/sql/test/mapi/Tests/python_dec38.py
+++ b/sql/test/mapi/Tests/python3_dec38.SQL.py
@@ -11,10 +11,10 @@
# Copyright 1997 - July 2008 CWI.
import pymonetdb
-import sys
+import sys, os
from decimal import Decimal
-dbh =
pymonetdb.connect(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True)
+dbh =
pymonetdb.connect(port=int(os.getenv('MAPIPORT')),database=os.getenv('TSTDB'),hostname=os.getenv('MAPIHOST'),autocommit=True)
cursor = dbh.cursor()
diff --git a/sql/test/mapi/Tests/python3_dec38.SQL.sh
b/sql/test/mapi/Tests/python3_dec38.SQL.sh
deleted file mode 100755
--- a/sql/test/mapi/Tests/python3_dec38.SQL.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# must be aligned with the installation directory chosen in
-# clients/python/test/Makefile.ag
-testpath="$TSTSRCDIR"
-
-${PYTHON} $testpath/python_dec38.py $MAPIPORT $TSTDB $MAPIHOST
diff --git a/sql/test/mapi/Tests/python3_int128.SQL.bat
b/sql/test/mapi/Tests/python3_int128.SQL.bat
deleted file mode 100755
--- a/sql/test/mapi/Tests/python3_int128.SQL.bat
+++ /dev/null
@@ -1,9 +0,0 @@
-@echo off
-
-rem must be aligned with the installation directory chosen in
-rem clients/python/test/Makefile.ag
-set testpath=%TSTSRCDIR%
-
-prompt # $t $g
-
-"%PYTHON%" "%testpath%/python_int128.py %MAPIPORT% %TSTDB% %MAPIHOST%"
diff --git a/sql/test/mapi/Tests/python_int128.py
b/sql/test/mapi/Tests/python3_int128.SQL.py
rename from sql/test/mapi/Tests/python_int128.py
rename to sql/test/mapi/Tests/python3_int128.SQL.py
--- a/sql/test/mapi/Tests/python_int128.py
+++ b/sql/test/mapi/Tests/python3_int128.SQL.py
@@ -11,9 +11,9 @@
# Copyright 1997 - July 2008 CWI.
import pymonetdb
-import sys
+import sys, os
-dbh =
pymonetdb.connect(port=int(sys.argv[1]),database=sys.argv[2],hostname=sys.argv[3],autocommit=True)
+dbh =
pymonetdb.connect(port=int(os.getenv('MAPIPORT')),database=os.getenv('TSTDB'),hostname=os.getenv('MAPIHOST'),autocommit=True)
cursor = dbh.cursor()
diff --git a/sql/test/mapi/Tests/python3_int128.SQL.sh
b/sql/test/mapi/Tests/python3_int128.SQL.sh
deleted file mode 100755
--- a/sql/test/mapi/Tests/python3_int128.SQL.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# must be aligned with the installation directory chosen in
-# clients/python/test/Makefile.ag
-testpath="$TSTSRCDIR"
-
-${PYTHON} $testpath/python_int128.py $MAPIPORT $TSTDB $MAPIHOST
diff --git a/testing/malmapi.py b/testing/malmapi.py
--- a/testing/malmapi.py
+++ b/testing/malmapi.py
@@ -69,7 +69,7 @@ def handle_error(error):
"""
- if error[:13] == 'SQLException:':
+ if error.startswith('SQLException:'):
idx = str.index(error, ':', 14)
error = error[idx + 10:]
if len(error) > 5 and error[:5] in errors:
@@ -104,7 +104,7 @@ class Connection(object):
unix_socket is used if hostname is not defined.
"""
- if hostname and hostname[:1] == '/' and not unix_socket:
+ if hostname and hostname.startswith('/') and not unix_socket:
unix_socket = '%s/.s.monetdb.%d' % (hostname, port)
hostname = None
if not unix_socket and os.path.exists("/tmp/.s.monetdb.%i" % port):
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]