Changeset: 3512adb33674 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3512adb33674
Modified Files:
sql/backends/monet5/sql.c
sql/test/bincopy/Tests/bincopy_broken_strings_on_client.stable.err
sql/test/bincopy/Tests/bincopy_broken_strings_on_server.stable.err
Branch: copybinary
Log Message:
Use same code ON CLIENT and ON SERVER
Fixing a failure and a crash
diffs (73 lines):
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -3274,7 +3274,8 @@ BATattach_stream(BAT **result, int tt, s
end:
if (in != NULL){
- *eof = in->eof;
+ if (eof != NULL)
+ *eof = in->eof;
in->s = NULL;
bstream_destroy(in);
}
@@ -3398,10 +3399,18 @@ mvc_bin_import_table_wrap(Client cntxt,
if (msg != NULL)
goto bailout;
} else {
- c = BATattach(tpe, fname, TRANSIENT);
+ stream *s = open_rstream(fname);
+ if (s != NULL)
+ msg = BATattach_stream(&c, tpe, s, 0,
NULL);
+ else
+ msg = createException(
+ SQL,
"mvc_bin_import_table_wrap",
+ SQLSTATE(42000) "Failed to
attach file %s: %s",
+ fname, mnstr_peek_error(NULL));
}
if (c == NULL) {
- msg = createException(SQL, "sql",
SQLSTATE(42000) "Failed to attach file %s", fname);
+ if (msg == NULL)
+ msg = createException(SQL, "sql",
SQLSTATE(42000) "Failed to attach file %s", fname);
goto bailout;
}
if (BATsetaccess(c, BAT_READ) != GDK_SUCCEED) {
diff --git a/sql/test/bincopy/Tests/bincopy_broken_strings_on_client.stable.err
b/sql/test/bincopy/Tests/bincopy_broken_strings_on_client.stable.err
--- a/sql/test/bincopy/Tests/bincopy_broken_strings_on_client.stable.err
+++ b/sql/test/bincopy/Tests/bincopy_broken_strings_on_client.stable.err
@@ -21,9 +21,10 @@ stderr of test 'bincopy_broken_strings_o
-# 10:17:52 >
-# 10:17:52 > "/usr/bin/python3.7" "bincopy_broken_strings_on_client.SQL.py"
"bincopy_broken_strings_on_client"
-# 10:17:52 >
+MAPI = (monetdb) /var/tmp/mtest-29878/.s.monetdb.38969
+QUERY = COPY BINARY INTO foo(id, s) FROM R'/tmp/jvr/bincopy_ints.bin',
R'/tmp/jvr/bincopy_broken_strings.bin' ON CLIENT;
+
+ERROR = !malformed utf-8 byte sequence
# 10:17:52 >
diff --git a/sql/test/bincopy/Tests/bincopy_broken_strings_on_server.stable.err
b/sql/test/bincopy/Tests/bincopy_broken_strings_on_server.stable.err
--- a/sql/test/bincopy/Tests/bincopy_broken_strings_on_server.stable.err
+++ b/sql/test/bincopy/Tests/bincopy_broken_strings_on_server.stable.err
@@ -28,12 +28,12 @@ stderr of test 'bincopy_broken_strings_o
# 10:17:52 > mclient -lsql -ftest -tnone -Eutf-8 -i -e
--host=/var/tmp/mtest-17076 --port=32201 --database=mTests_sql_test_bincopy
# 10:17:52 >
-MAPI = (monetdb) /var/tmp/mtest-17076/.s.monetdb.32201
-QUERY = COPY BINARY INTO foo(id, s) FROM
R'/home/jvr/monets/copybinary/inst/mTests/sql/test/bincopy/bincopy_ints.bin',
R'/home/jvr/monets/copybinary/inst/mTests/sql/test/bincopy/bincopy_broken_strings.bin'
ON SERVER;
+MAPI = (monetdb) /var/tmp/mtest-29878/.s.monetdb.38969
+QUERY = COPY BINARY INTO foo(id, s) FROM R'/tmp/jvr/bincopy_ints.bin',
R'/tmp/jvr/bincopy_broken_strings.bin' ON SERVER;
-CODE = 42000
+ERROR = !malformed utf-8 byte sequence
-# 10:17:53 >
-# 10:17:53 > "Done."
-# 10:17:53 >
+# 16:40:12 >
+# 16:40:12 > "Done."
+# 16:40:12 >
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list