Changeset: f9bdeb17addb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f9bdeb17addb
Modified Files:
monetdb5/modules/mal/tablet.c
Branch: directappend
Log Message:
Factor append error handling out of SQLinsert_val
diffs (45 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
@@ -795,6 +795,8 @@ SQLload_error(READERtask *task, lng idx,
return line;
}
+static void report_append_failed(READERtask *task, Column *fmt, int idx, lng
col);
+
/*
* The parsing of the individual values is straightforward. If the value
represents
* the null-replacement string then we grab the underlying nil.
@@ -908,6 +910,14 @@ SQLinsert_val(READERtask *task, int col,
} else if (bunfastapp(fmt->c, adt) == GDK_SUCCEED)
return ret;
+ report_append_failed(task, fmt, idx, col);
+ return -1;
+}
+
+static void
+report_append_failed(READERtask *task, Column *fmt, int idx, lng col)
+{
+ char *err;
/* failure */
if (task->rowerror) {
lng row = BATcount(task->loadops ?
task->loadops->get_offsets(task->loadops->state) : fmt->c);
@@ -916,7 +926,7 @@ SQLinsert_val(READERtask *task, int col,
BUNappend(task->cntxt->error_row, &row, false) !=
GDK_SUCCEED ||
BUNappend(task->cntxt->error_fld, &col, false) !=
GDK_SUCCEED ||
BUNappend(task->cntxt->error_msg, "insert failed",
false) != GDK_SUCCEED ||
- (err = SQLload_error(task, idx,task->as->nr_attrs)) ==
NULL ||
+ (err = SQLload_error(task, idx, task->as->nr_attrs)) ==
NULL ||
BUNappend(task->cntxt->error_input, err, false) !=
GDK_SUCCEED)
task->besteffort = 0;
GDKfree(err);
@@ -925,7 +935,7 @@ SQLinsert_val(READERtask *task, int col,
MT_lock_unset(&errorlock);
}
task->besteffort = 0; /* no longer best effort */
- return -1;
+
}
static int
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list