Changeset: 0148ef0dd76a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0148ef0dd76a
Modified Files:
gdk/gdk_join.c
testing/Mtest.py.in
testing/sqltest.py
Branch: default
Log Message:
Merge with Mar2025 branch.
diffs (260 lines):
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3269,7 +3269,6 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
}
/* also set other bits of heap to correct value to indicate size */
BATsetcount(r1, BATcount(r1));
- r1->tunique_est = MIN(li.unique_est, ri.unique_est);
if (BATcount(r1) <= 1) {
r1->tsorted = true;
r1->trevsorted = true;
@@ -3285,13 +3284,11 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
r2->tkey = true;
r2->tseqbase = 0;
}
- r2->tunique_est = MIN(li.unique_est, ri.unique_est);
}
if (r3) {
r3->tnonil = !r3->tnil;
BATsetcount(r3, BATcount(r3));
assert(BATcount(r1) == BATcount(r3));
- r3->tunique_est = MIN(li.unique_est, ri.unique_est);
}
bat_iterator_end(&li);
bat_iterator_end(&ri);
diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c
--- a/monetdb5/modules/mal/mat.c
+++ b/monetdb5/modules/mal/mat.c
@@ -172,7 +172,6 @@ MATpackIncrement(Client cntxt, MalBlkPtr
BBPunfix(b->batCacheid);
throw(MAL, "mat.pack", GDK_EXCEPTION);
}
- bn->tunique_est = b->tunique_est;
bn->unused = (pieces - 1); /* misuse "unused" field */
BBPunfix(b->batCacheid);
if (bn->tnil && bn->tnonil) {
@@ -209,7 +208,6 @@ MATpackIncrement(Client cntxt, MalBlkPtr
throw(MAL, "mat.pack", GDK_EXCEPTION);
}
BBPunfix(bb->batCacheid);
- b->tunique_est += bb->tunique_est;
b->unused--;
if (b->unused == 0 && (b = BATsetaccess(b, BAT_READ)) == NULL)
throw(MAL, "mat.pack", GDK_EXCEPTION);
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2487,19 +2487,21 @@ def stacktrace(proc, outfile):
out = ''
if os.name == 'nt':
sym = ''
- if os.path.exists(r'c:\Program Files\Debugging Tools for Windows
(x64)\cdb.exe'):
- cdb = r'c:\Program Files\Debugging Tools for Windows (x64)\cdb.exe'
+ cdb = r'c:\Program Files\Debugging Tools for Windows (x64)\cdb.exe'
+ if os.path.exists(cdb):
if os.path.exists(r'c:\Symbols'):
sym = r'c:\Symbols;'
- elif os.path.exists(r'c:\Program Files\Debugging Tools for Windows
(x86)\cdb.exe'):
+ else:
cdb = r'c:\Program Files\Debugging Tools for Windows (x86)\cdb.exe'
- if os.path.exists(r'c:\WINDOWS\Symbols'):
- sym = r'c:\WINDOWS\Symbols;'
- else:
- cdb = None
- if cdb:
+ if os.path.exists(cdb):
+ if os.path.exists(r'c:\WINDOWS\Symbols'):
+ sym = r'c:\WINDOWS\Symbols;'
+ else:
+ cdb = None
+ if cdb is not None:
with process.Popen([cdb, '-pv', '-p', str(proc.pid),
- '-y',
f'{sym}cache*;srv*http://msdl.microsoft.com/download/symbols', '-lines', '-c',
'~*kP;!locks;q'],
+ '-y',
f'{sym}cache*;srv*http://msdl.microsoft.com/download/symbols',
+ '-lines', '-c', '~*kP;!locks;q'],
stdout=process.PIPE, text=True) as p:
try:
out, err = p.communicate(timeout=60)
@@ -2507,7 +2509,9 @@ def stacktrace(proc, outfile):
p.kill()
elif platform.system() == 'Darwin':
try:
- with process.Popen(['lldb', '--attach-pid', str(proc.pid),
'--batch', '--one-line', 'bt all'], stdout=process.PIPE, text=True) as p:
+ with process.Popen(['lldb', '--attach-pid', str(proc.pid),
+ '--batch', '--one-line', 'bt all'],
+ stdout=process.PIPE, text=True) as p:
try:
out, err = p.communicate(timeout=60)
except process.TimeoutExpired:
@@ -2518,18 +2522,17 @@ def stacktrace(proc, outfile):
pass
else:
try:
- with process.Popen(['gdb', '-n', '-p', str(proc.pid), '-batch',
'-ex', 'thread apply all bt full'], stdout=process.PIPE,
- text=True) as p:
+ with process.Popen(['gdb', '-n', '-p', str(proc.pid),
+ '-batch', '-ex', 'thread apply all bt full'],
+ stdout=process.PIPE, text=True) as p:
try:
- out, err = p.communicate(timeout=60)
+ out, err = p.communicate(timeout=600)
except process.TimeoutExpired:
# gdb sometimes hangs when trying to get the stack
# trace: kill it mercilessly if it does
p.kill()
p.wait()
- out = err = ''
- if t is not None:
- t.cancel()
+ out = ''
except KeyboardInterrupt:
raise
except:
diff --git a/testing/sqltest.py b/testing/sqltest.py
--- a/testing/sqltest.py
+++ b/testing/sqltest.py
@@ -10,30 +10,33 @@
import os
import sys
-import unittest
import pymonetdb
import difflib
from abc import ABCMeta, abstractmethod
import MonetDBtesting.process as process
import inspect
-
-TSTDB=os.getenv("TSTDB")
-MAPIPORT=os.getenv("MAPIPORT")
-TIMEOUT=int(os.getenv("TIMEOUT", "0"))
-
from pathlib import Path
from typing import Optional
+
+TSTDB = os.getenv("TSTDB")
+MAPIPORT = os.getenv("MAPIPORT")
+TIMEOUT = int(os.getenv("TIMEOUT", "0"))
+
+
class UnsafeDirectoryHandler(pymonetdb.SafeDirectoryHandler):
def secure_resolve(self, filename: str) -> Optional[Path]:
return Path(filename).resolve()
+
transfer_handler = UnsafeDirectoryHandler('.')
+
def equals(a, b) -> bool:
if type(a) is type(b):
- return a==b
+ return a == b
return False
+
def sequence_match(left=[], right=[], index=0):
right = right[index:]
ll = len(left)
@@ -47,6 +50,7 @@ def sequence_match(left=[], right=[], in
return False
return True
+
def get_index_mismatch(left=[], right=[]):
ll = len(left)
rl = len(right)
@@ -57,6 +61,7 @@ def get_index_mismatch(left=[], right=[]
break
return index
+
def piped_representation(data=[]):
def mapfn(next):
if type(next) is tuple:
@@ -69,16 +74,20 @@ def piped_representation(data=[]):
res = list(map(mapfn, data))
return '\n'.join(res)
+
def filter_junk(s: str):
"""filters empty strings and comments
"""
s = s.strip()
- if s.startswith('--') or s.startswith('#') or s.startswith('stdout of
test'):
+ if s.startswith('--') \
+ or s.startswith('#') \
+ or s.startswith('stdout of test'):
return False
if s == '':
return False
return True
+
def filter_headers(s: str):
"""filter lines prefixed with % (MAPI headers)"""
s = s.strip()
@@ -88,6 +97,7 @@ def filter_headers(s: str):
return False
return True
+
def filter_lines_starting_with(predicates=[]):
def _fn(line:str):
line = line.strip()
@@ -115,15 +125,17 @@ def filter_matching_blocks(a: [str] = []
red_a.append(a[i])
red_b.append(b[i])
# keep track of last mismatch to add some ctx in between
- ptr = i
+# ptr = i
# add trailing data if len(a) != len(b)
- red_a+=a[min_size:]
- red_b+=b[min_size:]
+ red_a += a[min_size:]
+ red_b += b[min_size:]
return red_a, red_b
+
def diff(stable_file, test_file, ratio=0.95):
diff = None
- filter_fn = filter_lines_starting_with(['--', '#', 'stdout of test',
'stderr of test', 'MAPI'])
+ filter_fn = filter_lines_starting_with(['--', '#', 'stdout of test',
+ 'stderr of test', 'MAPI'])
with open(stable_file) as fstable:
stable = list(filter(filter_fn, fstable.read().split('\n')))
with open(test_file) as ftest:
@@ -136,6 +148,7 @@ def diff(stable_file, test_file, ratio=0
diff = None
return diff
+
class PyMonetDBConnectionContext(object):
def __init__(self,
username='monetdb', password='monetdb',
@@ -203,22 +216,24 @@ class PyMonetDBConnectionContext(object)
self.dbh.close()
self.dbh = None
+
class RunnableTestResult(metaclass=ABCMeta):
"""Abstract class for sql result"""
did_run = False
@abstractmethod
- def run(self, query:str, *args, stdin=None, lineno=None):
+ def run(self, query: str, *args, stdin=None, lineno=None):
"""Run query with specific client"""
pass
+
class TestCaseResult(object):
"""TestCase connected result"""
test_case = None
def __init__(self, test_case, **kwargs):
self.test_case = test_case
- self.assertion_errors = [] # holds assertion errors
+ self.assertion_errors = [] # holds assertion errors
self.query = None
self.test_run_error = None
self.err_code = None
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]