Changeset: 03187aaf584a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03187aaf584a
Added Files:
        sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.sql
        
sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.err
        
sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.out
Modified Files:
        monetdb5/modules/mal/tablet.c
        sql/test/BugTracker-2017/Tests/All
Branch: Jul2017
Log Message:

fixed bug 6442, skip columns also in the best effort case


diffs (195 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
@@ -1833,6 +1833,8 @@ SQLload_file(Client cntxt, Tablet *as, b
                        int width;
 
                        for (attr = 0; attr < as->nr_attrs; attr++) {
+                               if (as->format[attr].skip)
+                                       continue;
                                width = as->format[attr].c->twidth;
                                switch (width){
                                case 1:
diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -92,3 +92,4 @@ HAVE_LIBPY?table_returning_with.Bug-6444
 insert_into_multiple_subqueries.Bug-6448
 HAVE_SAMTOOLS?sqlsmith.Bug-6449
 HAVE_LIBPY?python_loader_clobbers_default_with_null.Bug-6464
+skip_problem_best_effort.Bug-6442
diff --git 
a/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.sql 
b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.sql
@@ -0,0 +1,35 @@
+
+start transaction;
+create table t ( c1 int , c2 int );
+copy 1 records into t (c1) from stdin (c1,c2) best effort;
+1|2
+select * from t;
+rollback;
+
+start transaction;
+create table t ( c1 int , c2 int );
+copy 1 records into t (c2) from stdin (c1,c2) best effort;
+1|2
+select * from t;
+rollback;
+
+start transaction;
+create table t ( c1 int , c2 int );
+copy 1 records into t (c1,c2) from stdin (x,c1,c2) best effort;
+0|1|2
+select * from t;
+rollback;
+
+start transaction;
+create table t ( c1 int , c2 int );
+copy 1 records into t (c1,c2) from stdin (c1,x,c2) best effort;
+1|0|2
+select * from t;
+rollback;
+
+start transaction;
+create table t ( c1 int , c2 int );
+copy 1 records into t (c1,c2) from stdin (c1,c2,x) best effort;
+1|2|0
+select * from t;
+rollback;
diff --git 
a/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.err 
b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.err
@@ -0,0 +1,34 @@
+stderr of test 'skip_problem_best_effort.Bug-6442` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 15:20:22 >  
+# 15:20:22 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32985" "--set" 
"mapi_usock=/var/tmp/mtest-5456/.s.monetdb.32985" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017"
+# 15:20:22 >  
+
+# builtin opt  gdk_dbpath = 
/home/niels/scratch/rc-monetdb/Linux-x86_64/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 32985
+# cmdline opt  mapi_usock = /var/tmp/mtest-5456/.s.monetdb.32985
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017
+# cmdline opt  gdk_debug = 536870922
+
+# 15:20:23 >  
+# 15:20:23 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-5456" "--port=32985"
+# 15:20:23 >  
+
+
+# 15:20:23 >  
+# 15:20:23 >  "Done."
+# 15:20:23 >  
+
diff --git 
a/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.out 
b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.stable.out
@@ -0,0 +1,91 @@
+stdout of test 'skip_problem_best_effort.Bug-6442` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 15:20:22 >  
+# 15:20:22 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32985" "--set" 
"mapi_usock=/var/tmp/mtest-5456/.s.monetdb.32985" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/niels/scratch/rc-monetdb/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2017"
+# 15:20:22 >  
+
+# MonetDB 5 server v11.27.6
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2017', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 7.330 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://localhost.nes.nl:32985/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-5456/.s.monetdb.32985
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 15:20:23 >  
+# 15:20:23 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-5456" "--port=32985"
+# 15:20:23 >  
+
+#start transaction;
+#create table t ( c1 int , c2 int );
+#copy 1 records into t (c1) from stdin (c1,c2) best effort;
+#1|2
+[ 1    ]
+#select * from t;
+% sys.t,       sys.t # table_name
+% c1,  c2 # name
+% int, int # type
+% 1,   1 # length
+[ 1,   NULL    ]
+#rollback;
+#start transaction;
+#create table t ( c1 int , c2 int );
+#copy 1 records into t (c2) from stdin (c1,c2) best effort;
+#1|2
+[ 1    ]
+#select * from t;
+% sys.t,       sys.t # table_name
+% c1,  c2 # name
+% int, int # type
+% 1,   1 # length
+[ NULL,        2       ]
+#rollback;
+#start transaction;
+#create table t ( c1 int , c2 int );
+#copy 1 records into t (c1,c2) from stdin (x,c1,c2) best effort;
+#0|1|2
+[ 1    ]
+#select * from t;
+% sys.t,       sys.t # table_name
+% c1,  c2 # name
+% int, int # type
+% 1,   1 # length
+[ 1,   2       ]
+#rollback;
+#start transaction;
+#create table t ( c1 int , c2 int );
+#copy 1 records into t (c1,c2) from stdin (c1,x,c2) best effort;
+#1|0|2
+[ 1    ]
+#select * from t;
+% sys.t,       sys.t # table_name
+% c1,  c2 # name
+% int, int # type
+% 1,   1 # length
+[ 1,   2       ]
+#rollback;
+#start transaction;
+#create table t ( c1 int , c2 int );
+#copy 1 records into t (c1,c2) from stdin (c1,c2,x) best effort;
+#1|2|0
+[ 1    ]
+#select * from t;
+% sys.t,       sys.t # table_name
+% c1,  c2 # name
+% int, int # type
+% 1,   1 # length
+[ 1,   2       ]
+#rollback;
+
+# 15:20:23 >  
+# 15:20:23 >  "Done."
+# 15:20:23 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to