MonetDB: nested - Insert multiset value in sys.args during upgrade.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: cb85ca0f2317 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cb85ca0f2317
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: nested
Log Message:

Insert multiset value in sys.args during upgrade.


diffs (53 lines):

diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -100,14 +100,14 @@ sql_fix_system_tables(Client c, mvc *sql
" values"
" (%d, %d, 'res_%d',"
" '%s', %u, %u, %d,"
-   " %d);\n",
+   " %d, %d);\n",
store_next_oid(store),
func->base.id,
number,
arg->type.type->base.name,
arg->type.digits,
arg->type.scale,
-   arg->inout, number);
+   arg->inout, number, 
arg->type.multiset);
}
}
for (m = func->ops->h; m; m = m->next, number++) {
@@ -117,28 +117,28 @@ sql_fix_system_tables(Client c, mvc *sql
"insert into sys.args"
" values"
" (%d, %d, '%s', '%s',"
-   " %u, %u, %d, %d);\n",
+   " %u, %u, %d, %d, %d);\n",
store_next_oid(store),
func->base.id,
arg->name,
arg->type.type->base.name,
arg->type.digits,
arg->type.scale,
-   arg->inout, number);
+   arg->inout, number, 
arg->type.multiset);
else
pos += snprintf(buf + pos, bufsize - pos,
"insert into sys.args"
" values"
" (%d, %d, 'arg_%d',"
" '%s', %u, %u, %d,"
-   " %d);\n",
+   " %d, %d);\n",
store_next_oid(store),
func->base.id,
number,
arg->type.type->base.name,
arg->type.digits,
arg->type.scale,
-   arg->inout, number);
+   arg->inout, number, 
arg->type.multiset);
}
}
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Cleanup.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: c2b436b7ce87 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c2b436b7ce87
Modified Files:
testing/Mtest.py.in
Branch: Aug2024
Log Message:

Cleanup.
- removed some unused functions and one that didn't do anything;
- changed format methods to format strings;
- removed commented-out code and todos.


diffs (truncated from 746 to 300 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -168,57 +168,6 @@ if os.path.exists('/usr/bin/coredumpctl'
 # if we can't raise the limit, just forget it
 pass
 
-def _configure(str):
-# expand configure variables in str and return result
-config = [
-('{source}', '@QXSOURCE@'),
-('${build}', '@QXBUILD@'),
-
-('${bindir}', '@QXbindir@'),
-##('${sbindir}', '@QXsbindir@'),
-('${libexecdir}', '@QXlibexecdir@'),
-('${datarootdir}', '@QXdatarootdir@'),
-('${datadir}', '@QXdatadir@'),
-('${sysconfdir}', '@QXsysconfdir@'),
-('${localstatedir}', '@QXlocalstatedir@'),
-('${libdir}', '@QXlibdir@'),
-('${includedir}', '@QXincludedir@'),
-##('${oldincludedir}', '@QXoldincludedir@'),
-('${infodir}', '@QXinfodir@'),
-('${mandir}', '@QXmandir@'),
-('${Qbindir}', '@QXbindir@'),
-##('${Qsbindir}', '@QXsbindir@'),
-('${Qlibexecdir}', '@QXlibexecdir@'),
-('${Qdatarootdir}', '@QXdatarootdir@'),
-('${Qdatadir}', '@QXdatadir@'),
-('${Qsysconfdir}', '@QXsysconfdir@'),
-('${Qlocalstatedir}', '@QXlocalstatedir@'),
-('${Qlibdir}', '@QXlibdir@'),
-('${Qincludedir}', '@QXincludedir@'),
-##('${Qoldincludedir}', '@QXoldincludedir@'),
-('${Qinfodir}', '@QXinfodir@'),
-('${Qmandir}', '@QXmandir@'),
-# put these at end (in this order!) for efficiency
-('${exec_prefix}', '@QXexec_prefix@'),
-('${Qexec_prefix}', '@QXexec_prefix@'),
-('${prefix}', '@QXprefix@'),
-('${Qprefix}', '@QXprefix@'),
-]
-if os.name == 'nt':
-str = str.replace('%prefix%', '${prefix}')
-str = str.replace('%exec_prefix%', '${exec_prefix}')
-changed = True
-while '$' in str and changed:
-changed = False
-for key, val in config:
-if os.name == 'nt':
-val = val.replace('%prefix%', '${prefix}')
-val = val.replace('%exec_prefix%', '${exec_prefix}')
-nstr = str.replace(key, val)
-changed = changed or str != nstr
-str = nstr
-return str
-
 # use our own process module (instead of subprocess) because it has
 # _BufferedPipe
 try:
@@ -227,7 +176,7 @@ except ImportError:
 try:
 import MonetDBtesting.process as process
 except ImportError:
-p = _configure(os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@'))
+p = os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@')
 sys.path.insert(0, p)
 import MonetDBtesting.process as process
 if 'PYTHONPATH' in os.environ:
@@ -319,9 +268,9 @@ def remove(file):
 if platform.system() in ('Windows', 'Darwin'):
 shutil.rmtree(file, ignore_errors=True)
 else:
-Warn('could not remove {}'.format(file))
+Warn(f'could not remove {file}')
 except:
-Warn('could not remove {}'.format(file))
+Warn(f'could not remove {file}')
 
 def isexecutable(TST, ext = '.sh') :
 if   os.name == "nt":
@@ -331,15 +280,10 @@ def isexecutable(TST, ext = '.sh') :
 if os.path.isfile(TST+ext) or os.path.isfile(TST+ext+".src"):
 return (True, ext)
 elif os.name == "posix":
-#TODO:
-# check with "file", and set executable
 TST += ext
 if ( os.path.isfile(TST   ) and os.access(TST   ,os.X_OK) ) or 
\
( os.path.isfile(TST+".src") and os.access(TST+".src",os.X_OK) ):
 return (True, ext)
-#TODO:
-#else:
-# ???
 return (False, '')
 ### isexecutable(TST, ext = '.sh') #
 
@@ -615,17 +559,6 @@ stylesheet = Element('style', None, Text
 
 TIMES = []
 
-#TODO:
-#class TimeoutError:
-#   def __init__(self, text):
-#   self.text = text
-#   def __str__(self):
-#   return self.text
-#
-#def AlarmHandler(signum, frame) :
-#   raise TimeoutError, "Timeout"
- AlarmHandler(signum, frame) #
-
 def ErrMsg(TEXT) :
 print(end='', flush=True)
 print("\n%s:  ERROR:  %s\n" % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
@@ -651,12 +584,6 @@ def startswithpath(str,pre) :
 return os.path.normcase(str[:len(pre)]) == os.path.normcase(pre)
 ### startswithpath(str,pre) #
 
-##def path(str) :
-##return str.replace('/', os.sep)
-### path(str) #
-##def url(str) :
-##return str.replace(os.sep, '/')
-### url(str) #
 import urllib.request, urllib.parse
 path = urllib.request.url2pathname
 

MonetDB: default - Merge with Aug2024 branch.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: bb55959a22ab for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bb55959a22ab
Modified Files:
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 747 to 300 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -168,57 +168,6 @@ if os.path.exists('/usr/bin/coredumpctl'
 # if we can't raise the limit, just forget it
 pass
 
-def _configure(str):
-# expand configure variables in str and return result
-config = [
-('{source}', '@QXSOURCE@'),
-('${build}', '@QXBUILD@'),
-
-('${bindir}', '@QXbindir@'),
-##('${sbindir}', '@QXsbindir@'),
-('${libexecdir}', '@QXlibexecdir@'),
-('${datarootdir}', '@QXdatarootdir@'),
-('${datadir}', '@QXdatadir@'),
-('${sysconfdir}', '@QXsysconfdir@'),
-('${localstatedir}', '@QXlocalstatedir@'),
-('${libdir}', '@QXlibdir@'),
-('${includedir}', '@QXincludedir@'),
-##('${oldincludedir}', '@QXoldincludedir@'),
-('${infodir}', '@QXinfodir@'),
-('${mandir}', '@QXmandir@'),
-('${Qbindir}', '@QXbindir@'),
-##('${Qsbindir}', '@QXsbindir@'),
-('${Qlibexecdir}', '@QXlibexecdir@'),
-('${Qdatarootdir}', '@QXdatarootdir@'),
-('${Qdatadir}', '@QXdatadir@'),
-('${Qsysconfdir}', '@QXsysconfdir@'),
-('${Qlocalstatedir}', '@QXlocalstatedir@'),
-('${Qlibdir}', '@QXlibdir@'),
-('${Qincludedir}', '@QXincludedir@'),
-##('${Qoldincludedir}', '@QXoldincludedir@'),
-('${Qinfodir}', '@QXinfodir@'),
-('${Qmandir}', '@QXmandir@'),
-# put these at end (in this order!) for efficiency
-('${exec_prefix}', '@QXexec_prefix@'),
-('${Qexec_prefix}', '@QXexec_prefix@'),
-('${prefix}', '@QXprefix@'),
-('${Qprefix}', '@QXprefix@'),
-]
-if os.name == 'nt':
-str = str.replace('%prefix%', '${prefix}')
-str = str.replace('%exec_prefix%', '${exec_prefix}')
-changed = True
-while '$' in str and changed:
-changed = False
-for key, val in config:
-if os.name == 'nt':
-val = val.replace('%prefix%', '${prefix}')
-val = val.replace('%exec_prefix%', '${exec_prefix}')
-nstr = str.replace(key, val)
-changed = changed or str != nstr
-str = nstr
-return str
-
 # use our own process module (instead of subprocess) because it has
 # _BufferedPipe
 try:
@@ -227,7 +176,7 @@ except ImportError:
 try:
 import MonetDBtesting.process as process
 except ImportError:
-p = _configure(os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@'))
+p = os.path.join('@QXprefix@', '@QXPYTHON_LIBDIR@')
 sys.path.insert(0, p)
 import MonetDBtesting.process as process
 if 'PYTHONPATH' in os.environ:
@@ -319,9 +268,9 @@ def remove(file):
 if platform.system() in ('Windows', 'Darwin'):
 shutil.rmtree(file, ignore_errors=True)
 else:
-Warn('could not remove {}'.format(file))
+Warn(f'could not remove {file}')
 except:
-Warn('could not remove {}'.format(file))
+Warn(f'could not remove {file}')
 
 def isexecutable(TST, ext = '.sh') :
 if   os.name == "nt":
@@ -331,15 +280,10 @@ def isexecutable(TST, ext = '.sh') :
 if os.path.isfile(TST+ext) or os.path.isfile(TST+ext+".src"):
 return (True, ext)
 elif os.name == "posix":
-#TODO:
-# check with "file", and set executable
 TST += ext
 if ( os.path.isfile(TST   ) and os.access(TST   ,os.X_OK) ) or 
\
( os.path.isfile(TST+".src") and os.access(TST+".src",os.X_OK) ):
 return (True, ext)
-#TODO:
-#else:
-# ???
 return (False, '')
 ### isexecutable(TST, ext = '.sh') #
 
@@ -615,17 +559,6 @@ stylesheet = Element('style', None, Text
 
 TIMES = []
 
-#TODO:
-#class TimeoutError:
-#   def __init__(self, text):
-#   self.text = text
-#   def __str__(self):
-#   return self.text
-#
-#def AlarmHandler(signum, frame) :
-#   raise TimeoutError, "Timeout"
- AlarmHandler(signum, frame) #
-
 def ErrMsg(TEXT) :
 print(end='', flush=True)
 print("\n%s:  ERROR:  %s\n" % (THISFILE, TEXT), file=sys.stderr, 
flush=True)
@@ -651,12 +584,6 @@ def startswithpath(str,pre) :
 return os.path.normcase(str[:len(pre)]) == os.path.normcase(pre)
 ### startswithpath(str,pre) #
 
-##def path(str) :
-##return str.replace('/', os.sep)
-### path(str) #
-##def url(str) :
-##return str.replace(os.sep, '/')
-### url(str) #
 import urllib.request, urllib.parse
 path = urllib.request.url2pathname
 def url(str) :
@@ -951,9 +878,6 @@ def CreateTstWhatXhtml (env, TST, stable
 
 html.write(f, True)
 f.close()
-#TODO?
-# LO

MonetDB: Aug2024 - Only check files that are actually in the rep...

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: 88bb431040ab for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/88bb431040ab
Modified Files:
clients/Tests/exports.py
testing/listexports.py
Branch: Aug2024
Log Message:

Only check files that are actually in the repository.


diffs (90 lines):

diff --git a/clients/Tests/exports.py b/clients/Tests/exports.py
--- a/clients/Tests/exports.py
+++ b/clients/Tests/exports.py
@@ -1,8 +1,7 @@
 import sys
 import difflib
 import MonetDBtesting.listexports
+stable = open('exports.stable.out').readlines()
 output = MonetDBtesting.listexports.listexports()
-stable = open('exports.stable.out').readlines()
 for line in difflib.unified_diff(stable, output):
 sys.stderr.write(line)
-
diff --git a/testing/listexports.py b/testing/listexports.py
--- a/testing/listexports.py
+++ b/testing/listexports.py
@@ -16,11 +16,18 @@ from . import exportutils
 
 # sets of directories/files that end up in the same shared object
 dirlist = {
-'gdk': ['gdk', 'common/options', 'common/utils/mutils.h', 
'common/utils/mprompt.h'],
-'mapi': ['clients/mapilib', 'common/options', 'common/utils/mcrypt.h'],
-'monetdb5': ['monetdb5', 'common/utils/msabaoth.h', 
'common/utils/muuid.h'],
-'stream': ['common/stream'],
-'monetdbe': ['tools/monetdbe/monetdbe.h'],
+'gdk': ['gdk',
+os.path.join('common', 'options'),
+os.path.join('common', 'utils', 'mutils.h'),
+os.path.join('common', 'utils', 'mprompt.h')],
+'mapi': [os.path.join('clients', 'mapilib'),
+ os.path.join('common', 'options'),
+ os.path.join('common', 'utils', 'mcrypt.h')],
+'monetdb5': ['monetdb5',
+ os.path.join('common', 'utils', 'msabaoth.h'),
+ os.path.join('common', 'utils', 'muuid.h')],
+'stream': [os.path.join('common', 'stream')],
+'monetdbe': [os.path.join('tools', 'monetdbe', 'monetdbe.h')],
 'sql': ['sql'],
 }
 libs = sorted(dirlist.keys())
@@ -75,7 +82,7 @@ def mywalk(d):
 return [(root, [], [file])]
 return os.walk(d)
 
-def findfiles(dirlist, skipfiles=[], skipdirs=[]):
+def findfiles(dirlist, skipfiles=[], skipdirs=[], fileset=None):
 decls = []
 done = {}
 for d in dirlist:
@@ -87,19 +94,36 @@ def findfiles(dirlist, skipfiles=[], ski
 if f not in done and \
 (f.endswith('.c') or f.endswith('.h')) and \
 not f.startswith('.') and \
-f not in skipfiles and \
-os.path.isfile(os.path.join(root, f)):
-decls.extend(extract(os.path.join(root, f)))
+f not in skipfiles:
+ff = os.path.join(root, f)
+if os.path.isfile(ff) and (fileset is None or ff in 
fileset):
+decls.extend(extract(ff))
 done[f] = True
 decls.sort()
 return [decl for name, decl in decls]
 
+def getrepofiles():
+curdir = os.getcwd()
+os.chdir(srcdir)
+if os.path.exists(os.path.join('.hg', 'store')):
+import subprocess
+with subprocess.Popen(['hg', 'files', '-I', '**.[ch]'],
+  stdout=subprocess.PIPE,
+  text=True) as p:
+out, err = p.communicate()
+fileset = set([os.path.join(srcdir, f) for f in filter(None, 
out.split('\n'))])
+else:
+fileset = None
+os.chdir(curdir)
+return fileset
+
 def listexports():
 output = []
+fileset = getrepofiles()
 for lib in libs:
 dirs = dirlist[lib]
 dl = [os.path.join(srcdir, d) for d in dirs]
-decls = findfiles(dl, skipfiles=skipfiles, skipdirs=skipdirs)
+decls = findfiles(dl, skipfiles=skipfiles, skipdirs=skipdirs, 
fileset=fileset)
 output.append(f'# {lib}\n')
 for d in decls:
 output.append(d + '\n')
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Cleanup.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: 487a198d24ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/487a198d24ed
Modified Files:
monetdb5/mal/mal_module.c
monetdb5/modules/mal/manual.c
Branch: default
Log Message:

Cleanup.


diffs (92 lines):

diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c
--- a/monetdb5/mal/mal_module.c
+++ b/monetdb5/mal/mal_module.c
@@ -169,12 +169,9 @@ addModuleToIndex(Module cur)
 Module
 getModule(const char *name)
 {
-   int index = getModuleIndex(name);
-   Module m = moduleIndex[index];
-   while (m) {
+   for (Module m = moduleIndex[getModuleIndex(name)]; m; m = m->link) {
if (name == m->name)
return m;
-   m = m->link;
}
return NULL;
 }
diff --git a/monetdb5/modules/mal/manual.c b/monetdb5/modules/mal/manual.c
--- a/monetdb5/modules/mal/manual.c
+++ b/monetdb5/modules/mal/manual.c
@@ -35,8 +35,6 @@ MANUALcreateOverview(Client cntxt, MalBl
bat *cx = getArgReference_bat(stk, pci, 4);
Module *moduleList;
int length;
-   int top = 0;
-   Module list[256];
 
mod = COLnew(0, TYPE_str, 0, TRANSIENT);
fcn = COLnew(0, TYPE_str, 0, TRANSIENT);
@@ -52,18 +50,12 @@ MANUALcreateOverview(Client cntxt, MalBl
throw(MAL, "manual.functions", SQLSTATE(HY013) MAL_MALLOC_FAIL);
}
 
-   list[top++] = cntxt->usermodule;
getModuleList(&moduleList, &length);
if (moduleList == NULL)
goto bailout;
-   while (top < 256 && top <= length) {
-   list[top] = moduleList[top - 1];
-   top++;
-   }
-   freeModuleList(moduleList);
 
-   for (int k = 0; k < top; k++) {
-   Module s = list[k];
+   for (int k = 0; k <= length; k++) {
+   Module s = k < length ? moduleList[k] : cntxt->usermodule;
for (int j = 0; j < MAXSCOPE; j++) {
if (s->space[j]) {
for (Symbol t = s->space[j]; t != NULL; t = 
t->peer) {
@@ -79,25 +71,27 @@ MANUALcreateOverview(Client cntxt, MalBl
comment = t->func->comment;
(void) cfcnDefinition(t, buf, 
TRUE, buf, sizeof(buf));
}
+   if (comment == NULL)
+   comment = "";
char *tt = strstr(buf, " address ");
if (tt) {
*tt = 0;
tt += 9;
+   } else {
+   tt = "";
}
if (BUNappend(mod, s->name, false) != 
GDK_SUCCEED
-   || BUNappend(fcn, t->name,
-false) 
!= GDK_SUCCEED
-   || BUNappend(com, comment ? 
comment : "",
-false) 
!= GDK_SUCCEED
+   || BUNappend(fcn, t->name, 
false) != GDK_SUCCEED
+   || BUNappend(com, comment, 
false) != GDK_SUCCEED
|| BUNappend(sig, buf, false) 
!= GDK_SUCCEED
-   || BUNappend(adr, tt ? tt : "",
-false) 
!= GDK_SUCCEED) {
+   || BUNappend(adr, tt, false) != 
GDK_SUCCEED) {
goto bailout;
}
}
}
}
}
+   freeModuleList(moduleList);
 
*mx = mod->batCacheid;
BBPkeepref(mod);
@@ -113,6 +107,7 @@ MANUALcreateOverview(Client cntxt, MalBl
return MAL_SUCCEED;
 
   bailout:
+   freeModuleList(moduleList);
BBPreclaim(mod);
BBPreclaim(fcn);
BBPreclaim(sig);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Aug2024 branch.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: eca2cff023ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/eca2cff023ad
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (90 lines):

diff --git a/clients/Tests/exports.py b/clients/Tests/exports.py
--- a/clients/Tests/exports.py
+++ b/clients/Tests/exports.py
@@ -1,8 +1,7 @@
 import sys
 import difflib
 import MonetDBtesting.listexports
+stable = open('exports.stable.out').readlines()
 output = MonetDBtesting.listexports.listexports()
-stable = open('exports.stable.out').readlines()
 for line in difflib.unified_diff(stable, output):
 sys.stderr.write(line)
-
diff --git a/testing/listexports.py b/testing/listexports.py
--- a/testing/listexports.py
+++ b/testing/listexports.py
@@ -16,11 +16,18 @@ from . import exportutils
 
 # sets of directories/files that end up in the same shared object
 dirlist = {
-'gdk': ['gdk', 'common/options', 'common/utils/mutils.h', 
'common/utils/mprompt.h'],
-'mapi': ['clients/mapilib', 'common/options', 'common/utils/mcrypt.h'],
-'monetdb5': ['monetdb5', 'common/utils/msabaoth.h', 
'common/utils/muuid.h'],
-'stream': ['common/stream'],
-'monetdbe': ['tools/monetdbe/monetdbe.h'],
+'gdk': ['gdk',
+os.path.join('common', 'options'),
+os.path.join('common', 'utils', 'mutils.h'),
+os.path.join('common', 'utils', 'mprompt.h')],
+'mapi': [os.path.join('clients', 'mapilib'),
+ os.path.join('common', 'options'),
+ os.path.join('common', 'utils', 'mcrypt.h')],
+'monetdb5': ['monetdb5',
+ os.path.join('common', 'utils', 'msabaoth.h'),
+ os.path.join('common', 'utils', 'muuid.h')],
+'stream': [os.path.join('common', 'stream')],
+'monetdbe': [os.path.join('tools', 'monetdbe', 'monetdbe.h')],
 'sql': ['sql'],
 }
 libs = sorted(dirlist.keys())
@@ -75,7 +82,7 @@ def mywalk(d):
 return [(root, [], [file])]
 return os.walk(d)
 
-def findfiles(dirlist, skipfiles=[], skipdirs=[]):
+def findfiles(dirlist, skipfiles=[], skipdirs=[], fileset=None):
 decls = []
 done = {}
 for d in dirlist:
@@ -87,19 +94,36 @@ def findfiles(dirlist, skipfiles=[], ski
 if f not in done and \
 (f.endswith('.c') or f.endswith('.h')) and \
 not f.startswith('.') and \
-f not in skipfiles and \
-os.path.isfile(os.path.join(root, f)):
-decls.extend(extract(os.path.join(root, f)))
+f not in skipfiles:
+ff = os.path.join(root, f)
+if os.path.isfile(ff) and (fileset is None or ff in 
fileset):
+decls.extend(extract(ff))
 done[f] = True
 decls.sort()
 return [decl for name, decl in decls]
 
+def getrepofiles():
+curdir = os.getcwd()
+os.chdir(srcdir)
+if os.path.exists(os.path.join('.hg', 'store')):
+import subprocess
+with subprocess.Popen(['hg', 'files', '-I', '**.[ch]'],
+  stdout=subprocess.PIPE,
+  text=True) as p:
+out, err = p.communicate()
+fileset = set([os.path.join(srcdir, f) for f in filter(None, 
out.split('\n'))])
+else:
+fileset = None
+os.chdir(curdir)
+return fileset
+
 def listexports():
 output = []
+fileset = getrepofiles()
 for lib in libs:
 dirs = dirlist[lib]
 dl = [os.path.join(srcdir, d) for d in dirs]
-decls = findfiles(dl, skipfiles=skipfiles, skipdirs=skipdirs)
+decls = findfiles(dl, skipfiles=skipfiles, skipdirs=skipdirs, 
fileset=fileset)
 output.append(f'# {lib}\n')
 for d in decls:
 output.append(d + '\n')
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Cleanup: less string manipulation in C code, ...

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: f47374b916b9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f47374b916b9
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
clients/Tests/exports.stable.out
monetdb5/mal/mal.h
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_listing.h
monetdb5/modules/mal/manual.c
Branch: default
Log Message:

Cleanup: less string manipulation in C code, remove ; from func name in 
sys.malfunctions().


diffs (truncated from 108459 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -6,50876 +6,50876 @@ select * from sys.malfunctions() order b
 aggr
 Collect
 command aggr.Collect(X_0:bat[:wkb]):wkb
-wkbCollectAggr;
+wkbCollectAggr
 TODO
 aggr
 MakeLine
 command aggr.MakeLine(X_0:bat[:wkb]):wkb
-wkbMakeLineAggr;
+wkbMakeLineAggr
 Gets a BAT with point or linestring geometries and returns a single linestring 
geometry
 aggr
 all
 command aggr.all(X_0:bat[:any_1]):any_1
-SQLall;
+SQLall
 if all values in b are equal return this, else nil
 aggr
 allnotequal
 pattern aggr.allnotequal(X_0:bat[:any_1], X_1:bat[:any_1]):bit
-SQLallnotequal;
+SQLallnotequal
 if all values in r are not equal to l, return true, else if r has nil, return 
nil, else return false
 aggr
 anyequal
 pattern aggr.anyequal(X_0:any_1, X_1:any_1):bit
-CMDvarEQ;
+CMDvarEQ
 (empty)
 aggr
 anyequal
 pattern aggr.anyequal(X_0:bat[:any_1], X_1:bat[:any_1]):bit
-SQLanyequal;
+SQLanyequal
 if any value in r is equal to l, return true, else if r has nil, return nil, 
else return false
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on bte
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on dbl
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on flt
 aggr
 avg
 command aggr.avg(X_0:bat[:hge], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on hge
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on int
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on lng
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on sht
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on bte
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on dbl
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on flt
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on int
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on lng
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on sht
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on bte, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on dbl, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on flt, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:hge], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on hge, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on int, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on lng, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on sht, also returns count
 aggr
 avg
 command agg

MonetDB: nested - Fix upgrade code.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: 45a1a5ba4fd4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/45a1a5ba4fd4
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/exports.stable.out
sql/storage/bat/bat_logger.c
sql/test/emptydb/Tests/check.stable.out.int128
Branch: nested
Log Message:

Fix upgrade code.


diffs (truncated from 2146 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -33769,6 +33769,11 @@ unsafe pattern batsql.next_value(X_0:lng
 mvc_next_value_bulk
 return the next value of the sequence
 batsql
+next_value_ms
+pattern batsql.next_value_ms(X_0:bat[:any_1], X_1:str, X_2:str):bat[:lng]
+mvc_next_value_bulk;
+return the next value of the sequence
+batsql
 nth_value
 pattern batsql.nth_value(X_0:bat?[:any_1], X_1:bat?[:lng], X_2:bat?[:bit], 
X_3:bat?[:bit], X_4:int, X_5:bat?[:oid], X_6:bat?[:oid]):bat[:any_1]
 SQLnth_value
@@ -33849,6 +33854,11 @@ pattern batsql.rank(X_0:bat[:any_1], X_1
 SQLrank
 return the ranked groups
 batsql
+renumber
+pattern batsql.renumber(X_0:bat[:int], X_1:bat[:int], X_2:bat[:int]):bat[:int]
+mvc_renumber_bulk;
+return the input b renumbered using values from base
+batsql
 row_number
 pattern batsql.row_number(X_0:bat[:any_1], X_1:bat?[:bit], 
X_2:bat?[:bit]):bat[:int]
 SQLrow_number
@@ -48590,6 +48600,11 @@ SQLany_cmp
 if cmp then true, (nl or nr) nil then nil, else false
 sql
 append
+pattern sql.append(X_0:int, X_1:str, X_2:str, X_3:int, X_4:oid, X_5:bat[:oid], 
X_6:any):int
+mvc_append_wrap;
+Append to the column tname.col_id (possibly optimized to replace the insert 
bat of tname.col_id. Returns sequence number for order dependence.
+sql
+append
 pattern sql.append(X_0:int, X_1:str, X_2:str, X_3:str, X_4:oid, X_5:bat[:oid], 
X_6:any):int
 mvc_append_wrap
 Append to the column tname.cname (possibly optimized to replace the insert bat 
of tname.cname. Returns sequence number for order dependence.
@@ -48680,6 +48695,26 @@ SQLavginteger
 return the average of groups
 sql
 bind
+pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int) (X_5:bat[:oid], 
X_6:bat[:any_1])
+mvc_bind_wrap;
+Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
+sql
+bind
+pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int):bat[:any_1]
+mvc_bind_wrap;
+Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
+sql
+bind
+pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int) (X_7:bat[:oid], X_8:bat[:any_1])
+mvc_bind_wrap;
+Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
+sql
+bind
+pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int):bat[:any_1]
+mvc_bind_wrap;
+Bind the 'schema.table.column' BAT partition with access kind:@0 - base 
table@1 - inserts@2 - updates
+sql
+bind
 pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) (X_5:bat[:oid], 
X_6:bat[:any_1])
 mvc_bind_wrap
 Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
@@ -48980,6 +49015,26 @@ dump_trace
 dump the trace statistics
 sql
 emptybind
+pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int) 
(X_5:bat[:oid], X_6:bat[:any_1])
+mvc_bind_wrap;
+(empty)
+sql
+emptybind
+pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int):bat[:any_1]
+mvc_bind_wrap;
+(empty)
+sql
+emptybind
+pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int) (X_7:bat[:oid], X_8:bat[:any_1])
+mvc_bind_wrap;
+(empty)
+sql
+emptybind
+pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int):bat[:any_1]
+mvc_bind_wrap;
+(empty)
+sql
+emptybind
 pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:str, X_4:int) 
(X_5:bat[:oid], X_6:bat[:any_1])
 mvc_bind_wrap
 (empty)
@@ -49089,6 +49144,11 @@ pattern sql.first_value(X_0:any_1, X_1:b
 SQLfirst_value
 return the first value of groups
 sql
+from_json
+pattern sql.from_json(X_0:json, X_1:ptr):bat[:any]...
+SQLfrom_json;
+Reads json string into table of nested structures
+sql
 getVariable
 pattern sql.getVariable(X_0:int, X_1:str, X_2:str):any_1
 getVariable
@@ -49199,6 +49259,11 @@ unsafe pattern sql.next_value(X_0:str, X
 mvc_next_value
 return the next value of the sequence
 sql
+next_value_ms
+pattern sql.next_value_ms(X_0:any_1, X_1:str, X_2:str):lng
+mvc_next_value;
+return the next value of the sequence
+sql
 nth_value
 pattern sql.nth_value(X_0:any_1, X_1:lng, X_2:bit, X_3:bit, X_4:int, X_5:oid, 
X_6:oid):any_1
 SQLnth_value
@@ -49374,6 +49439,11 @@ unsafe pattern sql.register(X_0:str, X_1
 RAstatement2
 Compile the relational statement (rel_smt) and register it as mal function, 
mod.fname(signature)
 sql
+renumber
+pattern sql.renumber(X_0:int, X_1:int, X_2:int):int
+mvc_renumber;
+return the input b renumbered usin

MonetDB: nested - Merge with default branch.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: 08fde382dca9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/08fde382dca9
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/exports.stable.out
Branch: nested
Log Message:

Merge with default branch.


diffs (truncated from 108618 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -6,49992 +6,49992 @@ select * from sys.malfunctions() order b
 aggr
 Collect
 command aggr.Collect(X_0:bat[:wkb]):wkb
-wkbCollectAggr;
+wkbCollectAggr
 TODO
 aggr
 MakeLine
 command aggr.MakeLine(X_0:bat[:wkb]):wkb
-wkbMakeLineAggr;
+wkbMakeLineAggr
 Gets a BAT with point or linestring geometries and returns a single linestring 
geometry
 aggr
 all
 command aggr.all(X_0:bat[:any_1]):any_1
-SQLall;
+SQLall
 if all values in b are equal return this, else nil
 aggr
 allnotequal
 pattern aggr.allnotequal(X_0:bat[:any_1], X_1:bat[:any_1]):bit
-SQLallnotequal;
+SQLallnotequal
 if all values in r are not equal to l, return true, else if r has nil, return 
nil, else return false
 aggr
 anyequal
 pattern aggr.anyequal(X_0:any_1, X_1:any_1):bit
-CMDvarEQ;
+CMDvarEQ
 (empty)
 aggr
 anyequal
 pattern aggr.anyequal(X_0:bat[:any_1], X_1:bat[:any_1]):bit
-SQLanyequal;
+SQLanyequal
 if any value in r is equal to l, return true, else if r has nil, return nil, 
else return false
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on bte
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on dbl
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on flt
 aggr
 avg
 command aggr.avg(X_0:bat[:hge], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on hge
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on int
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on lng
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1]):bat[:dbl]
-AGGRavg13_dbl;
+AGGRavg13_dbl
 Grouped tail average on sht
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on bte
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on dbl
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on flt
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on int
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on lng
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1], 
X_3:int):bat[:dbl]
-AGGRavg14_dbl;
+AGGRavg14_dbl
 Grouped tail average on sht
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on bte, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on dbl, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:flt], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on flt, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:hge], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on hge, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:int], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on int, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:lng], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on lng, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:sht], X_1:bat[:oid], X_2:bat[:any_1]) 
(X_3:bat[:dbl], X_4:bat[:lng])
-AGGRavg23_dbl;
+AGGRavg23_dbl
 Grouped tail average on sht, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:bte], X_1:bat[:oid], X_2:bat[:any_1], X_3:int) 
(X_4:bat[:dbl], X_5:bat[:lng])
-AGGRavg24_dbl;
+AGGRavg24_dbl
 Grouped tail average on bte, also returns count
 aggr
 avg
 command aggr.avg(X_0:bat[:dbl], X_1:bat[:oid], X_2:bat[:an

MonetDB: nested - small compilation fix

2025-01-15 Thread Niels Nes via checkin-list
Changeset: 5dfa648afe3e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5dfa648afe3e
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_execute.c
Branch: nested
Log Message:

small compilation fix


diffs (34 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -750,9 +750,8 @@ append_tuple(backend *be, sql_exp *tuple
for(n = attr->h, o = type->type->d.fields->h; n && o; n = 
n->next, o = o->next) {
sql_exp *e = n->data;
list *vals = m->data;
-   sql_arg *nested_tuple = o->data;
sql_subtype *type = exp_subtype(e);
-   assert(type->type == nested_tuple->type.type);
+   assert(type->type == ((sql_arg*)o->data)->type.type);
if (type->type->composite) {
node *nm = append_tuple(be, e, type, left, sel, 
m, rowcnt, lcnt, type->multiset);
if (nm == m)
diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -692,12 +692,12 @@ RAstatement(Client c, MalBlkPtr mb, MalS
if (backend_dumpstmt(be, c->curprg->def, rel, 0, 1, NULL) < 0) {
msg = createException(SQL,"RAstatement","Program 
contains errors"); // TODO: use macro definition.
} else {
-   SQLaddQueryToCache(c);
-   msg = SQLoptimizeFunction(c,c->curprg->def);
-   if( msg == MAL_SUCCEED)
+   //SQLaddQueryToCache(c);
+   msg = SQLoptimizeFunction(c, c->curprg->def);
+   if (msg == MAL_SUCCEED)
msg = SQLrun(c,m);
resetMalBlk(c->curprg->def);
-   SQLremoveQueryFromCache(c);
+   //SQLremoveQueryFromCache(c);
}
rel_destroy(rel);
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: nested - Approvals.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: f6a30ee70b5e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f6a30ee70b5e
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
sql/test/emptydb/Tests/check.stable.out
Branch: nested
Log Message:

Approvals.


diffs (truncated from 1937 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -33771,7 +33771,7 @@ return the next value of the sequence
 batsql
 next_value_ms
 pattern batsql.next_value_ms(X_0:bat[:any_1], X_1:str, X_2:str):bat[:lng]
-mvc_next_value_bulk;
+mvc_next_value_bulk
 return the next value of the sequence
 batsql
 nth_value
@@ -33856,7 +33856,7 @@ return the ranked groups
 batsql
 renumber
 pattern batsql.renumber(X_0:bat[:int], X_1:bat[:int], X_2:bat[:int]):bat[:int]
-mvc_renumber_bulk;
+mvc_renumber_bulk
 return the input b renumbered using values from base
 batsql
 row_number
@@ -48601,7 +48601,7 @@ if cmp then true, (nl or nr) nil then ni
 sql
 append
 pattern sql.append(X_0:int, X_1:str, X_2:str, X_3:int, X_4:oid, X_5:bat[:oid], 
X_6:any):int
-mvc_append_wrap;
+mvc_append_wrap
 Append to the column tname.col_id (possibly optimized to replace the insert 
bat of tname.col_id. Returns sequence number for order dependence.
 sql
 append
@@ -48696,22 +48696,22 @@ return the average of groups
 sql
 bind
 pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int) (X_5:bat[:oid], 
X_6:bat[:any_1])
-mvc_bind_wrap;
+mvc_bind_wrap
 Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
 sql
 bind
 pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int):bat[:any_1]
-mvc_bind_wrap;
+mvc_bind_wrap
 Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
 sql
 bind
 pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int) (X_7:bat[:oid], X_8:bat[:any_1])
-mvc_bind_wrap;
+mvc_bind_wrap
 Bind the 'schema.table.column' BAT with access kind:@0 - base table@1 - 
inserts@2 - updates
 sql
 bind
 pattern sql.bind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int):bat[:any_1]
-mvc_bind_wrap;
+mvc_bind_wrap
 Bind the 'schema.table.column' BAT partition with access kind:@0 - base 
table@1 - inserts@2 - updates
 sql
 bind
@@ -49016,22 +49016,22 @@ dump the trace statistics
 sql
 emptybind
 pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int) 
(X_5:bat[:oid], X_6:bat[:any_1])
-mvc_bind_wrap;
+mvc_bind_wrap
 (empty)
 sql
 emptybind
 pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int):bat[:any_1]
-mvc_bind_wrap;
+mvc_bind_wrap
 (empty)
 sql
 emptybind
 pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int) (X_7:bat[:oid], X_8:bat[:any_1])
-mvc_bind_wrap;
+mvc_bind_wrap
 (empty)
 sql
 emptybind
 pattern sql.emptybind(X_0:int, X_1:str, X_2:str, X_3:int, X_4:int, X_5:int, 
X_6:int):bat[:any_1]
-mvc_bind_wrap;
+mvc_bind_wrap
 (empty)
 sql
 emptybind
@@ -49146,7 +49146,7 @@ return the first value of groups
 sql
 from_json
 pattern sql.from_json(X_0:json, X_1:ptr):bat[:any]...
-SQLfrom_json;
+SQLfrom_json
 Reads json string into table of nested structures
 sql
 getVariable
@@ -49261,7 +49261,7 @@ return the next value of the sequence
 sql
 next_value_ms
 pattern sql.next_value_ms(X_0:any_1, X_1:str, X_2:str):lng
-mvc_next_value;
+mvc_next_value
 return the next value of the sequence
 sql
 nth_value
@@ -49441,7 +49441,7 @@ Compile the relational statement (rel_sm
 sql
 renumber
 pattern sql.renumber(X_0:int, X_1:int, X_2:int):int
-mvc_renumber;
+mvc_renumber
 return the input b renumbered using values from base
 sql
 restart
@@ -50066,7 +50066,7 @@ Catalog operation create_trigger
 sqlcatalog
 create_type
 pattern sqlcatalog.create_type(X_0:str, X_1:str, X_2:ptr):void
-SQLcreate_type;
+SQLcreate_type
 Catalog operation create_type
 sqlcatalog
 create_type
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -24949,6 +24949,11 @@ unsafe pattern batsql.next_value(X_0:lng
 mvc_next_value_bulk
 return the next value of the sequence
 batsql
+next_value_ms
+pattern batsql.next_value_ms(X_0:bat[:any_1], X_1:str, X_2:str):bat[:lng]
+mvc_next_value_bulk
+return the next value of the sequence
+batsql
 nth_value
 pattern batsql.nth_value(X_0:bat?[:any_1], X_1:bat?[:lng], X_2:bat?[:bit], 
X_3:bat?[:bit], X_4:int, X_5:bat?[:oid], X_6:bat?[:oid]):bat[:any_1]
 SQLnth_value
@@ -25004,6 +25009,11 @@ pattern batsql.rank(X_0:bat[:any_1], X_1
 SQLrank
 return the ranked groups
 batsql
+renumber
+pattern batsql.renumber(X_0:bat[:int], X_1:bat[:int], X_2:bat[:int]):bat[:int]
+mvc_renumber_bulk
+return the input b renumbered using values from base
+batsql
 row_number
 pattern batsql.row_number(X_0:bat[:any_1], X_1:bat?[:bit], 
X_2:bat?

MonetDB: nested - Update some details.

2025-01-15 Thread Sjoerd Mullender via checkin-list
Changeset: 68b6cdeaea26 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/68b6cdeaea26
Modified Files:
sql/storage/bat/bat_logger.c
Branch: nested
Log Message:

Update some details.


diffs (108 lines):

diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c
--- a/sql/storage/bat/bat_logger.c
+++ b/sql/storage/bat/bat_logger.c
@@ -947,8 +947,7 @@ bl_postversion(void *Store, logger *lg)
return GDK_FAIL;
BUN colcnt = BATcount(b); /* we'll need it a few times */
bat_destroy(b);
-   bte ct = 0;
-   BAT *coltype = BATconstant(b->hseqbase, TYPE_bte, &ct, colcnt, 
PERSISTENT);
+   BAT *coltype = BATconstant(b->hseqbase, TYPE_bte, &(bte) {0}, 
colcnt, PERSISTENT);
if (coltype == NULL)
return GDK_FAIL;
if ((coltype = BATsetaccess(coltype, BAT_READ)) == NULL ||
@@ -956,7 +955,7 @@ bl_postversion(void *Store, logger *lg)
BUNappend(lg->catalog_id, &(int) {2168}, true) != 
GDK_SUCCEED ||
BUNappend(lg->catalog_bid, &coltype->batCacheid, true) 
!= GDK_SUCCEED ||
BUNappend(lg->catalog_lid, &lng_nil, false) != 
GDK_SUCCEED ||
-   BUNappend(lg->catalog_cnt, &(lng){colcnt}, false) != 
GDK_SUCCEED
+   BUNappend(lg->catalog_cnt, &(lng) {colcnt}, false) != 
GDK_SUCCEED
) {
bat_destroy(coltype);
return GDK_FAIL;
@@ -965,17 +964,15 @@ bl_postversion(void *Store, logger *lg)
bat_destroy(coltype);
 
/* new TINYINT column sys._columns.multiset */
-   ct = MS_VALUE;
-   BAT *multiset = BATconstant(b->hseqbase, TYPE_bte, &ct, colcnt, 
PERSISTENT);
+   BAT *multiset = BATconstant(b->hseqbase, TYPE_bte, &(bte) 
{MS_VALUE}, colcnt, PERSISTENT);
if (multiset == NULL)
return GDK_FAIL;
-   /* First add 2 rows for sys._columns.column_type and 
tmp._columns.column_type */
if ((multiset = BATsetaccess(multiset, BAT_READ)) == NULL ||
/* 2170 is sys._columns.multiset */
BUNappend(lg->catalog_id, &(int) {2170}, true) != 
GDK_SUCCEED ||
BUNappend(lg->catalog_bid, &multiset->batCacheid, true) 
!= GDK_SUCCEED ||
BUNappend(lg->catalog_lid, &lng_nil, false) != 
GDK_SUCCEED ||
-   BUNappend(lg->catalog_cnt, &(lng){colcnt}, false) != 
GDK_SUCCEED
+   BUNappend(lg->catalog_cnt, &(lng) {colcnt}, false) != 
GDK_SUCCEED
) {
bat_destroy(multiset);
return GDK_FAIL;
@@ -987,18 +984,16 @@ bl_postversion(void *Store, logger *lg)
b = log_temp_descriptor(log_find_bat(lg, 2029)); /* sys.args.id 
*/
if (b == NULL)
return GDK_FAIL;
-   ct = MS_VALUE;
-   multiset = BATconstant(b->hseqbase, TYPE_bte, &ct, BATcount(b), 
PERSISTENT);
+   multiset = BATconstant(b->hseqbase, TYPE_bte, &(bte) 
{MS_VALUE}, BATcount(b), PERSISTENT);
bat_destroy(b);
if (multiset == NULL)
return GDK_FAIL;
-   /* First add 2 rows for sys._columns.column_type and 
tmp._columns.column_type */
if ((multiset = BATsetaccess(multiset, BAT_READ)) == NULL ||
/* 2172 is sys.args.multiset */
BUNappend(lg->catalog_id, &(int) {2172}, true) != 
GDK_SUCCEED ||
BUNappend(lg->catalog_bid, &multiset->batCacheid, true) 
!= GDK_SUCCEED ||
BUNappend(lg->catalog_lid, &lng_nil, false) != 
GDK_SUCCEED ||
-   BUNappend(lg->catalog_cnt, &(lng){BATcount(multiset)}, 
false) != GDK_SUCCEED
+   BUNappend(lg->catalog_cnt, &(lng) {BATcount(multiset)}, 
false) != GDK_SUCCEED
) {
bat_destroy(multiset);
return GDK_FAIL;
@@ -1010,7 +1005,7 @@ bl_postversion(void *Store, logger *lg)
   2076, &(msk) {false},/* sys._columns 
*/
   /* 2168 is sys._columns.column_type */
   2077, &(int) {2168}, /* 
sys._columns.id */
-  2078, "column_type", /* 
sys._columns.name */
+  2078, "column_type", /* 
sys._columns.name */
   2079, "tinyint", /* 
sys._columns.type */
   2080, &(int) {7},/* 
sys._columns.type_digits */
   2081, &(int) {0},/

MonetDB: nested - handling more nested multisets

2025-01-15 Thread Niels Nes via checkin-list
Changeset: 3eab74799708 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3eab74799708
Modified Files:
cmake/os_release_info.cmake
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_rank.c
sql/backends/monet5/sql_statement.c
sql/common/sql_types.c
sql/server/rel_exp.c
sql/server/rel_multiset.c
sql/server/rel_select.c
sql/storage/store.c
Branch: nested
Log Message:

handling more nested multisets


diffs (truncated from 628 to 300 lines):

diff --git a/cmake/os_release_info.cmake b/cmake/os_release_info.cmake
--- a/cmake/os_release_info.cmake
+++ b/cmake/os_release_info.cmake
@@ -29,7 +29,7 @@ set(_os_release_info TRUE)
 # of the local cmake environment.
 
 # Set cmake policies for at least this level:
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
 
 
 # Function get_os_release_info - Determine and return OS name and version
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -681,84 +681,108 @@ set_value_list(backend *be, sql_exp *val
 }
 
 static int
-tuple_create_result(backend *be, sql_exp *tuple, list *cols, bte multiset)
-{
-   if (multiset && !is_row(tuple)) {
-   assert(is_values(tuple));
-   list *tuples = exp_get_values(tuple);
-   tuple = tuples->h->data;
-   }
-   assert(is_row(tuple));
-
-   list *attr = exp_get_values(tuple);
-   if (list_empty(attr)) {
-   (void)sql_error(be->mvc, 02, SQLSTATE(42000) "Cannot handle 
empty composite type");
-   return -1;
-   }
-   if (multiset) /* rowid */
+type_create_result(backend *be, sql_subtype *type, list *cols)
+{
+   if (type->multiset) /* rowid */
append(cols, sa_list(be->mvc->sa));
-   for(node *n = attr->h; n; n = n->next) {
-   sql_exp *e = n->data;
-
-   sql_subtype *type = exp_subtype(e);
-   if (type->type->composite) {
-   /* todo handle arrays and nesting */
-   assert(0);
-   }
+   if (type->type->composite) {
+   for(node *n = type->type->d.fields->h; n; n = n->next) {
+   sql_arg *a = n->data;
+
+   if (a->type.type->composite) {
+   if(type_create_result(be, &a->type, cols) < 0)
+   return -1;
+   } else {
+   append(cols, sa_list(be->mvc->sa));
+   }
+   }
+   } else {
append(cols, sa_list(be->mvc->sa));
}
-   if (multiset) /* multisetid */
+   if (type->multiset) /* multisetid */
append(cols, sa_list(be->mvc->sa));
-   if (multiset == MS_ARRAY) /* multisetnr */
+   if (type->multiset == MS_ARRAY) /* multisetnr */
append(cols, sa_list(be->mvc->sa));
return 0;
 }
 
-static int
-append_tuple(backend *be, sql_exp *tuple, stmt *left, stmt *sel, list *cols, 
int rowcnt, int lcnt, bte multiset)
-{
-   if (multiset && !is_row(tuple)) {
+static node *
+append_tuple(backend *be, sql_exp *tuple, sql_subtype *type, stmt *left, stmt 
*sel, node *cols, int rowcnt, int lcnt, bool row)
+{
+   if (row && !is_row(tuple)) { /* multiset data */
+   node *ncols;
assert(is_values(tuple));
list *tuples = exp_get_values(tuple);
int i = 1;
+   if (list_empty(tuples)) {
+   list *vals = cols->data;
+   append(vals, stmt_atom_int(be, int_nil));
+   if (type->type->composite) {
+   node *n = cols;
+   if (type->multiset)
+   n = n->next;
+   for(node *o = type->type->d.fields->h; n && o; 
n = n->next, o = o->next)
+   ;
+   if (type->multiset)
+   n = n->next;
+   if (type->multiset == MS_ARRAY)
+   n = n->next;
+   return n;
+   } else
+   return cols->next;
+   }
for(node *n = tuples->h; n; n = n->next, i++)
-   if (append_tuple(be, n->data, left, sel, cols, rowcnt, 
i, multiset) < 0)
-   return -1;
-   return 0;
+   if ((ncols=append_tuple(be, n->data, type, left, sel, 
cols, rowcnt, i, 0)) == cols)
+   return cols;
+   return ncols;
}
assert(tuple->row);
list *attr = exp_get_values(tuple)

MonetDB: nested - merged with default

2025-01-15 Thread Niels Nes via checkin-list
Changeset: d6cd3c4f4018 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d6cd3c4f4018
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/exports.stable.out
cmake/monetdb-findpackages.cmake
monetdb5/modules/atoms/CMakeLists.txt
monetdb5/modules/atoms/json.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/rel_predicates.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_rank.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statement.h
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/vaults/csv/csv.c
sql/common/sql_types.c
sql/include/sql_catalog.h
sql/include/sql_keyword.h
sql/include/sql_relation.h
sql/server/CMakeLists.txt
sql/server/rel_basetable.c
sql/server/rel_basetable.h
sql/server/rel_distribute.c
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimize_others.c
sql/server/rel_optimize_proj.c
sql/server/rel_optimize_sel.c
sql/server/rel_optimizer.c
sql/server/rel_optimizer_private.h
sql/server/rel_propagate.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_rel.h
sql/server/rel_rewriter.c
sql/server/rel_rewriter.h
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/rel_statistics.c
sql/server/rel_unnest.c
sql/server/rel_updates.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_partition.c
sql/server/sql_privileges.c
sql/server/sql_scan.c
sql/server/sql_scan.h
sql/server/sql_semantic.c
sql/server/sql_semantic.h
sql/server/sql_symbol.c
sql/server/sql_symbol.h
sql/server/sql_tokens.h
sql/storage/bat/bat_logger.c
sql/storage/bat/bat_storage.c
sql/storage/sql_catalog.c
sql/storage/sql_storage.h
sql/storage/store.c
tools/monetdbe/monetdbe.c
Branch: nested
Log Message:

merged with default


diffs (truncated from 17555 to 300 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 2024 MonetDB Foundation;
+# Copyright 2024, 2025 MonetDB Foundation;
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 #]]
diff --git a/Config.cmake.in b/Config.cmake.in
--- a/Config.cmake.in
+++ b/Config.cmake.in
@@ -5,7 +5,7 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 2024 MonetDB Foundation;
+# Copyright 2024, 2025 MonetDB Foundation;
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 #]]
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -4,7 +4,7 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 2024 MonetDB Foundation;
+# Copyright 2024, 2025 MonetDB Foundation;
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
@@ -923,6 +923,7 @@ sed -i 's/1\.2/1.1/' misc/selinux/monetd
 -DWITH_PCRE=ON \
 -DWITH_PROJ=OFF \
 -DWITH_READLINE=ON \
+-DWITH_RTREE=OFF \
 -DWITH_SQLPARSE=OFF \
 -DWITH_VALGRIND=OFF \
 -DWITH_XML2=ON \
diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -4,7 +4,7 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 2024 MonetDB Foundation;
+# Copyright 2024, 2025 MonetDB Foundation;
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -4,7 +4,7 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 2024 MonetDB Foundation;
+# Copyright 2024, 2025 MonetDB Foundation;
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -149,6 +149,6 @@ This Source Code Form is subject to the 
 License, v. 2.0.  If a copy of the MPL was not distributed with this
 file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-Copyright 2024 MonetDB Foundation;
+Copyright 2024, 2025 MonetDB Foundation;
 Copyright August 2008 - 2023 MonetDB B.V.;
 Cop