Changeset: bc6eb7167efe for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bc6eb7167efe
Modified Files:
gdk/gdk_logger.c
monetdb5/modules/mal/tablet.c
Branch: Oct2020
Log Message:
Merge with Jun2020 branch.
diffs (54 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
@@ -1235,12 +1235,13 @@ SQLproducer(void *p)
bool blocked[MAXBUFFERS] = { false };
bool ateof[MAXBUFFERS] = { false };
BUN cnt = 0, bufcnt[MAXBUFFERS] = { 0 };
- char *end, *e, *s = NULL, *base;
+ char *end = NULL, *e = NULL, *s = NULL, *base;
const char *rsep = task->rsep;
size_t rseplen = strlen(rsep), partial = 0;
char quote = task->quote;
dfa_t rdfa;
lng rowno = 0;
+ int more = 0;
MT_sema_down(&task->producer);
if (task->id < 0) {
@@ -1447,6 +1448,7 @@ SQLproducer(void *p)
task->cur = cur;
task->ateof = ateof[cur];
task->cnt = bufcnt[cur];
+ more = !ateof[cur] || (e && e < end && task->top[cur]
== task->limit);
/* TRC_DEBUG(MAL_SERVER, "SQL producer got buffer '%d'
filled with '%d' records\n", cur, task->top[cur]);*/
MT_sema_up(&task->consumer);
@@ -1464,7 +1466,7 @@ SQLproducer(void *p)
/* TRC_DEBUG(MAL_SERVER, "Continue producer buffer: %d\n", cur);*/
/* we ran out of input? */
- if (task->ateof) {
+ if (task->ateof && !more) {
/* TRC_DEBUG(MAL_SERVER, "Producer encountered eof\n");*/
GDKfree(rdfa);
return;
@@ -1528,7 +1530,7 @@ SQLload_file(Client cntxt, Tablet *as, b
BUN i, attr;
READERtask task;
READERtask ptask[MAXWORKERS];
- int threads = (maxrow< 0 || maxrow > (1 << 16)) ? (GDKnr_threads <
MAXWORKERS && GDKnr_threads > 1 ? GDKnr_threads - 1 : MAXWORKERS - 1) : 1;
+ int threads = (maxrow< 0 || maxrow > (1 << 16)) && GDKnr_threads > 1 ?
(GDKnr_threads < MAXWORKERS ? GDKnr_threads - 1 : MAXWORKERS - 1) : 1;
lng lio = 0, tio, t1 = 0, total = 0, iototal = 0;
char name[MT_NAME_LEN];
@@ -1836,6 +1838,9 @@ SQLload_file(Client cntxt, Tablet *as, b
task.maxrow = cnt;
task.state = ENDOFCOPY;
}
+ if (task.ateof && task.top[task.cur] < task.limit && cnt !=
task.maxrow)
+ break;
+ task.top[task.cur] = 0;
MT_sema_up(&task.producer);
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list