MonetDB: recursive_cte - fixed handling of nested recursive ctes

2024-12-06 Thread Niels Nes via checkin-list
Changeset: e6738d06ca12 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e6738d06ca12
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
sql/test/cte/Tests/test_correlated_recursive_cte.test
sql/test/cte/Tests/test_cte.test
Branch: recursive_cte
Log Message:

fixed handling of nested recursive ctes


diffs (190 lines):

diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -3095,6 +3095,10 @@ rel_push_project_down_union(visitor *v, 
 
sql_rel *r;
 
+   assert(!is_union(u->op));
+   if (is_recursive(u))
+   return rel;
+
/* don't push project down union of single values */
for (node *n = ((list*)u->l)->h; n; n = n->next) {
r = n->data;
@@ -3248,7 +3252,7 @@ rel_push_join_down_munion(visitor *v, sq
if (is_munion(l->op) && is_munion(r->op) && list_length(l->l) 
!= list_length(r->l))
return rel;
 
-   if (is_munion(l->op) && !need_distinct(l) && !is_single(l) &&
+   if (is_munion(l->op) && !need_distinct(l) && !is_single(l) && 
!is_recursive(l) &&
   !is_munion(r->op)){
/* join(munion(a,b,c), d) -> munion(join(a,d), 
join(b,d), join(c,d)) */
list *js = sa_list(v->sql->sa);
@@ -3272,8 +3276,8 @@ rel_push_join_down_munion(visitor *v, sq
v->changes++;
return rel_inplace_setop_n_ary(v->sql, rel, js, 
op_munion,
   
rel_projections(v->sql, rel, NULL, 1, 1));
-   } else if (is_munion(l->op) && !need_distinct(l) && 
!is_single(l) &&
-  is_munion(r->op) && !need_distinct(r) && 
!is_single(r) &&
+   } else if (is_munion(l->op) && !need_distinct(l) && 
!is_single(l) && !is_recursive(l) &&
+  is_munion(r->op) && !need_distinct(r) && 
!is_single(r) && !is_recursive(r) &&
   je) {
/* join(munion(a,b,c), munion(d,e,f)) -> 
munion(join(a,d), join(b,e), join(c,f)) */
list *cps = sa_list(v->sql->sa);
@@ -3311,7 +3315,7 @@ rel_push_join_down_munion(visitor *v, sq
return rel_inplace_setop_n_ary(v->sql, rel, cps, 
op_munion,

   rel_projections(v->sql, rel, NULL, 1, 1));
} else if (!is_munion(l->op) &&
-   is_munion(r->op) && !need_distinct(r) && 
!is_single(r) &&
+   is_munion(r->op) && !need_distinct(r) && 
!is_single(r) && !is_recursive(r) &&
   !is_semi(rel->op)) {
/* join(a, munion(b,c,d)) -> munion(join(a,b), 
join(a,c), join(a,d)) */
list *js = sa_list(v->sql->sa);
@@ -3336,7 +3340,7 @@ rel_push_join_down_munion(visitor *v, sq
return rel_inplace_setop_n_ary(v->sql, rel, js, 
op_munion,
   
rel_projections(v->sql, rel, NULL, 1, 1));
} else if (!is_munion(l->op) &&
-   is_munion(r->op) && !need_distinct(r) && 
!is_single(r) &&
+   is_munion(r->op) && !need_distinct(r) && 
!is_single(r) && !is_recursive(r) &&
is_semi(rel->op) && je) {
/* {semi}join ( A1, munion (B, A2a, C, A2b)) 
[A1.partkey = A2.partkey] ->
 * {semi}join ( A1, munion (A2a, A2b))
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -382,7 +382,7 @@ rel_with_query(sql_query *query, symbol 
set_distinct(nrel);
rel_setop_n_ary_set_exps(sql, nrel, 
rel_projections(sql, nrel, NULL, 0, 1), false);
set_processed(nrel);
-   recursive_union->rel_view = nrel;
+   recursive_union->rel_view = rel_dup(nrel); /* extra 
incref for independent flow */
}
if (!is_project(nrel->op)) {
if (is_topn(nrel->op) || is_sample(nrel->op)) {
diff --git a/sql/test/cte/Tests/test_correlated_recursive_cte.test 
b/sql/test/cte/Tests/test_correlated_recursive_cte.test
--- a/sql/test/cte/Tests/test_correlated_recursive_cte.test
+++ b/sql/test/cte/Tests/test_correlated_recursive_cte.test
@@ -217,8 +217,6 @@ 4
 8
 16
 
-# fails to end (causing overflow)
-skipif knownfail   

  

MonetDB: Aug2024 - approved errors

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 592d3068f1bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/592d3068f1bf
Modified Files:
sql/test/file_loader/Tests/file_loader_field_separator.test.in
Branch: Aug2024
Log Message:

approved errors


diffs (61 lines):

diff --git a/sql/test/file_loader/Tests/file_loader_field_separator.test.in 
b/sql/test/file_loader/Tests/file_loader_field_separator.test.in
--- a/sql/test/file_loader/Tests/file_loader_field_separator.test.in
+++ b/sql/test/file_loader/Tests/file_loader_field_separator.test.in
@@ -134,55 +134,8 @@ 2022
 
 # tests to load incomplete cars (4 columns, 5 rows) data files with missing 
field separators or empty lines
 
-query ITTI nosort
+statement error 42000!Failed to import table 'cars', line 5: column 3 name_2: 
Column value missing
 select * from file_loader(r'$TSTSRCDIR/cars_missing_separators.csv') as 
cars(id, brand, model, "year")
-
-2000
-Ford
-Focus
-1994
-2001
-Honda
-NULL
-NULL
-2004
-Tesla
-S3XY
-2019
-2014
-Lightyear
-0
-2022
-2020
-Volvo
-NULL
-NULL
 
-query ITTI nosort
+statement error 
 select * from file_loader(r'$TSTSRCDIR/cars_empty_line.csv') as cars(id, 
brand, model, "year")
-
-2000
-Ford
-Focus
-1994
-2001
-Honda
-NULL
-NULL
-NULL
-NULL
-NULL
-NULL
-2004
-Tesla
-S3XY
-2019
-2014
-Lightyear
-0
-2022
-NULL
-NULL
-NULL
-NULL
-
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - postpone push down of filter functions

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 61fedb197d28 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/61fedb197d28
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/7574-startswith-bug.test
Branch: Aug2024
Log Message:

postpone push down of filter functions


diffs (35 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1702,14 +1702,12 @@ push_join_exp(mvc *sql, sql_rel *rel, sq
 static sql_rel *
 rel_select_push_filter_exp_down(mvc *sql, sql_rel *rel, sql_exp *e, list *l, 
list *r, int ff)
 {
-   sql_exp *ll, *rr;
+   sql_exp *ll;
if (exps_card(r) <= CARD_ATOM && (exps_are_atoms(r) || 
exps_have_freevar(sql, r) || exps_have_freevar(sql, l))) {
if (exps_card(l) == exps_card(r) || rel->processed)  /* bin 
compare op */
return rel_select(sql->sa, rel, e);
if ((ll = exps_find_one_multi_exp(l)))
return push_select_exp(sql, rel, e, ll, ff);
-   } else if ((ll = exps_find_one_multi_exp(l)) && (rr = 
exps_find_one_multi_exp(r))) { /* join */
-   return push_join_exp(sql, rel, e, ll, rr, NULL, ff);
}
if (is_outerjoin(rel->op))
return rel_select(sql->sa, rel, e);
diff --git a/sql/test/BugTracker-2024/Tests/7574-startswith-bug.test 
b/sql/test/BugTracker-2024/Tests/7574-startswith-bug.test
--- a/sql/test/BugTracker-2024/Tests/7574-startswith-bug.test
+++ b/sql/test/BugTracker-2024/Tests/7574-startswith-bug.test
@@ -4,10 +4,9 @@ CREATE TABLE t1(c0 INTEGER, c1 VARCHAR)
 statement ok
 CREATE VIEW v0(c0) AS SELECT 'a' FROM t1
 
-skipif knownfail
-statement error
+query IIT
 SELECT * FROM t1, v0 WHERE STARTSWITH(t1.c0, v0.c0, t1.c1)
--- sql/backends/monet5/rel_bin.c:4582: rel2bin_select: Assertion 
`sql->session->status == -10' failed.
+
 
 statement ok
 DROP VIEW v0
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: recursive_cte - removed too large (time consuming) test

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 861afffbd446 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/861afffbd446
Removed Files:
sql/test/cte/Tests/recursive_cte_correlated_subquery.test
Modified Files:
sql/test/cte/Tests/All
Branch: recursive_cte
Log Message:

removed too large (time consuming) test


diffs (45 lines):

diff --git a/sql/test/cte/Tests/All b/sql/test/cte/Tests/All
--- a/sql/test/cte/Tests/All
+++ b/sql/test/cte/Tests/All
@@ -3,7 +3,6 @@ game_of_life
 incorrect_recursive_cte
 insert_cte_bug_3417
 recursive_cte_complex_pipelines
-#recursive_cte_correlated_subquery
 recursive_cte_error
 recursive_hang_2745
 test_correlated_recursive_cte
diff --git a/sql/test/cte/Tests/recursive_cte_correlated_subquery.test 
b/sql/test/cte/Tests/recursive_cte_correlated_subquery.test
deleted file mode 100644
--- a/sql/test/cte/Tests/recursive_cte_correlated_subquery.test
+++ /dev/null
@@ -1,29 +0,0 @@
-query I
-WITH RECURSIVE
-input(sud) AS (
-VALUES('53..76..195986.8...6...34..8.3..17...2...6.628419..58..79')
-),
-digits(z, lp) AS (
-SELECT CAST(lp+1 AS TEXT), cast(lp as int)+1 FROM generate_series(0,8+1,1) 
t(lp)
-),
-x(s, ind) AS (
-SELECT sud, contains(sud, '.') FROM input
-UNION ALL
-SELECT
-substr(s, 1, cast(ind as int)-1) || z || substr(s, cast(ind as int)+1),
-contains(substr(s, 1, cast(ind as int)-1) || z || substr(s, cast(ind as 
int)+1), '.' )
-FROM x, digits AS z
-WHERE cast(ind as int) >0
-AND NOT EXISTS (
-SELECT 1
-FROM digits AS lp
-WHERE z.z = substr(s, ((cast(ind as int)-1)/9)*9 + lp, 1)
-OR z.z = substr(s, ((cast(ind as int)-1)%9) + (lp-1)*9 + 1, 1)
-OR z.z = substr(s, (((cast(ind as int)-1)/3) % 3) * 3
-+ ((cast(ind as int)-1)/27) * 27 + lp
-+ ((lp-1) / 3) * 6, 1)
-)
-)
-SELECT s FROM x WHERE cast(ind as int)=0;
-
-534678912672195348198342567859761423426853791713924856961537284287419635345286179
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ordered-set-aggregates - merged

2024-12-06 Thread Niels Nes via checkin-list
Changeset: d2328d27422d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d2328d27422d
Branch: ordered-set-aggregates
Log Message:

merged


diffs (252 lines):

diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c
--- a/monetdb5/mal/mal_listing.c
+++ b/monetdb5/mal/mal_listing.c
@@ -61,33 +61,28 @@ copystring(char **dstp, const char *src,
return *src == 0;
 }
 
-static str
-renderTerm(MalBlkPtr mb, MalStkPtr stk, InstrPtr p, int idx, int flg)
+static void
+renderTerm(MalBlkPtr mb, MalStkPtr stk, InstrPtr p, int idx, int flg, char 
*buf, size_t max_len)
 {
-   char *buf = 0;
+   char *bufend = buf;
int nameused = 0;
-   size_t max_len = 256;
ValRecord *val = 0;
char *cv = 0;
str tpe;
int showtype = 0, closequote = 0;
int varid = getArg(p, idx);
 
-   buf = GDKzalloc(max_len);
-   if (buf == NULL) {
-   addMalException(mb, "renderTerm: Failed to allocate");
-   return NULL;
-   }
// show the name when required or is used
if ((flg & LIST_MAL_NAME) && !isVarConstant(mb, varid)
&& !isVarTypedef(mb, varid)) {
-   getVarNameIntoBuffer(mb, varid, buf);
+   (void) getVarNameIntoBuffer(mb, varid, bufend);
+   bufend += strlen(bufend);
nameused = 1;
}
// show the value when required or being a constant
if (((flg & LIST_MAL_VALUE) && stk != 0) || isVarConstant(mb, varid)) {
if (nameused)
-   strcat(buf, "=");
+   bufend = stpcpy(bufend, "=");
// locate value record
if (isVarConstant(mb, varid)) {
val = &getVarConstant(mb, varid);
@@ -96,14 +91,11 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
} else if (stk) {
val = &stk->stk[varid];
}
-   if ((cv = VALformat(val)) == NULL) {
-   addMalException(mb, "renderTerm: Failed to allocate");
-   GDKfree(buf);
-   return NULL;
-   }
-   if (!val->bat && strcmp(cv, "nil") == 0) {
-   strcat(buf, cv);
-   GDKfree(cv);
+   cv = VALformat(val);
+   if (cv == NULL) {
+   bufend = stpcpy(bufend, "");
+   } else if (!val->bat && strcmp(cv, "nil") == 0) {
+   bufend = stpcpy(bufend, cv);
showtype = showtype ||
(getBatType(getVarType(mb, varid)) >= TYPE_date
 && getBatType(getVarType(mb, varid)) != 
TYPE_str) ||
@@ -114,18 +106,22 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
&& getBatType(getVarType(mb, varid)) >= 
TYPE_date
&& getBatType(getVarType(mb, varid)) != 
TYPE_str) {
closequote = 1;
-   strcat(buf, "\"");
+   bufend = stpcpy(bufend, "\"");
}
size_t cv_len = strlen(cv);
if (cv_len > 100) {
-   strcpy_len(buf, cv, 101); /* 1 for null 
termination */
-   strconcat_len(buf + 100, max_len - 100, "\" 
. ", NULL);
+   cv_len = 100;
+   if (cv_len > (size_t) ((buf + max_len) - 
bufend))
+   cv_len = (buf + max_len) - bufend - 1;
+   strcpy_len(bufend, cv, cv_len + 1); /* 1 for 
null termination */
+   bufend += cv_len;
+   cv_len = strconcat_len(bufend, (buf + max_len) 
- bufend, "\" . ", NULL);
+   bufend += cv_len;
} else {
-   strcat(buf, cv);
+   bufend = stpcpy(bufend, cv);
}
-   GDKfree(cv);
if (closequote) {
-   strcat(buf, "\"");
+   bufend = stpcpy(bufend, "\"");
}
showtype = showtype || closequote > TYPE_str ||
((isVarTypedef(mb, varid) ||
@@ -136,21 +132,21 @@ renderTerm(MalBlkPtr mb, MalStkPtr stk, 
&& stk->stk[varid].val.bval) {
BAT *d = BBPquickdesc(stk->stk[varid].val.bval);
if (d)
-   snprintf(buf, max_len - strlen(buf), 
"[" BUNFMT "]", BATcount(d));
+   bufend += snprintf(bufend, (buf + 
max_len) - bufend, "[" BUNFMT "]", BATcount(d));

MonetDB: recursive_cte - handle some more correlated recursive c...

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 18f2d7de449a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/18f2d7de449a
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_unnest.c
sql/test/cte/Tests/test_correlated_recursive_cte.test
Branch: recursive_cte
Log Message:

handle some more correlated recursive cte's


diffs (191 lines):

diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -1752,13 +1752,13 @@ rel_push_aggr_down_n_arry(visitor *v, sq
list *rgbe = NULL, *gbe = NULL, *exps = NULL;
node *n, *m;
 
-   if (is_recursive(u))
-   return rel;
-
// TODO why?
if (u->op == op_project && !need_distinct(u))
u = u->l;
 
+   if (is_recursive(u))
+   return rel;
+
/* make sure we don't create group by on group by's */
for (node *n = ((list*)u->l)->h; n; n = n->next) {
r = n->data;
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -827,17 +827,10 @@ push_up_project(mvc *sql, sql_rel *rel, 
sql_rel *r = rel->r;
 
if (rel_is_ref(r) && is_recursive(r)) {
-
-   if (is_join(rel->op) && is_dependent(rel)) {
-   sql_rel *l = r->l;
-   r->l = rel;
-   rel->r = l;
-   /* add missing expressions */
-   list *exps = rel_projections(sql, rel->l, NULL, 1, 1);
-   r->exps = list_distinct(list_merge(exps, r->exps, 
(fdup)NULL), (fcmp)exp_equal, (fdup)NULL);
-   return r;
-   }
-   assert(0);
+   reset_dependent(rel);
+   if (is_join(rel->op) && list_length(rel->exps))
+   return rel;
+   return r;
}
assert(is_simple_project(r->op));
if (rel_is_ref(r)) {
@@ -1584,6 +1577,8 @@ push_up_set(mvc *sql, sql_rel *rel, list
return rel;
 }
 
+static sql_rel * rel_unnest_dependent(mvc *sql, sql_rel *rel);
+
 static sql_rel *
 push_up_munion(mvc *sql, sql_rel *rel, list *ad)
 {
@@ -1594,6 +1589,9 @@ push_up_munion(mvc *sql, sql_rel *rel, l
int len = 0, need_length_reduction = 0;
int rec = is_recursive(s);
 
+   /* Incase of recursive push up the project of the base side 
(inplace) */
+   /* push normaly into right side, but stop when we hit this base 
again */
+
/* left of rel should be a set */
list *rlist = sa_list(sql->sa);
if (d && is_distinct_set(sql, d, ad) && s && is_munion(s->op)) {
@@ -1639,6 +1637,20 @@ push_up_munion(mvc *sql, sql_rel *rel, l
set_processed(sl);
n->data = sl;
}
+   if (rec) {
+   sql_rel *sl = rlist->h->data;
+   list *exps = exps_copy(sql, ad);
+   for(node *n = exps->h; n; n = n->next) {
+   sql_exp *e = n->data;
+   set_freevar(e, 0);
+   }
+   sl->exps = list_merge(exps, sl->exps, 
(fdup)NULL);
+   sql_rel *nl = rel_crossproduct(sql->sa, 
rel_dup(d), sl->l, rel->op);
+   nl->exps = exps_copy(sql, rel->exps);
+   set_dependent(nl);
+   set_processed(nl);
+   sl->l = nl;
+   }
 
sql_rel *ns = rel_setop_n_ary(sql->sa, rlist, s->op);
ns->exps = exps_copy(sql, s->exps);
@@ -1660,15 +1672,6 @@ push_up_munion(mvc *sql, sql_rel *rel, l
ns->exps = list_merge(sexps, ns->exps, 
(fdup)NULL);
}
/* add/remove projections to inner parts of the union 
(as we push a join or semijoin down) */
-   if (rec) {
-   sql_rel *sl = rlist->h->data;
-   list *exps = exps_copy(sql, ad);
-   for(node *n = exps->h; n; n = n->next) {
-   sql_exp *e = n->data;
-   set_freevar(e, 0);
-   }
-   sl->exps = list_merge(exps, sl->exps, 
(fdup)NULL);
-   }
for(node *n = rec?rlist->h->next:rlist->h; n; n = 
n->next) {
sql_rel *sl = n->data;
n->data = rel_project(sql->sa, sl, 
rel_projections(sql, sl, NULL, 1, 1));
@@ -1697,8 +1700,6 @@ push_up_munio

MonetDB: Aug2024 - return sql allocator (or const) strings

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 2f66e1b01651 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2f66e1b01651
Modified Files:
sql/backends/monet5/vaults/csv/csv.c
Branch: Aug2024
Log Message:

return sql allocator (or const) strings


diffs (43 lines):

diff --git a/sql/backends/monet5/vaults/csv/csv.c 
b/sql/backends/monet5/vaults/csv/csv.c
--- a/sql/backends/monet5/vaults/csv/csv.c
+++ b/sql/backends/monet5/vaults/csv/csv.c
@@ -452,12 +452,12 @@ csv_relation(mvc *sql, sql_subfunc *f, c
list_append(res_exps, ne);
} else {
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type %s not 
found\n", st);
+   return sa_message(sql->sa, "csv" "type %s not 
found\n", st);
}
} else {
/* shouldn't be possible, we fallback to strings */
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type unknown\n");
+   return sa_message(sql->sa, "csv" "type unknown\n");
}
}
GDKfree(types);
@@ -472,7 +472,7 @@ csv_relation(mvc *sql, sql_subfunc *f, c
r->extra_tsep = extra_tsep;
r->has_header = has_header;
f->sname = (char*)r; /* pass schema++ */
-   return MAL_SUCCEED;
+   return NULL;
 }
 
 static void *
@@ -484,7 +484,6 @@ csv_load(void *BE, sql_subfunc *f, char 
sql_table *t = NULL;
 
if (mvc_create_table( &t, be->mvc, be->mvc->session->tr->tmp/* misuse 
tmp schema */, f->tname /*gettable name*/, tt_table, false, SQL_DECLARED_TABLE, 
0, 0, false) != LOG_OK)
-   //throw(SQL, SQLSTATE(42000), "csv" RUNTIME_FILE_NOT_FOUND);
/* alloc error */
return NULL;
 
@@ -495,7 +494,6 @@ csv_load(void *BE, sql_subfunc *f, char 
sql_column *c = NULL;
 
if (!tp || mvc_create_column(&c, be->mvc, t, name, tp) != 
LOG_OK) {
-   //throw(SQL, SQLSTATE(42000), "csv" RUNTIME_LOAD_ERROR);
return NULL;
}
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - add test for bug 7602

2024-12-06 Thread Niels Nes via checkin-list
Changeset: aa4512bb9bdc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aa4512bb9bdc
Added Files:
sql/test/BugTracker-2024/Tests/7602-copy-into-multiple-files.test
Modified Files:
sql/test/BugTracker-2024/Tests/All
Branch: Aug2024
Log Message:

add test for bug 7602


diffs (18 lines):

diff --git a/sql/test/BugTracker-2024/Tests/7602-copy-into-multiple-files.test 
b/sql/test/BugTracker-2024/Tests/7602-copy-into-multiple-files.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7602-copy-into-multiple-files.test
@@ -0,0 +1,5 @@
+statement ok
+create table x (i int)
+
+statement error
+copy into x from 'a', 'b' on client
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -97,3 +97,4 @@ 7591-logical-expr
 7593-double-as-text-notation-issue
 KNOWNFAIL?7598-foreign_key_match_options
 KNOWNFAIL?7598-foreign_key_match_options_dump
+7602-copy-into-multiple-files
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - add test for bug #7603

2024-12-06 Thread Niels Nes via checkin-list
Changeset: 15cace50a3c9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/15cace50a3c9
Added Files:
sql/test/BugTracker-2024/Tests/7603-copy-into-3files-crash.test
Modified Files:
sql/test/BugTracker-2024/Tests/All
Branch: Aug2024
Log Message:

add test for bug #7603


diffs (18 lines):

diff --git a/sql/test/BugTracker-2024/Tests/7603-copy-into-3files-crash.test 
b/sql/test/BugTracker-2024/Tests/7603-copy-into-3files-crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7603-copy-into-3files-crash.test
@@ -0,0 +1,5 @@
+statement ok
+CREATE TABLE foo(i INT, t TEXT, j INT)
+
+statement error
+COPY INTO foo FROM '7587-rejectmismatch.csv.gz', '7587-rejectmismatch.csv.gz', 
'7587-rejectmismatch.csv.gz' ON CLIENT
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -98,3 +98,4 @@ 7593-double-as-text-notation-issue
 KNOWNFAIL?7598-foreign_key_match_options
 KNOWNFAIL?7598-foreign_key_match_options_dump
 7602-copy-into-multiple-files
+7603-copy-into-3files-crash
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Fix up all stable output that is checked usin...

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: 9294a9c93d28 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9294a9c93d28
Modified Files:
sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
sql/test/BugTracker-2019/Tests/msqldump-mapi-cache.Bug-6777.stable.out
sql/test/BugTracker-2020/Tests/deallocate-id.Bug-7010.stable.err
sql/test/BugTracker-2020/Tests/deallocate-id.Bug-7010.stable.out
sql/test/BugTracker-2024/Tests/7574-startswith-bug.test
sql/test/BugTracker-2024/Tests/7602-copy-into-multiple-files.test
sql/test/BugTracker-2024/Tests/7603-copy-into-3files-crash.test
sql/test/Dump/Tests/dump-again.stable.out
sql/test/Dump/Tests/dump.stable.out
sql/test/Dump/Tests/reload-again.stable.out
sql/test/Dump/Tests/reload.stable.out
sql/test/UserDump/Tests/dump_with_test.stable.out
sql/test/analytics/Tests/analytics20.stable.out
sql/test/bincopy/Tests/bincopy_support.py
sql/test/file_loader/Tests/file_loader_field_separator.test.in
sql/test/miscellaneous/Tests/blobs.stable.out
sql/test/miscellaneous/Tests/deallocate.stable.err
sql/test/miscellaneous/Tests/deallocate.stable.out
sql/test/miscellaneous/Tests/groupby_prepare.stable.err
sql/test/miscellaneous/Tests/groupby_prepare.stable.out
sql/test/miscellaneous/Tests/select_groupby.stable.err
sql/test/miscellaneous/Tests/select_groupby.stable.out
sql/test/prepare/Tests/bind_with_cast.SF-1720934.stable.out
sql/test/prepare/Tests/crash_with_prepare_statement.Bug-2549.stable.out
sql/test/prepare/Tests/decimal_needs_truncation.SF-2605686.stable.out
sql/test/prepare/Tests/decimal_prepare.SF-1655818.stable.out
sql/test/prepare/Tests/fixed_limit_for_prepare.Bug-3208.stable.out
sql/test/prepare/Tests/insert-prepare.Bug-7230.stable.out
sql/test/prepare/Tests/large_prepare.SF-1363729.stable.out
sql/test/prepare/Tests/large_prepare_2.SF-1363729.stable.out
sql/test/prepare/Tests/limit_in_prepare.Bug-2552.stable.out
sql/test/prepare/Tests/prepare-complex.stable.out
sql/test/prepare/Tests/prepare-insert-into.stable.out
sql/test/prepare/Tests/prepare-mergetable.stable.out
sql/test/prepare/Tests/prepare-smallint.Bug-3297.stable.out
sql/test/prepare/Tests/prepare-smallint.Bug-3297.stable.out.int128
sql/test/prepare/Tests/prepare-types.Bug-6724.stable.err
sql/test/prepare/Tests/prepare-types.Bug-6724.stable.out
sql/test/prepare/Tests/prepare-utf8.Bug-3930.stable.out
sql/test/prepare/Tests/prepare-view.stable.out

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.stable.err

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.stable.out
sql/test/prepare/Tests/prepare_commit_execute.SF-2606020.stable.out
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.stable.err
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.stable.out
sql/test/prepare/Tests/prepare_decimal_float.SF-1675795.stable.out
sql/test/prepare/Tests/prepare_doesnot_like_LIKE.SF-1234205.stable.out
sql/test/prepare/Tests/prepare_on_boolean_bug.Bug-2581.stable.out

sql/test/prepare/Tests/prepare_statements_crash_server.Bug-2599.stable.out

sql/test/prepare/Tests/prepare_statements_crash_server.Bug-2599.stable.out.int128
sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.stable.out
sql/test/prepare/Tests/prepare_unop_crash.Bug-3653.stable.out
sql/test/prepare/Tests/prepared-merge-statement.Bug-6706.stable.err
sql/test/prepare/Tests/prepared-merge-statement.Bug-6706.stable.out

sql/test/prepare/Tests/prepared-select-with-error-causes-hang.Bug-6761.stable.out
sql/test/prepare/Tests/prepared-statement-with-udf.Bug-6650.stable.out
sql/test/prepare/Tests/rename_exps.Bug-3974.stable.out
sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out
sql/test/prepare/Tests/sample.15.stable.err
sql/test/prepare/Tests/sample.15.stable.out
sql/test/prepare/Tests/sqlancer_prepare.stable.err
sql/test/prepare/Tests/sqlancer_prepare.stable.err.int128
sql/test/prepare/Tests/sqlancer_prepare.stable.out
sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
sql/test/prepare/Tests/subquery_prepare.stable.err
sql/test/prepare/Tests/subquery_prepare.stable.out
testing/Mtest.py.in
testing/sqltest.py
Branch: Aug2024
Log Message:

Fix up all stable output that is checked using sqltest.
Also, when Mtest.py --approve is used, the assertMatchStable* methods
now produce .newtest files in the test target directories (just like
already happened for .test and .test.in files).


diffs (truncated from 4606 to 300 lines):

diff --git a/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out 
b/

MonetDB: Aug2024 - Remove backslash at end of last line.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: fb489eca5335 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fb489eca5335
Modified Files:
sql/test/prepare/Tests/prepare-insert-into.SQL.py
sql/test/prepare/Tests/prepare-mergetable.SQL.py
sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.SQL.py
Branch: Aug2024
Log Message:

Remove backslash at end of last line.


diffs (32 lines):

diff --git a/sql/test/prepare/Tests/prepare-insert-into.SQL.py 
b/sql/test/prepare/Tests/prepare-insert-into.SQL.py
--- a/sql/test/prepare/Tests/prepare-insert-into.SQL.py
+++ b/sql/test/prepare/Tests/prepare-insert-into.SQL.py
@@ -5,5 +5,4 @@ with SQLTestCase() as tc:
 with open('prepare-insert-into.sql') as f:
 tc.execute(query=None, client='mclient', stdin=f)\
 .assertSucceeded()\
-.assertMatchStableOut(fout='prepare-insert-into.stable.out')\
-
+.assertMatchStableOut(fout='prepare-insert-into.stable.out')
diff --git a/sql/test/prepare/Tests/prepare-mergetable.SQL.py 
b/sql/test/prepare/Tests/prepare-mergetable.SQL.py
--- a/sql/test/prepare/Tests/prepare-mergetable.SQL.py
+++ b/sql/test/prepare/Tests/prepare-mergetable.SQL.py
@@ -5,5 +5,4 @@ with SQLTestCase() as tc:
 with open('prepare-mergetable.sql') as f:
 tc.execute(query=None, client='mclient', stdin=f)\
 .assertSucceeded()\
-.assertMatchStableOut(fout='prepare-mergetable.stable.out')\
-
+.assertMatchStableOut(fout='prepare-mergetable.stable.out')
diff --git a/sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.SQL.py 
b/sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.SQL.py
--- a/sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.SQL.py
+++ b/sql/test/prepare/Tests/prepare_stmt.Bug-2533.Bug-2534.SQL.py
@@ -6,7 +6,4 @@ with SQLTestCase() as tc:
 with open('prepare_stmt.Bug-2533.Bug-2534.sql') as f:
 tc.execute(query=None, client='mclient', stdin=f)\
 .assertSucceeded()\
-
.assertMatchStableOut(fout='prepare_stmt.Bug-2533.Bug-2534.stable.out')\
-
-
-
+
.assertMatchStableOut(fout='prepare_stmt.Bug-2533.Bug-2534.stable.out')
___
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.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: fd8e396457b2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fd8e396457b2
Modified Files:
sql/server/rel_select.c
testing/Mtest.py.in
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 4769 to 300 lines):

diff --git a/sql/backends/monet5/vaults/csv/csv.c 
b/sql/backends/monet5/vaults/csv/csv.c
--- a/sql/backends/monet5/vaults/csv/csv.c
+++ b/sql/backends/monet5/vaults/csv/csv.c
@@ -452,12 +452,12 @@ csv_relation(mvc *sql, sql_subfunc *f, c
list_append(res_exps, ne);
} else {
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type %s not 
found\n", st);
+   return sa_message(sql->sa, "csv" "type %s not 
found\n", st);
}
} else {
/* shouldn't be possible, we fallback to strings */
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type unknown\n");
+   return sa_message(sql->sa, "csv" "type unknown\n");
}
}
GDKfree(types);
@@ -472,7 +472,7 @@ csv_relation(mvc *sql, sql_subfunc *f, c
r->extra_tsep = extra_tsep;
r->has_header = has_header;
f->sname = (char*)r; /* pass schema++ */
-   return MAL_SUCCEED;
+   return NULL;
 }
 
 static void *
@@ -484,7 +484,6 @@ csv_load(void *BE, sql_subfunc *f, char 
sql_table *t = NULL;
 
if (mvc_create_table( &t, be->mvc, be->mvc->session->tr->tmp/* misuse 
tmp schema */, f->tname /*gettable name*/, tt_table, false, SQL_DECLARED_TABLE, 
0, 0, false) != LOG_OK)
-   //throw(SQL, SQLSTATE(42000), "csv" RUNTIME_FILE_NOT_FOUND);
/* alloc error */
return NULL;
 
@@ -495,7 +494,6 @@ csv_load(void *BE, sql_subfunc *f, char 
sql_column *c = NULL;
 
if (!tp || mvc_create_column(&c, be->mvc, t, name, tp) != 
LOG_OK) {
-   //throw(SQL, SQLSTATE(42000), "csv" RUNTIME_LOAD_ERROR);
return NULL;
}
}
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1702,14 +1702,12 @@ push_join_exp(mvc *sql, sql_rel *rel, sq
 static sql_rel *
 rel_select_push_filter_exp_down(mvc *sql, sql_rel *rel, sql_exp *e, list *l, 
list *r, int ff)
 {
-   sql_exp *ll, *rr;
+   sql_exp *ll;
if (exps_card(r) <= CARD_ATOM && (exps_are_atoms(r) || 
exps_have_freevar(sql, r) || exps_have_freevar(sql, l))) {
if (exps_card(l) == exps_card(r) || rel->processed)  /* bin 
compare op */
return rel_select(sql->sa, rel, e);
if ((ll = exps_find_one_multi_exp(l)))
return push_select_exp(sql, rel, e, ll, ff);
-   } else if ((ll = exps_find_one_multi_exp(l)) && (rr = 
exps_find_one_multi_exp(r))) { /* join */
-   return push_join_exp(sql, rel, e, ll, rr, NULL, ff);
}
if (is_outerjoin(rel->op))
return rel_select(sql->sa, rel, e);
diff --git a/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out 
b/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
--- a/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
+++ b/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
@@ -1,33 +1,3 @@
-stdout of test 'mclient-lsql-D` in directory 'sql/test/BugTracker-2009` itself:
-
-
-# 21:51:00 >  
-# 21:51:00 >   mserver5 
"--config=/ufs/niels/scratch/rc/Linux-x86_64/etc/monetdb5.conf" --debug=10 
--set gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/rc/Linux-x86_64/lib/MonetDB5/bin"
 --set "gdk_dbfarm=/ufs/niels/scratch/rc/Linux-x86_64/var/MonetDB5/dbfarm"
--set mapi_open=true --set xrpc_open=true --set mapi_port=38418 --set 
xrpc_port=47399 --set monet_prompt= --trace  
"--dbname=mTests_src_test_BugTracker-2009" --set mal_listing=0 "--dbinit= 
include sql;" ; echo ; echo Over..
-# 21:51:00 >  
-
-# MonetDB server v5.12.0, based on kernel v1.30.0
-# Serving database 'mTests_src_test_BugTracker-2009', using 4 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
-# Copyright (c) 1993-July 2008 CWI.
-# Copyright (c) August 2008-2009 MonetDB B.V., all rights reserved
-# Visit http://monetdb.cwi.nl/ for further information
-# Listening for connection requests on mapi:monetdb://alf.ins.cwi.nl:38418/
-# MonetDB/SQL module v2.30.1 loaded
-
-#function user.main():void;
-#clients.quit();
-#end main;
-
-
-# 21:51:00 >  
-# 21:51:00 >  ./mclient-lsql-D.SQL.sh mclient-lsql-D 
-# 21:51:00 >  
-
-
-# 21:51:00 >  
-# 21:51:00 >  Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb 
--host=alf --port=38418  -D < /dev/null

MonetDB: default - Small approval.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: a4cfc7eb759f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a4cfc7eb759f
Modified Files:
sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out
Branch: default
Log Message:

Small approval.


diffs (12 lines):

diff --git a/sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out 
b/sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out
--- a/sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out
+++ b/sql/test/prepare/Tests/round-or-truncate.Bug-6193.stable.out
@@ -20,7 +20,7 @@
 % .%2 # table_name
 % %2 # name
 % decimal # type
-% 11 # length
+% 10 # length
 [ 1.777]
 #select cast(1.777 as integer);
 % .%2 # table_name
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ordered-set-aggregates - Merge with default branch.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: ced3016179b8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ced3016179b8
Modified Files:
sql/server/rel_select.c
Branch: ordered-set-aggregates
Log Message:

Merge with default branch.


diffs (truncated from 4844 to 300 lines):

diff --git a/sql/backends/monet5/vaults/csv/csv.c 
b/sql/backends/monet5/vaults/csv/csv.c
--- a/sql/backends/monet5/vaults/csv/csv.c
+++ b/sql/backends/monet5/vaults/csv/csv.c
@@ -37,15 +37,17 @@ csv_open_file(char* filename)
 static const char *
 next_delim(const char *s, const char *e, char delim, char quote)
 {
-   bool inquote = false;
-   for(;  s < e; s++) {
-   if (*s == quote)
-   inquote = !inquote;
-   else if (!inquote && *s == delim)
+   if (s && e) {
+   bool inquote = false;
+   for(;  s < e; s++) {
+   if (*s == quote)
+   inquote = !inquote;
+   else if (!inquote && *s == delim)
+   return s;
+   }
+   if (s <= e)
return s;
}
-   if (s <= e)
-   return s;
return NULL;
 }
 
@@ -242,6 +244,7 @@ detect_time(const char *s, const char *e
 static bool
 detect_date(const char *s, const char *e)
 {
+   /* TODO detect negative years */
if ((e-s) != 10)
return false;
/* -MM-DD */
@@ -256,6 +259,7 @@ detect_date(const char *s, const char *e
 static bool
 detect_timestamp(const char *s, const char *e)
 {
+   /* TODO detect negative years */
if ((e-s) != 16)
return false;
/* DATE TIME */
@@ -276,24 +280,26 @@ detect_types_row(const char *s, const ch
int scale = 0;
 
types[i].type = CSV_STRING;
-   if (n) {
+   types[i].scale = 0;
+   if (n && s) {
if (detect_null(s,n))
types[i].type = CSV_NULL;
else if (detect_bool(s,n))
types[i].type = CSV_BOOLEAN;
else if (detect_bigint(s, n))
types[i].type = CSV_BIGINT;
-   else if (detect_decimal(s, n, &scale))
+   else if (detect_decimal(s, n, &scale)) {
types[i].type = CSV_DECIMAL;
+   types[i].scale = scale;
+   }
else if (detect_time(s, n))
types[i].type = CSV_TIME;
else if (detect_date(s, n))
types[i].type = CSV_DATE;
else if (detect_timestamp(s, n))
types[i].type = CSV_TIMESTAMP;
-   types[i].scale = scale;
+   s = n+1;
}
-   s = n+1;
}
return types;
 }
@@ -310,7 +316,7 @@ detect_types(const char *buf, char delim
 
if (!e)
break;
-   csv_type *ntypes = detect_types_row( cur, e, delim, quote, 
nr_fields);
+   csv_type *ntypes = detect_types_row(cur, e, delim, quote, 
nr_fields);
if (!ntypes)
return NULL;
cur = e+1;
@@ -397,9 +403,7 @@ static str
 csv_relation(mvc *sql, sql_subfunc *f, char *filename, list *res_exps, char 
*tname)
 {
stream *file = csv_open_file(filename);
-   char buf[8196+1];
-
-   if(file == NULL)
+   if (file == NULL)
return RUNTIME_FILE_NOT_FOUND;
 
/*
@@ -407,6 +411,7 @@ csv_relation(mvc *sql, sql_subfunc *f, c
 * detect types
 * detect header
 */
+   char buf[8196+1];
ssize_t l = mnstr_read(file, buf, 1, 8196);
mnstr_close(file);
mnstr_destroy(file);
@@ -424,7 +429,7 @@ csv_relation(mvc *sql, sql_subfunc *f, c
 
f->tname = tname;
 
-   const char *p = buf, *ep = strchr(p, '\n');;
+   const char *p = buf, *ep = strchr(p, '\n');
list *typelist = sa_list(sql->sa);
list *nameslist = sa_list(sql->sa);
for(int col = 0; col < nr_fields; col++) {
@@ -447,12 +452,12 @@ csv_relation(mvc *sql, sql_subfunc *f, c
list_append(res_exps, ne);
} else {
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type %s not 
found\n", st);
+   return sa_message(sql->sa, "csv" "type %s not 
found\n", st);
}
} else {
/* shouldn't be possible, we fallback to strings */
GDKfree(types);
-   throw(SQL, SQLSTATE(42000), "csv" "type unknown\n");
+   return sa_message(sql->sa, 

MonetDB: ordered-set-aggregates - Test canonicalization.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: 8caaf083789a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8caaf083789a
Modified Files:
sql/test/analytics/Tests/topn.test
Branch: ordered-set-aggregates
Log Message:

Test canonicalization.


diffs (12 lines):

diff --git a/sql/test/analytics/Tests/topn.test 
b/sql/test/analytics/Tests/topn.test
--- a/sql/test/analytics/Tests/topn.test
+++ b/sql/test/analytics/Tests/topn.test
@@ -12,6 +12,7 @@ FROM (
FROM t
   ) AS t__x0
  WHERE a3 <= 3
-) as t__x1;
+) as t__x1
 
 300
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: resource_management - use zalloc to initialize array

2024-12-06 Thread Niels Nes via checkin-list
Changeset: b5c648a726cf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b5c648a726cf
Modified Files:
monetdb5/optimizer/opt_mergetable.c
Branch: resource_management
Log Message:

use zalloc to initialize array


diffs (12 lines):

diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -2285,7 +2285,7 @@ OPTmergetableImplementation(Client cntxt
 
vars = (int *) ma_alloc(cntxt->ta, sizeof(int) * mb->vtop);
//maxvars = mb->vtop;
-   group_input = (char *) ma_alloc(cntxt->ta, sizeof(char) * mb->vtop);
+   group_input = (char *) ma_zalloc(cntxt->ta, sizeof(char) * mb->vtop);
if (vars == NULL || group_input == NULL) {
ma_close(cntxt->ta);
throw(MAL, "optimizer.mergetable", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Remove unused files.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: 30b427583523 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/30b427583523
Removed Files:
sql/test/pg_regress/Tests/int8.SQL.py
sql/test/pg_regress/Tests/int8.stable.err
sql/test/pg_regress/Tests/int8.stable.err.int128
sql/test/pg_regress/Tests/int8.stable.out
sql/test/pg_regress/Tests/int8.stable.out.int128
Branch: Aug2024
Log Message:

Remove unused files.


diffs (truncated from 502 to 300 lines):

diff --git a/sql/test/pg_regress/Tests/int8.SQL.py 
b/sql/test/pg_regress/Tests/int8.SQL.py
deleted file mode 100644
--- a/sql/test/pg_regress/Tests/int8.SQL.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
-import pymonetdb, os
-
-conn1 = pymonetdb.connect(database=os.getenv("TSTDB"), 
port=int(os.getenv("MAPIPORT")), autocommit=True)
-cur1 = conn1.cursor()
-try:
-cur1.execute('select cast(1 as hugeint)')
-suffix = '.int128'
-except pymonetdb.DatabaseError as e:
-suffix = ''
-cur1.close()
-conn1.close()
-
-with SQLTestCase() as tc:
-# optional or default connection
-tc.connect()
-with open('int8.sql') as f:
-tc.execute(query=None, client='mclient', stdin=f)\
-.assertMatchStableOut(fout='int8.stable.out%s' % (suffix))\
-.assertMatchStableError(ferr='int8.stable.err%s' % (suffix))
diff --git a/sql/test/pg_regress/Tests/int8.stable.err 
b/sql/test/pg_regress/Tests/int8.stable.err
deleted file mode 100644
--- a/sql/test/pg_regress/Tests/int8.stable.err
+++ /dev/null
@@ -1,104 +0,0 @@
-MAPI  = (monetdb) /var/tmp/mtest-19737/.s.monetdb.30205
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('  ');
-ERROR = !conversion of string '  ' to type lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('xxx');
-ERROR = !conversion of string 'xxx' to type lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('3908203590239580293850293850329485');
-ERROR = !conversion of string '3908203590239580293850293850329485' to type lng 
failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES 
('-1204982019841029840928340329840934');
-ERROR = !conversion of string '-1204982019841029840928340329840934' to type 
lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('- 123');
-ERROR = !conversion of string '- 123' to type lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('  345 5');
-ERROR = !conversion of string '  345 5' to type lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = INSERT INTO INT8_TBL(q1) VALUES ('');
-ERROR = !conversion of string '' to type lng failed.
-CODE  = 22018
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL WHERE q2 
<> 4567890123456789 ORDER BY q1, q2;
-ERROR = !overflow in calculation 4567890123456789*-4567890123456789.
-CODE  = 22003
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_1, to_char(q1, '9G999G999G999G999G999'), 
to_char(q2, '9,999,999,999,999,999') 
-   FROM INT8_TBL;
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'), 
to_char(q2, '9,999,999,999,999,999.999,999') 
-   FROM INT8_TBL;  
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_3, to_char( (q1 * -1), 'PR'), 
to_char( (q2 * -1), '.999PR') 
-   FROM INT8_TBL;
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_4, to_char( (q1 * -1), 'S'), 
to_char( (q2 * -1), 'S') 
-   FROM INT8_TBL;
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_5,  to_char(q2, 'MI') FROM 
INT8_TBL;  
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_6,  to_char(q2, 'FMS')FROM 
INT8_TBL;
-ERROR = !SELECT: no such binary operator 'to_char'(bigint,char)
-CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-3604/.s.monetdb.35433
-QUERY = SELECT '' AS to_char_7,  to_char(q2, 'FMTHPR') FROM 
INT8_TBL;
-ERROR = !SELECT: no such binary operator 'to_char'(bi

MonetDB: Aug2024 - Normalize test output: convert port number to...

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: 0080f4d3905d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0080f4d3905d
Modified Files:
sql/test/miscellaneous/Tests/deallocate.stable.err
sql/test/miscellaneous/Tests/groupby_prepare.stable.err
sql/test/miscellaneous/Tests/select_groupby.stable.err
sql/test/prepare/Tests/prepare-types.Bug-6724.stable.err

sql/test/prepare/Tests/prepare-where.SF-1238867.1238959.1238965.1240124.stable.err
sql/test/prepare/Tests/prepare_decimal_bug.SF-2831994.stable.err
sql/test/prepare/Tests/prepared-merge-statement.Bug-6706.stable.err
sql/test/prepare/Tests/sample.15.stable.err
sql/test/prepare/Tests/sqlancer_prepare.stable.err
sql/test/prepare/Tests/sqlancer_prepare.stable.err.int128
sql/test/prepare/Tests/subquery_prepare.stable.err
testing/sqltest.py
Branch: Aug2024
Log Message:

Normalize test output: convert port number to 5.
This happens in the --approve output.


diffs (truncated from 328 to 300 lines):

diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.err 
b/sql/test/miscellaneous/Tests/deallocate.stable.err
--- a/sql/test/miscellaneous/Tests/deallocate.stable.err
+++ b/sql/test/miscellaneous/Tests/deallocate.stable.err
@@ -1,16 +1,16 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = exec  0(false); --error, the last prepared statement, no longer exists;
 ERROR = !EXEC: PREPARED Statement missing '0'
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = DEALLOCATE  0; --error, last prepared statement already closed
 ERROR = !No prepared statement with id: 0
 CODE  = 07003
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = EXECUTE  1(false); --error, the last prepared statement, no longer 
exists;
 ERROR = !EXEC: PREPARED Statement missing '1'
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = DEALLOCATE 10; --error, it doesn't exist
 ERROR = !No prepared statement with id: 10
 CODE  = 07003
diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err 
b/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
--- a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
+++ b/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
@@ -1,28 +1,28 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select col0 from tab0 where (?) in (?); --error
 ERROR = !For the IN operator, both sides must have a type defined
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select ? = ALL (select ? from tab0) from tab0 t1; --error
 ERROR = !Cannot have a parameter (?) on both sides of an expression
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select 1 from tab0 where ? between ? and ?; --error
 ERROR = !Cannot have a parameter (?) on both sides of an expression
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select case when col0 = 0 then ? else ? end from tab0; --error
 ERROR = !Result type missing
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select case when col0 = 0 then ? when col0 = 1 then ? else ? 
end from tab0; --error
 ERROR = !Result type missing
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select max(?); --error
 ERROR = !MAX: parameters not allowed as arguments to aggregate functions
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select max(?) over (); --error
 ERROR = !MAX: parameters not allowed as arguments to window functions
 CODE  = 42000
diff --git a/sql/test/miscellaneous/Tests/select_groupby.stable.err 
b/sql/test/miscellaneous/Tests/select_groupby.stable.err
--- a/sql/test/miscellaneous/Tests/select_groupby.stable.err
+++ b/sql/test/miscellaneous/Tests/select_groupby.stable.err
@@ -1,16 +1,16 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = create function "sys"."dummy"("col1" blob, "col2" blob, "col3" 
integer) returns boolean external name "unknown"."idontexist"; --error, MAL 
implementation of sys.dummy doesn't exist.
 ERROR = !CREATE FUNCTION: external name unknown.idontexist not bound 
(sys.dummy)
 CODE  = 3F000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = SELECT "sys"."dummy"("fortieth-second", blob '', '0') AS "alias1", 
"fortieth-third" FROM "myschema"."mytable"; --error, function doesn't exist
 ERROR = !SELECT: no such operator 'sys'.'dummy'(blob, blob, varchar(1))
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = exec  7 (blob ''); --error, cannot cast
 ERROR = !types blob(0,0) and sec_interval(13,0) are not equal
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5

MonetDB: default - Merge with Aug2024 branch.

2024-12-06 Thread Sjoerd Mullender via checkin-list
Changeset: 3cb1c0ef99c8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3cb1c0ef99c8
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 830 to 300 lines):

diff --git a/sql/test/miscellaneous/Tests/deallocate.stable.err 
b/sql/test/miscellaneous/Tests/deallocate.stable.err
--- a/sql/test/miscellaneous/Tests/deallocate.stable.err
+++ b/sql/test/miscellaneous/Tests/deallocate.stable.err
@@ -1,16 +1,16 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = exec  0(false); --error, the last prepared statement, no longer exists;
 ERROR = !EXEC: PREPARED Statement missing '0'
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = DEALLOCATE  0; --error, last prepared statement already closed
 ERROR = !No prepared statement with id: 0
 CODE  = 07003
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = EXECUTE  1(false); --error, the last prepared statement, no longer 
exists;
 ERROR = !EXEC: PREPARED Statement missing '1'
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = DEALLOCATE 10; --error, it doesn't exist
 ERROR = !No prepared statement with id: 10
 CODE  = 07003
diff --git a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err 
b/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
--- a/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
+++ b/sql/test/miscellaneous/Tests/groupby_prepare.stable.err
@@ -1,28 +1,28 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select col0 from tab0 where (?) in (?); --error
 ERROR = !For the IN operator, both sides must have a type defined
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select ? = ALL (select ? from tab0) from tab0 t1; --error
 ERROR = !Cannot have a parameter (?) on both sides of an expression
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select 1 from tab0 where ? between ? and ?; --error
 ERROR = !Cannot have a parameter (?) on both sides of an expression
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select case when col0 = 0 then ? else ? end from tab0; --error
 ERROR = !Result type missing
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select case when col0 = 0 then ? when col0 = 1 then ? else ? 
end from tab0; --error
 ERROR = !Result type missing
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select max(?); --error
 ERROR = !MAX: parameters not allowed as arguments to aggregate functions
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = prepare select max(?) over (); --error
 ERROR = !MAX: parameters not allowed as arguments to window functions
 CODE  = 42000
diff --git a/sql/test/miscellaneous/Tests/select_groupby.stable.err 
b/sql/test/miscellaneous/Tests/select_groupby.stable.err
--- a/sql/test/miscellaneous/Tests/select_groupby.stable.err
+++ b/sql/test/miscellaneous/Tests/select_groupby.stable.err
@@ -1,16 +1,16 @@
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = create function "sys"."dummy"("col1" blob, "col2" blob, "col3" 
integer) returns boolean external name "unknown"."idontexist"; --error, MAL 
implementation of sys.dummy doesn't exist.
 ERROR = !CREATE FUNCTION: external name unknown.idontexist not bound 
(sys.dummy)
 CODE  = 3F000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = SELECT "sys"."dummy"("fortieth-second", blob '', '0') AS "alias1", 
"fortieth-third" FROM "myschema"."mytable"; --error, function doesn't exist
 ERROR = !SELECT: no such operator 'sys'.'dummy'(blob, blob, varchar(1))
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = exec  7 (blob ''); --error, cannot cast
 ERROR = !types blob(0,0) and sec_interval(13,0) are not equal
 CODE  = 42000
-MAPI  = monetdb@localhost:35929
+MAPI  = monetdb@localhost:5
 QUERY = exec  8 (time '10:00:00' + 1); --error, no such binary operator
 ERROR = !SELECT: no such binary operator 'sys'.'sql_add'(time,tinyint)
 CODE  = 42000
diff --git a/sql/test/pg_regress/Tests/int8.SQL.py 
b/sql/test/pg_regress/Tests/int8.SQL.py
deleted file mode 100644
--- a/sql/test/pg_regress/Tests/int8.SQL.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from MonetDBtesting.sqltest import SQLTestCase
-import pymonetdb, os
-
-conn1 = pymonetdb.connect(database=os.getenv("TSTDB"), 
port=int(os.getenv("MAPIPORT")), autocommit=True)
-cur1 = conn1.cursor()
-try:
-cur1.execute('select cast(1 as hugeint)')
-suffix = '.int128'
-except pymonetdb.DatabaseError as e:
-suffix = ''
-cur1.close()
-conn1.close()
-
-with SQLTestCase() as tc:
-# optional or default connection
-tc.connect()
-with open('int8.sql') as f:
-