Changeset: b60238e22873 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b60238e22873 Modified Files: gdk/gdk_select.c sql/backends/monet5/sql.c Branch: default Log Message:
merged with Dec2016 diffs (67 lines): diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c --- a/gdk/gdk_select.c +++ b/gdk/gdk_select.c @@ -1369,7 +1369,10 @@ BATselect(BAT *b, BAT *s, const void *tl s ? BATgetId(s) : "NULL", s && BATtdense(s) ? "(dense)" : "", anti); if (s) { - return COLcopy(s, s->ttype, 0, TRANSIENT); + oid o = b->hseqbase + BATcount(b); + BUN q = SORTfndfirst(s, &o); + BUN p = SORTfndfirst(s, &b->hseqbase); + return BATslice(s, p, q); } else { return BATdense(0, b->hseqbase, BATcount(b)); } 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 @@ -2367,7 +2367,7 @@ DELTAbat(bat *result, const bat *col, co str DELTAsub(bat *result, const bat *col, const bat *cid, const bat *uid, const bat *uval, const bat *ins) { - BAT *c, *cminu, *u_id, *u_val, *u, *i = NULL, *res; + BAT *c, *cminu = NULL, *u_id, *u_val, *u, *i = NULL, *res; gdk_return ret; if ((u_id = BBPquickdesc(*uid, 0)) == NULL) @@ -4707,6 +4707,9 @@ vacuum(Client cntxt, MalBlkPtr mb, MalSt throw(SQL, name, "42000!insufficient privileges"); if ((!list_empty(t->idxs.set) || !list_empty(t->keys.set))) throw(SQL, name, "%s not allowed on tables with indices", name + 4); + if (t->system) + throw(SQL, name, "%s not allowed on system tables", name + 4); + if (has_snapshots(m->session->tr)) throw(SQL, name, "%s not allowed on snapshots", name + 4); if (!m->session->auto_commit) @@ -4813,9 +4816,14 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma throw(SQL, "sql.vacuum", "42000!insufficient privileges"); if ((!list_empty(t->idxs.set) || !list_empty(t->keys.set))) throw(SQL, "sql.vacuum", "vacuum not allowed on tables with indices"); + if (t->system) + throw(SQL, "sql.vacuum", "vacuum not allowed on system tables"); + if (has_snapshots(m->session->tr)) throw(SQL, "sql.vacuum", "vacuum not allowed on snapshots"); + if (!m->session->auto_commit) + throw(SQL, "sql.vacuum", "vacuum only allowed in auto commit mode"); tr = m->session->tr; for (o = t->columns.set->h; o && ordered == 0; o = o->next) { @@ -4835,11 +4843,12 @@ SQLvacuum(Client cntxt, MalBlkPtr mb, Ma if (BATcount(del) > 0) { /* now decide on the algorithm */ + BBPunfix(del->batCacheid); if (ordered) { if (BATcount(del) > cnt / 20) - SQLshrink(cntxt, mb, stk, pci); + return SQLshrink(cntxt, mb, stk, pci); } else { - SQLreuse(cntxt, mb, stk, pci); + return SQLreuse(cntxt, mb, stk, pci); } } BBPunfix(del->batCacheid); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list