Changeset: 6a3b25964a95 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a3b25964a95
Modified Files:
        monetdb5/extras/rapi/Tests/rapi02.stable.out
        monetdb5/modules/mal/tablet.c
Branch: Jul2015
Log Message:

approved output

(re)added error messages when splitting rows fails


diffs (54 lines):

diff --git a/monetdb5/extras/rapi/Tests/rapi02.stable.out 
b/monetdb5/extras/rapi/Tests/rapi02.stable.out
--- a/monetdb5/extras/rapi/Tests/rapi02.stable.out
+++ b/monetdb5/extras/rapi/Tests/rapi02.stable.out
@@ -112,7 +112,7 @@ Ready.
 [ 0@0, 4       ]
 [ 1@0, 20      ]
 [ 2@0, 0       ]
-[ 3@0, 1       ]
+[ 3@0, 2       ]
 #io.print(rintbi);
 #--------------------------#
 # h    t  # name
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
@@ -713,7 +713,7 @@ typedef struct {
 static void
 tablet_error(READERtask *task, lng row, int col, str msg, str fcn)
 {
-       if (task->cntxt->error_row == NULL) {
+       if (task->cntxt->error_row != NULL) {
                MT_lock_set(&errorlock, "tablet_error");
                BUNappend(task->cntxt->error_row, &row, FALSE);
                BUNappend(task->cntxt->error_fld, &col, FALSE);
@@ -722,13 +722,19 @@ tablet_error(READERtask *task, lng row, 
                if (task->as->error == NULL && (msg == NULL || (task->as->error 
= GDKstrdup(msg)) == NULL))
                        task->as->error = M5OutOfMemory;
                if (row != lng_nil)
-                       task->rowerror[row - 1]++;
+                       task->rowerror[row]++;
 #ifdef _DEBUG_TABLET_
                mnstr_printf(GDKout, "#tablet_error: " LLFMT ",%d:%s:%s\n",
                                         row, col, msg, fcn);
 #endif
                task->errorcnt++;
                MT_lock_unset(&errorlock, "tablet_error");
+       } else {
+               MT_lock_set(&errorlock, "tablet_error");
+               if (task->as->error == NULL && (msg == NULL || (task->as->error 
= GDKstrdup(msg)) == NULL))
+                       task->as->error = M5OutOfMemory;
+               task->errorcnt++;
+               MT_lock_unset(&errorlock, "tablet_error");
        }
 }
 
@@ -994,7 +1000,7 @@ SQLload_parse_line(READERtask *task, int
                                mnstr_printf(GDKout, "after #1 %s\n", s);
 #endif
                                if (!line) {
-                                       str errline = SQLload_error(task, 
task->top[task->cur]);
+                                       errline = SQLload_error(task, 
task->top[task->cur]);
                                        snprintf(errmsg, BUFSIZ, "Quote (%c) 
missing", task->quote);
                                        tablet_error(task, idx, (int) i, 
errmsg, errline);
                                        GDKfree(errline);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to