Changeset: 55cd1907ad24 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55cd1907ad24
Modified Files:
monetdb5/modules/mal/tablet.c
sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:
Merge with Dec2016 branch.
diffs (78 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
@@ -959,6 +959,9 @@ SQLworker_column(READERtask *task, int c
int i;
Column *fmt = task->as->format;
+ if (fmt[col].c == NULL)
+ return 0;
+
/* watch out for concurrent threads */
MT_lock_set(&mal_copyLock);
if (!fmt[col].skip && BATcapacity(fmt[col].c) < BATcount(fmt[col].c) +
task->next) {
@@ -1617,6 +1620,7 @@ SQLload_file(Client cntxt, Tablet *as, b
BUN cnt = 0, cntstart = 0, leftover = 0;
int res = 0; /* < 0: error, > 0: success, == 0: continue
processing */
int j;
+ BUN firstcol;
BUN i, attr;
READERtask *task = (READERtask *) GDKzalloc(sizeof(READERtask));
READERtask ptask[MAXWORKERS];
@@ -1762,10 +1766,13 @@ SQLload_file(Client cntxt, Tablet *as, b
#ifdef MLOCK_TST
mlock(task->b->buf, task->b->size);
#endif
+ for (firstcol = 0; firstcol < task->as->nr_attrs; firstcol++)
+ if (task->as->format[firstcol].c != NULL)
+ break;
while (res == 0 && cnt < task->maxrow) {
// track how many elements are in the aggregated BATs
- cntstart = BATcount(task->as->format[0].c);
+ cntstart = BATcount(task->as->format[firstcol].c);
/* block until the producer has data available */
MT_sema_down(&task->consumer);
cnt += task->top[task->cur];
@@ -1857,9 +1864,9 @@ SQLload_file(Client cntxt, Tablet *as, b
#ifdef _DEBUG_TABLET_
mnstr_printf(GDKout, "#Trim bbest %d table size " BUNFMT " rows
found so far " BUNFMT "\n",
- best, BATcount(as->format[0].c),
task->cnt);
+ best,
BATcount(as->format[firstcol].c), task->cnt);
#endif
- if (best && BATcount(as->format[0].c)) {
+ if (best && BATcount(as->format[firstcol].c)) {
BUN limit;
int width;
@@ -1920,7 +1927,7 @@ SQLload_file(Client cntxt, Tablet *as, b
task->ateof, res);
#endif
- cnt = BATcount(task->as->format[0].c);
+ cnt = BATcount(task->as->format[firstcol].c);
if (GDKdebug & GRPalgorithms) {
mnstr_printf(GDKout, "#COPY reader time " LLFMT " line break "
LLFMT " io " LLFMT "\n",
total, lio, iototal);
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
@@ -483,7 +483,7 @@ sql_update_geom(Client c, mvc *sql, int
}
static str
-sql_update_default(Client c, mvc *sql)
+sql_update_dec2016(Client c, mvc *sql)
{
size_t bufsize = 12240, pos = 0;
char *buf = GDKmalloc(bufsize), *err = NULL;
@@ -1284,7 +1284,7 @@ SQLupgrades(Client c, mvc *m)
sql_find_subtype(&tp, "clob", 0, 0);
if (!sql_bind_func3(m->sa, s, "createorderindex", &tp, &tp, &tp,
F_PROC)) {
- if ((err = sql_update_default(c, m)) != NULL) {
+ if ((err = sql_update_dec2016(c, m)) != NULL) {
fprintf(stderr, "!%s\n", err);
GDKfree(err);
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list