Changeset: b1caa9cffe33 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b1caa9cffe33
Modified Files:
        monetdb5/modules/mal/tablet.c
        sql/backends/monet5/sql_result.c
        sql/test/copy/Tests/int_parse.stable.err
Branch: resultset
Log Message:

Bypass sql_error
In best-effort mode we should not issue a sql_error, because
it implictly aborts the transaction.


diffs (59 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
@@ -1461,7 +1461,6 @@ SQLload_file(Client cntxt, Tablet *as, b
        for(j = 0; j < (int) limit; j++, src++){\
                if ( task->rowerror[j]){\
                        leftover--;\
-                       cnt--;\
                        continue;\
                }\
                *dst++ = *src;\
@@ -1484,7 +1483,6 @@ SQLload_file(Client cntxt, Tablet *as, b
                                                for(j = 0; j < (int) limit; 
j++, src++){
                                                        if ( task->rowerror[j]){
                                                                leftover--;
-                                                               cnt--;
                                                                continue;
                                                        }
                                                        *dst++ = *src;
@@ -1517,6 +1515,7 @@ SQLload_file(Client cntxt, Tablet *as, b
                        res = -1;
        }
 
+       cnt= BATcount(task->as->format[0].c);
        if (GDKdebug & GRPalgorithms) 
        {
                if (cnt < (BUN) maxrow)
diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c
--- a/sql/backends/monet5/sql_result.c
+++ b/sql/backends/monet5/sql_result.c
@@ -827,7 +827,7 @@ mvc_import_table(Client cntxt, mvc *m, b
                        }
                }
                if (as.error) {
-                       sql_error(m, 500, "%s", as.error);
+                       if( !best) sql_error(m, 500, "%s", as.error);
                        if (as.error != M5OutOfMemory)
                                GDKfree(as.error);
                        as.error = NULL;
diff --git a/sql/test/copy/Tests/int_parse.stable.err 
b/sql/test/copy/Tests/int_parse.stable.err
--- a/sql/test/copy/Tests/int_parse.stable.err
+++ b/sql/test/copy/Tests/int_parse.stable.err
@@ -79,13 +79,13 @@ stderr of test 'int_parse` in directory 
 # 19:40:24 >  mclient -lsql -umonetdb -Pmonetdb --host=eir --port=37659 
 # 19:40:24 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-4363/.s.monetdb.38666
+MAPI  = (monetdb) /var/tmp/mtest-2818/.s.monetdb.35617
 QUERY = copy 3 records into t_int from stdin USING DELIMITERS ',','\n','\"' 
NULL AS '';
         0
         5.1
         9
-
-MAPI  = (monetdb) /var/tmp/mtest-4363/.s.monetdb.38666
+ERROR = !line 2 field 1 'int' expected in '5.1'. Failed to import table
+MAPI  = (monetdb) /var/tmp/mtest-2818/.s.monetdb.35617
 QUERY = copy 5 records into t_int from stdin delimiters ',','\n' NULL as '';
         1
         nil
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to