Changeset: 7a5b6b8d583d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a5b6b8d583d
Added Files:
        sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py
Modified Files:
        sql/backends/monet5/sql.mx
        sql/test/BugTracker-2013/Tests/All
Branch: Feb2013
Log Message:

fixed bug 3345


diffs (53 lines):

diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -4377,8 +4377,8 @@ mvc_bin_import_table_wrap(Client cntxt, 
                default:
                        throw(SQL, "sql", "failed to attach file %s", 
*(str*)getArgReference(stk, pci, i));
                }
-               if (i!=(pci->retc + 2) && cnt != BATcount(c)) 
-                       throw(SQL, "sql", "table %s not found", tname);
+               if (i!=(pci->retc + 2) && cnt != BATcount(c))
+                       throw(SQL, "sql", "binary files for table '%s' have 
inconsistent counts", tname);
                cnt = BATcount(c);
                *(int*)getArgReference(stk, pci, i-(2+pci->retc)) = 
c->batCacheid;
                BBPkeepref(c->batCacheid);
diff --git a/sql/test/BugTracker-2013/Tests/All 
b/sql/test/BugTracker-2013/Tests/All
--- a/sql/test/BugTracker-2013/Tests/All
+++ b/sql/test/BugTracker-2013/Tests/All
@@ -39,3 +39,4 @@ bogus_aggregation_casts.Bug-3342
 nestedcalls
 like_pcre_or.Bug-3348
 duplicate_column_name.Bug-3349
+binary_copy_into.Bug-3345
diff --git a/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py 
b/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py
@@ -0,0 +1,26 @@
+import os, sys, shutil
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+src = os.environ['RELSRCDIR']
+dst = os.environ['TSTTRGDIR']
+
+clt = process.client('sql',
+                     stdin = process.PIPE,
+                     stdout = process.PIPE,
+                     stderr = process.PIPE,
+                     interactive = False,
+                     echo = False)
+
+shutil.copyfile(os.path.join(src,'n_nationkey.sorted'), 
os.path.join(dst,'n_nationkey.sorted'))
+shutil.copyfile(os.path.join(src,'n_regionkey.sorted'), 
os.path.join(dst,'n_regionkey.sorted'))
+
+clt.stdin.write('start transaction;');
+clt.stdin.write('create table bug (n_nationkey INTEGER,n_regionkey 
INTEGER);\n')
+clt.stdin.write('copy binary into bug from \'%s/n_nationkey.sorted\', 
\'%s/n_regionkey.sorted\';\n'% (dst,dst))
+
+out, err = clt.communicate()
+sys.stdout.write(out)
+sys.stderr.write(err)
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to