MonetDB: nested - make sure to return error on failing type check

2025-02-05 Thread Niels Nes via checkin-list
Changeset: f5566ce09185 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f5566ce09185
Modified Files:
sql/server/rel_exp.c
Branch: nested
Log Message:

make sure to return error on failing type check


diffs (24 lines):

diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -3697,7 +3697,10 @@ exp_check_composite_type(mvc *sql, sql_s
for(n = t->type->d.fields->h, m = vals->h; n && m; n = n->next, m = 
m->next) {
sql_arg *f = n->data;
sql_exp *e = m->data;
-   m->data = e = exp_check_type(sql, &f->type, rel, e, tpe);
+   e = exp_check_type(sql, &f->type, rel, e, tpe);
+   if (!e)
+   return NULL;
+   m->data = e;
}
if (n || m) {
if (m)
@@ -3762,6 +3765,8 @@ exp_check_type(mvc *sql, sql_subtype *t,
sql_subtype *fromtype = exp_subtype(exp);
 
if (t->type->composite || t->multiset) {
+   if (fromtype && subtype_cmp(t, fromtype) == 0)
+   return exp;
if (t->multiset || !is_row(exp))
return exp_check_multiset_type(sql, t, rel, exp, tpe);
return exp_check_composite_type(sql, t, rel, exp, tpe);
___
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-02-05 Thread Sjoerd Mullender via checkin-list
Changeset: e2d465c136fd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e2d465c136fd
Modified Files:
testing/sqllogictest.py
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (15 lines):

diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -248,10 +248,7 @@ class SQLLogic:
 pass
 self.crs = None
 if self.dbh:
-try:
-self.dbh.close()
-except AttributeError:
-pass
+self.dbh.close()
 self.dbh = None
 
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: nested - merged

2025-02-05 Thread Niels Nes via checkin-list
Changeset: d11e2895f44e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d11e2895f44e
Modified Files:
sql/test/nested/Tests/webclicks.test
Branch: nested
Log Message:

merged


diffs (49 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5765,10 +5765,10 @@ insert_json_object(char **msg, JSON *js,
}
}
 
-   if (elm > 0 && BUNappend(bats[w], &id, false) != GDK_SUCCEED)
-   elm = -3;
-   if (t->multiset == MS_ARRAY && elm > 0 && BUNappend(bats[w+1], &anr, 
false) != GDK_SUCCEED)
-   elm = -3;
+   //if (elm > 0 && BUNappend(bats[w], &id, false) != GDK_SUCCEED)
+   //  elm = -3;
+   //if (t->multiset == MS_ARRAY && elm > 0 && BUNappend(bats[w+1], &anr, 
false) != GDK_SUCCEED)
+   //  elm = -3;
return elm;
 }
 
diff --git a/sql/test/nested/Tests/webclicks.test 
b/sql/test/nested/Tests/webclicks.test
--- a/sql/test/nested/Tests/webclicks.test
+++ b/sql/test/nested/Tests/webclicks.test
@@ -2,17 +2,20 @@ statement ok
 create type kv as (key varchar, value varchar)
 
 statement ok
-create type loc as (list kv[])
+create type elem as (element kv)
 
 statement ok
-create type event as (id int , type varchar, location loc)
+create type webusr as (list elem[])
+
+statement ok
+create type loc as (list elem[])
 
 statement ok
-create table events(ev event[])
-
-statement error
-insert into events values (array[(1, "click", array[("hostname", 
"localhost")])])
+create type event as (eventid varchar, event varchar, timestamp timestamp, 
location loc, "user" webusr)
 
 statement ok
-insert into events values (array[(1, 'click', array[('hostname', 
'localhost')])])
+create table events(events event[])
 
+statement ok
+insert into events values (array[('111', 'click', '2024-11-30 22:13:37.823000 
UTC', (array[(('hostname', 'localhost'))]), null)])
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: nested - handle complex type output (wip)

2025-02-05 Thread Niels Nes via checkin-list
Changeset: 96c6a859807f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/96c6a859807f
Modified Files:
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_result.c
sql/include/sql_catalog.h
sql/server/rel_basetable.c
sql/server/rel_multiset.c
sql/storage/bat/bat_storage.c
sql/storage/bat/res_table.c
sql/storage/store.c
sql/test/nested/Tests/webclicks.test
Branch: nested
Log Message:

handle complex type output (wip)


diffs (truncated from 513 to 300 lines):

diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -283,9 +283,14 @@ static int
 multiset_size( Column *fmt)
 {
int nrattrs = 1 + (fmt->multiset == MS_ARRAY);
-   //if (fmt[1]) { /* todo check composite types */
+   if (fmt[0].composite) {
+   nrattrs += fmt[0].composite;
+   for (int i = 0; imultiset) {
+   fmt++;
+   nr_attrs--;
+   }
+   if ((fill = output_line_multiset(buf, len, fill, localbuf, locallen, 
fmt, fd, nr_attrs)) < 0) {
+   return -1;
+   }
+   (*buf)[fill++] = ')';
+   return fill;
+}
+
+static ssize_t
 output_multiset_value(char **buf, size_t *len, ssize_t fill, char **localbuf, 
size_t *locallen,
- Column *fmt, stream *fd, BUN nr_attrs, int 
multiset, int id)
+ Column *fmt, stream *fd, BUN nr_attrs, int 
multiset, int composite, int id)
 {
nr_attrs -= (multiset == MS_ARRAY)?2:1;
Column *msid = fmt + nr_attrs;
@@ -303,8 +324,14 @@ output_multiset_value(char **buf, size_t
for (; *idp == id; idp++, msid->p++) {
if (!first)
(*buf)[fill++] = ',';
-   if ((fill = output_line_multiset(buf, len, fill, localbuf, 
locallen, fmt, fd, nr_attrs)) < 0) {
-   break;
+   if (composite) {
+   if ((fill = output_line_composite(buf, len, fill, 
localbuf, locallen, fmt, fd, nr_attrs, composite)) < 0) {
+   break;
+   }
+   } else {
+   if ((fill = output_line_multiset(buf, len, fill, 
localbuf, locallen, fmt, fd, nr_attrs)) < 0) {
+   break;
+   }
}
first = 0;
}
@@ -332,7 +359,7 @@ output_line_multiset(char **buf, size_t 
(*buf)[fill++] = '\'';
(*buf)[fill++] = '{';
(*buf)[fill] = 0;
-   fill = output_multiset_value(buf, len, fill, 
localbuf, locallen, fmt + i + 1, fd, nr_attrs, f->multiset, *(int*)p);
+   fill = output_multiset_value(buf, len, fill, 
localbuf, locallen, fmt + i + 1, fd, nr_attrs, f->multiset, f->composite, 
*(int*)p);
(*buf)[fill++] = '}';
(*buf)[fill++] = '\'';
(*buf)[fill] = 0;
diff --git a/monetdb5/modules/mal/tablet.h b/monetdb5/modules/mal/tablet.h
--- a/monetdb5/modules/mal/tablet.h
+++ b/monetdb5/modules/mal/tablet.h
@@ -44,6 +44,7 @@ typedef struct Column_t {
unsigned int width; /* actual column width */
unsigned int maxwidth;  /* permissible width */
int multiset;   /* multiset */
+   int composite;  /* 0 no composite type else 
number of composite fields */
int fieldstart; /* Fixed character field load 
positions */
int fieldwidth;
int scale, precision;
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
@@ -2443,6 +2443,26 @@ rel2bin_sql_table(backend *be, sql_table
return stmt_list(be, l);
 }
 
+typedef struct subtable_e {
+   sql_table *t;
+   int nr;
+   stmt *dels;
+} subtable_e;
+
+static sql_column *
+subtable_e_find(subtable_e *sts, const char *name, int nr, stmt **dels)
+{
+   for(int i = 0; i < nr; i++) {
+   sql_table *t = sts[i].t;
+   sql_column *c = find_sql_column(t, name);
+   if (c) {
+   *dels = sts[i].dels;
+   return c;
+   }
+   }
+   return NULL;
+}
+
 static stmt *
 rel2bin_basetable(backend *be, sql_rel *rel)
 {
@@ -2454,7 +2474,17 @@ rel2bin_basetable(backend *be, sql_rel *
stmt *dels = stmt_tid(be, t, rel->flag == REL_PARTITION), *odels = 
dels, *col = NULL;
node *en;
list *subtables = rel_base_subtables(rel);
-   node *stn = NULL;
+   int nr = list_length(subtables);

MonetDB: nested - combine multi-results

2025-02-05 Thread Niels Nes via checkin-list
Changeset: 3193046d6b05 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3193046d6b05
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
Branch: nested
Log Message:

combine multi-results


diffs (76 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
@@ -656,6 +656,8 @@ set_value_list(backend *be, sql_exp *val
assert(is_values(vals_exp));
list *vals = exp_get_values(vals_exp);
sql_subtype *type = exp_subtype(vals->h->data);
+   bool single_value = list_length(vals) <= 1;
+   int multi_result = 0;
 
if (!type)
return sql_error(be->mvc, 02, SQLSTATE(42000) "Could not infer 
the type of a value list column");
@@ -668,15 +670,31 @@ set_value_list(backend *be, sql_exp *val
 
if (!i)
return NULL;
-
-   if (list_length(vals) == 1)
+   if (single_value)
return i;
list_append(l, i);
+
+   if (i->type == st_list && list_length(i->op4.lval) > 1)
+   multi_result = list_length(i->op4.lval);
}
/*  n-tuples */
-   //for (node *n = l->h; n; n = n->next) {
-
-   //}
+   if (multi_result) {
+   list *rl = sa_list(be->mvc->sa);
+   for(int i = 0; i < multi_result; i++) {
+   node *n = l->h;
+   stmt *s = n->data;
+   stmt *input = list_fetch(s->op4.lval, i);
+   sql_subtype *type = tail_type(input);
+   list *nl = list_append(sa_list(be->mvc->sa), input);
+   for (; n; n = n->next) {
+   stmt *s = n->data;
+   stmt *input = list_fetch(s->op4.lval, i);
+   nl = list_append(nl, input);
+   }
+   append(rl, stmt_append_bulk(be, stmt_temp(be, type), 
nl));
+   }
+   return stmt_list(be, rl);
+   }
return stmt_append_bulk(be, stmt_temp(be, type), l);
 }
 
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -3682,7 +3682,7 @@ exp_check_composite_type(mvc *sql, sql_s
node *n, *m;
list *vals = NULL;
assert(t->type->composite);
-   if (!exp_is_rel(exp) && !is_row(exp))
+   if (!exp_is_rel(exp) && is_row(exp) && !is_values(exp))
return sql_error( sql, 03, SQLSTATE(42000) "cannot convert 
value into composite type '%s'", t->type->base.name);
 
if (exp_is_rel(exp)) {
@@ -3767,9 +3767,12 @@ exp_check_type(mvc *sql, sql_subtype *t,
if (t->type->composite || t->multiset) {
if (fromtype && subtype_cmp(t, fromtype) == 0)
return exp;
-   if (t->multiset || !is_row(exp))
+   if (t->multiset && !is_row(exp))
return exp_check_multiset_type(sql, t, rel, exp, tpe);
-   return exp_check_composite_type(sql, t, rel, exp, tpe);
+   if (t->type->composite && (is_row(exp) || is_values(exp)))
+   return exp_check_composite_type(sql, t, rel, exp, tpe);
+   if (is_values(exp))
+   return NULL;
}
if ((!fromtype || !fromtype->type) && rel_set_type_param(sql, t, rel, 
exp, 0) == 0)
return exp;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: const_aggr_elim - Merges with default

2025-02-05 Thread stefanos mavros via checkin-list
Changeset: 9b111be4565d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9b111be4565d
Branch: const_aggr_elim
Log Message:

Merges with default


diffs (63 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2979,7 +2979,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, Te
 elif CALL == 'python':
 # do clean up between tests if no dependent tests
 # borrow clean up function from sqllogictest
-if not nodrop and not os.path.exists(TST+'.reqtests'):
+if not nodrop and not os.path.exists(TST+'.reqtests') and 
pSrvr is not None:
 import MonetDBtesting.sqllogictest as sqllogictest
 with sqllogictest.SQLLogic(out=ClntErr) as sql:
 try:
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -156,7 +156,7 @@ class SQLLogic:
 if self.timeout > 0:
 t = time.time()
 if self.starttime + self.timeout > t:
-return self.starttime + self.timeout - t
+return int(self.starttime + self.timeout - t)
 return 0
 return -1
 
@@ -213,6 +213,9 @@ class SQLLogic:
  autocommit=True,
  connect_timeout=t)
 crs = dbh.cursor()
+if t > 0:
+dbh.settimeout(t)
+crs.execute(f'call sys.setsessiontimeout({t})')
 else:
 dbh = malmapi.Connection()
 dbh.connect(database=database,
@@ -223,6 +226,9 @@ class SQLLogic:
 port=port,
 connect_timeout=t)
 crs = MapiCursor(dbh)
+if t > 0:
+dbh.settimeout(t)
+crs.execute(f'clients.setsessiontimeout({t}:int)')
 conn = SQLLogicConnection(conn_id, dbh=dbh, crs=crs, 
language=language)
 self.conn_map[conn_id] = conn
 return conn
@@ -808,12 +814,16 @@ class SQLLogic:
 self.approve = approve
 self.initfile(f, defines, run_until=run_until)
 nthreads = None
+if self.timeout:
+timeout = int((time.time() - self.starttime) + self.timeout)
+else:
+timeout = 0
 if self.language == 'sql':
-self.crs.execute(f'call sys.setsessiontimeout({self.timeout or 
0})')
+self.crs.execute(f'call sys.setsessiontimeout({timeout})')
 global hashge
 hashge = self.crs.execute("select * from sys.types where sqlname = 
'hugeint'") == 1
 else:
-self.crs.execute(f'clients.setsessiontimeout({self.timeout or 
0}:int)')
+self.crs.execute(f'clients.setsessiontimeout({timeout}:int)')
 skiprest = False
 while True:
 skipping = skiprest
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc_loader - merge with default

2025-02-05 Thread Martin van Dinther via checkin-list
Changeset: 6ea9d6197ae4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6ea9d6197ae4
Branch: odbc_loader
Log Message:

merge with default


diffs (truncated from 453 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
@@ -512,28 +512,6 @@ class Comment:
 def write(self, f, newline = False):
 f.write(str(self))
 
-class Timer:
-# interface to the threading.Timer function that interprets a
-# timeout of 0 as no timeout
-def __init__(self, interval, function, args):
-self.timer = None
-self.function = function
-self.args = args
-self.interval = interval
-
-def settimeout(self, interval):
-self.interval = interval
-
-def start(self):
-if self.timer is None and self.interval > 0:
-self.timer = threading.Timer(self.interval, self.function, 
args=self.args)
-self.timer.start()
-
-def cancel(self):
-if self.timer is not None:
-self.timer.cancel()
-self.timer = None
-
 REV = ''# revision (output of hg id), default unknown
 
 black = 'black' # #00
@@ -1354,7 +1332,7 @@ def PerformDir(env, testdir, testlist, t
 crs = dbh.cursor()
 try:
 crs.execute("call 
logging.setcomplevel('SQL_EXECUTION', 'INFO')")
-except socket.timeout:
+except TimeoutError:
 print('\nTimeout setting log level.\n')
 crs.close()
 dbh.close()
@@ -1708,7 +1686,7 @@ def GetBitsAndModsAndThreads(env) :
 crs = dbh.cursor()
 try:
 crs.execute('select distinct module from 
sys.malfunctions() order by module')
-except socket.timeout:
+except TimeoutError:
 pass
 else:
 mods = crs.fetchall()
@@ -2582,13 +2560,13 @@ def stacktrace(proc, outfile):
 with process.Popen(['gdb', '-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)
+except TimeoutExpired:
 # gdb sometimes hangs when trying to get the stack
 # trace: kill it mercilessly if it does
-t = Timer(60, reallyKill, args = [p])
-t.start()
-except AttributeError:
-t = None
-out, err = p.communicate()
+p.kill()
+p.wait()
+out = err = ''
 if t is not None:
 t.cancel()
 except KeyboardInterrupt:
@@ -2650,7 +2628,6 @@ class ServerClass:
 self.inmem = inmem
 self.dbg = dbg
 self.dbname = dbname
-self.running = None
 self.lock = threading.Lock()
 
 def poll(self):
@@ -2662,7 +2639,7 @@ class ServerClass:
 else:
 self.proc.terminate()
 try:
-self.proc.wait(timeout=60)
+self.proc.wait(timeout=30)
 except TimeoutExpired:
 self.proc.kill()
 self.wait()
@@ -2673,14 +2650,15 @@ class ServerClass:
 self.errfile.close()
 
 def start(self, timeout):
-self.running = Timer(timeout, self.stopsessions, [])
-self.running.start()
+if timeout:
+self.timer = threading.Timer(timeout, self.stopsessions, [])
+self.timer.start()
 
 def stop(self):
 if self.lock.acquire():
-if self.running:
-self.running.cancel()
-self.running = None
+if self.timer:
+self.timer.cancel()
+self.timer = None
 self.lock.release()
 
 def sendusr1(self):
@@ -2697,7 +2675,7 @@ class ServerClass:
 def stopsessions(self):
 if self.lock.acquire(blocking=False):
 try:
-if self.running is not None:
+if self.timer is not None:
 self.stacktrace()
 try:
 dbh = pymonetdb.connect(username='monetdb',
@@ -2717,11 +2695,11 @@ class ServerClass:
 crs.execute(f'call sys.stopsession({x[0]})')
 if procdebug and not ids:
 print('no sessions to stop')
-except socket.timeout:
+except TimeoutError:
 self.proc.kill()
 crs.close()
 dbh.close()
-self.running = None
+self.timer = None
 finally:

MonetDB: odbc_loader - Add retrieval and conversion of result co...

2025-02-05 Thread Martin van Dinther via checkin-list
Changeset: 4577f6fa20b3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4577f6fa20b3
Modified Files:
sql/backends/monet5/vaults/odbc/odbc_loader.c
Branch: odbc_loader
Log Message:

Add retrieval and conversion of result columns meta data.


diffs (266 lines):

diff --git a/sql/backends/monet5/vaults/odbc/odbc_loader.c 
b/sql/backends/monet5/vaults/odbc/odbc_loader.c
--- a/sql/backends/monet5/vaults/odbc/odbc_loader.c
+++ b/sql/backends/monet5/vaults/odbc/odbc_loader.c
@@ -51,6 +51,111 @@ odbc_cleanup(SQLHANDLE env, SQLHANDLE db
}
 }
 
+
+static sql_subtype *
+map_rescol_type(SQLSMALLINT dataType, SQLULEN columnSize, SQLSMALLINT 
decimalDigits, mvc * sql)
+{
+   char * typenm;
+
+   switch (dataType) {
+   case SQL_CHAR:
+   case SQL_VARCHAR:
+   case SQL_LONGVARCHAR:
+   case SQL_WCHAR:
+   case SQL_WVARCHAR:
+   case SQL_WLONGVARCHAR:
+   default:
+   return sql_bind_subtype(sql->sa, "varchar", (int) columnSize, 
0);
+
+   case SQL_DECIMAL:
+   case SQL_NUMERIC:
+   return sql_bind_subtype(sql->sa, "decimal", (int) 
decimalDigits, 6);
+
+   case SQL_BINARY:
+   case SQL_VARBINARY:
+   case SQL_LONGVARBINARY:
+   return sql_bind_subtype(sql->sa, "blob", (int) columnSize, 0);
+
+   case SQL_TINYINT:
+   typenm = "tinyint";
+   break;
+   case SQL_SMALLINT:
+   typenm = "smallint";
+   break;
+   case SQL_INTEGER:
+   typenm = "integer";
+   break;
+   case SQL_BIGINT:
+   typenm = "bigint";
+   break;
+   case SQL_REAL:
+   typenm = "real";
+   break;
+   case SQL_DOUBLE:
+   typenm = "double";
+   break;
+   case SQL_FLOAT:
+   typenm = "float";
+   break;
+   case SQL_TYPE_DATE:
+   typenm = "date";
+   break;
+   case SQL_TYPE_TIME:
+   typenm = "time";
+   break;
+   case SQL_TYPE_TIMESTAMP:
+   typenm = "timeestamp";
+   break;
+   case SQL_BIT:
+   typenm = "boolean";
+   break;
+   case SQL_INTERVAL_MONTH:
+   typenm = "INTERVAL MONTH";
+   break;
+   case SQL_INTERVAL_YEAR:
+   typenm = "INTERVAL YEAR";
+   break;
+   case SQL_INTERVAL_YEAR_TO_MONTH:
+   typenm = "INTERVAL YEAR TO MONTH";
+   break;
+   case SQL_INTERVAL_DAY:
+   typenm = "INTERVAL DAY";
+   break;
+   case SQL_INTERVAL_HOUR:
+   typenm = "INTERVAL HOUR";
+   break;
+   case SQL_INTERVAL_MINUTE:
+   typenm = "INTERVAL MINUTE";
+   break;
+   case SQL_INTERVAL_SECOND:
+   typenm = "INTERVAL SECOND";
+   break;
+   case SQL_INTERVAL_DAY_TO_HOUR:
+   typenm = "INTERVAL DAY TO HOUR";
+   break;
+   case SQL_INTERVAL_DAY_TO_MINUTE:
+   typenm = "INTERVAL DAY TO MINUTE";
+   break;
+   case SQL_INTERVAL_DAY_TO_SECOND:
+   typenm = "INTERVAL DAY TO SECOND";
+   break;
+   case SQL_INTERVAL_HOUR_TO_MINUTE:
+   typenm = "INTERVAL HOUR TO MINUTE";
+   break;
+   case SQL_INTERVAL_HOUR_TO_SECOND:
+   typenm = "INTERVAL HOUR TO SECOND";
+   break;
+   case SQL_INTERVAL_MINUTE_TO_SECOND:
+   typenm = "INTERVAL MINUTE TO SECOND";
+   break;
+   case SQL_GUID:
+   typenm = "UUID";
+   break;
+   }
+
+   return sql_bind_subtype(sql->sa, typenm, 0, 0);
+}
+
 /*
  * returns an error string (static or via tmp sa_allocator allocated), NULL on 
success
  *
@@ -65,11 +170,10 @@ odbc_relation(mvc *sql, sql_subfunc *f, 
 {
(void) res_exps;
(void) aname;
-// list *typelist = sa_list(sql->sa);
-// list *nameslist = sa_list(sql->sa);
+   bool trace_enabled = true;
 
if (!url || (url && strncasecmp("odbc:", url, 5) != 0))
-   return "Invalid URI. Expected to start with 'odbc:'.";
+   return "Invalid URI. Must start with 'odbc:'.";
 
// skip 'odbc:' prefix from url so we get a connection string including 
the query
char * con_str = &url[5];
@@ -87,60 +191,92 @@ odbc_relation(mvc *sql, sql_subfunc *f, 
// create a new ODBC connection string without the QUERY= part
char * odbc_con_str = GDKstrndup(con_str, qry_str - con_str);
 
+   if (trace_enabled)
+   printf("\nExtracted ODBC connection string: %s\nand SQL query: 
%s\n", odbc_con_str, query);
+
+   SQLRETURN ret = SQL_INVALID_HANDLE;
SQLHANDLE env = SQL_NULL_HENV;
SQLHANDLE dbc = SQL_NULL_HDBC;
SQLHANDLE stmt = SQL_NULL_HSTMT;
-   SQLRETURN ret;
-   SQLSMALLINT

MonetDB: nested - small fix

2025-02-05 Thread svetlin via checkin-list
Changeset: 9c0fcc968e63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9c0fcc968e63
Modified Files:
sql/backends/monet5/sql.c
Branch: nested
Log Message:

small fix


diffs (13 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -4428,7 +4428,8 @@ sql_storage(Client cntxt, MalBlkPtr mb, 
for (ncol = 
ol_first_node((t)->columns); ncol; ncol = ncol->next) {
sql_base *bc = 
ncol->data;
sql_column *c = 
(sql_column *) ncol->data;
-
+   if (!c->type.multiset 
&& c->type.type->composite)
+   continue; // 
virtual column, e.g. no column info
if( cname && 
strcmp(bc->name, cname) )
continue;
bs = 
store->storage_api.bind_col(tr, c, QUICK);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Also apply timeout to connections created usi...

2025-02-05 Thread Sjoerd Mullender via checkin-list
Changeset: bd466c445609 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bd466c445609
Added Files:
testing/tpymonetdb.py
Modified Files:
ctest/tools/monetdbe/Tests/example_proxy.SQL.py
sql/test/BugTracker-2009/Tests/bit_and.SF-2850341.py

sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.SQL.py
sql/test/BugTracker-2011/Tests/many-connects-cache.Bug-2904.SQL.py
sql/test/BugTracker-2011/Tests/python-connections-Bug.2901.SQL.py
sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py
sql/test/BugTracker-2012/Tests/day-of-month-localization.Bug-2962.SQL.py

sql/test/BugTracker-2012/Tests/large-number-operation-strange-results.Bug-2929.py

sql/test/BugTracker-2012/Tests/table_functions_fail_after_restart.Bug-3063.py
sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py
sql/test/BugTracker-2013/Tests/corrupt-after-restart.Bug-3282.SQL.py
sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
sql/test/BugTracker-2014/Tests/acidity-fail.Bug-3635.py
sql/test/BugTracker-2014/Tests/copy-into.Bug-3481.SQL.py
sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py
sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py
sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.SQL.py
sql/test/BugTracker-2015/Tests/concurrent-schema.Bug-3826.SQL.py
sql/test/BugTracker-2015/Tests/crash_timestamp_convert.Bug-3816.py
sql/test/BugTracker-2015/Tests/local-remotetable-crash.Bug-3754.SQL.py
sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py

sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py

sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py
sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py
sql/test/BugTracker-2018/Tests/remote-table-where-not-equal.Bug-6621.py
sql/test/BugTracker-2019/Tests/alter_table_drop_column.Bug-6749.py
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py

sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py
sql/test/BugTracker-2020/Tests/alter-table-add-column.Bug-6816.py
sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.py
sql/test/BugTracker-2020/Tests/functions-not-persist.Bug-6819.SQL.py
sql/test/BugTracker-2020/Tests/global_table_propagation.Bug-6846.py
sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py
sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py
sql/test/BugTracker-2020/Tests/user-update-privs.Bug-7035.py
sql/test/BugTracker-2021/Tests/remote-join-idxs.Bug-7165.py
sql/test/BugTracker-2021/Tests/remote-table-groupby.Bug-7110.py
sql/test/BugTracker-2021/Tests/remote-table-ranges.Bug-7089.py
sql/test/BugTracker-2021/Tests/serializable-snapshot.Bug-7200.SQL.py
sql/test/BugTracker-2021/Tests/shutdown-force.Bug-7167.SQL.py
sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
sql/test/BugTracker/Tests/limits_of_decimal.SF-1685357.py
sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.py
sql/test/BugTracker/Tests/python_escape.SF-1916844.SQL.py
sql/test/Tests/hot_snapshot.py
sql/test/Tests/null-byte-hang.SQL.py
sql/test/bincopy/Tests/bincopy_invalid_json.SQL.py
sql/test/bincopy/Tests/bincopy_nulls.SQL.py
sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py
sql/test/concurrent/Tests/read-segment-after-free.SQL.py
sql/test/concurrent/Tests/segments-corruption.SQL.py
sql/test/concurrent/Tests/simple_select.SQL.py
sql/test/concurrent/Tests/truncate-insert-flood.SQL.py
sql/test/copy/Tests/crlf_normalization.SQL.py
sql/test/mapi/Tests/python3_dec38.SQL.py
sql/test/mapi/Tests/python3_int128.SQL.py
sql/test/merge-partitions/Tests/mergepart29.SQL.py
sql/test/mergetables/Tests/concurrent_merge_tables.SQL.py
sql/test/mergetables/Tests/transaction-conflict.SQL.py
sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py
sql/test/miscellaneous/Tests/unlogged.py
sql/test/prepare/Tests/sqlancer_prepare.SQL.py
sql/test/rel-optimizers/Tests/join-merge-remote-replica.py
sql/test/rel-optimizers/Tests/local-replica-with-actual-remote.py
sql/test/rel-optimizers/Tests/remote-replica.py
sql/test/rel-optimizers/Tests/replicas-join.py
sql/test/remote/Tests/creds.SQL.py
sql/test/remote/Tests/different_user.SQL.py
sql/test/remote/Tests/invalid_creds.SQL.py
sql/test/remote/Tests/ssbm.SQL.py
sql/test/rename/Tests/rename11.py
sql/test/replica/Tests/rep

MonetDB: nested - fix test

2025-02-05 Thread svetlin via checkin-list
Changeset: cefcbeafe6c3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cefcbeafe6c3
Modified Files:
sql/test/nested/Tests/webclicks.test
Branch: nested
Log Message:

fix test


diffs (14 lines):

diff --git a/sql/test/nested/Tests/webclicks.test 
b/sql/test/nested/Tests/webclicks.test
--- a/sql/test/nested/Tests/webclicks.test
+++ b/sql/test/nested/Tests/webclicks.test
@@ -14,8 +14,8 @@ statement ok
 create type event as (eventid varchar, event varchar, timestamp timestamp, 
location loc, "user" webusr)
 
 statement ok
-create table events(events event[])
+create table events(events event)
 
 statement ok
-insert into events values (array[('111', 'click', '2024-11-30 22:13:37.823000 
UTC', (array[(('hostname', 'localhost'))]), null)])
+insert into events values (('111', 'click', '2024-11-30 22:13:37.823000', 
(array[(('hostname', 'localhost'))]), null))
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org