Changeset: d7573a358e8e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d7573a358e8e
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:

Fun with SQLSTATE


diffs (71 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
@@ -3164,7 +3164,7 @@ BATattach_str(bstream *in, BAT *bn)
        while (1) {
                ssize_t nread = bstream_next(in);
                if (nread < 0) {
-                       return createException(SQL, "BATattach_stream", "%s", 
mnstr_peek_error(in->s));
+                       return createException(SQL, "BATattach_stream", 
SQLSTATE(42000) "%s", mnstr_peek_error(in->s));
                }
                if (nread == 0)
                        break;
@@ -3220,11 +3220,11 @@ BATattach_str(bstream *in, BAT *bn)
 
        // It's an error to  have data left after falling out of the outer loop.
        if (in->pos < in->len)
-               return createException(SQL, "BATattach_str", "unterminated 
string at end");
+               return createException(SQL, "BATattach_str", SQLSTATE(42000) 
"unterminated string at end");
 
        return MAL_SUCCEED;
 bad_utf8:
-       return createException(SQL, "BATattach_stream", "malformed utf-8 byte 
sequence");
+       return createException(SQL, "BATattach_stream", SQLSTATE(42000) 
"malformed utf-8 byte sequence");
 }
 
 static str
@@ -3251,11 +3251,11 @@ BATattach_as_bytes(int tt, stream *s, BA
                while (cur < end) {
                        ssize_t nread = mnstr_read(s, cur, 1, end - cur);
                        if (nread < 0)
-                               return createException(SQL, "BATattach_stream", 
"%s", mnstr_peek_error(s));
+                               return createException(SQL, "BATattach_stream", 
SQLSTATE(42000) "%s", mnstr_peek_error(s));
                        if (nread == 0) {
                                size_t tail = (cur - start) % asz;
                                if (tail != 0) {
-                                       return createException(SQL, 
"BATattach_stream", "final item incomplete: %d bytes instead of %d",
+                                       return createException(SQL, 
"BATattach_stream", SQLSTATE(42000) "final item incomplete: %d bytes instead of 
%d",
                                                (int) tail, (int) asz);
                                }
                                eof = true;
@@ -3427,7 +3427,7 @@ mvc_bin_import_table_wrap(Client cntxt, 
                                                        if (msg == NULL)
                                                                msg = 
createException(
                                                                        SQL, 
"mvc_bin_import_table_wrap",
-                                                                       "while 
syncing read stream: %s", mnstr_peek_error(rs));
+                                                                       
SQLSTATE(42000) "while syncing read stream: %s", mnstr_peek_error(rs));
                                                }
                                                break;
                                        }
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
@@ -24,6 +24,7 @@ stderr of test 'bincopy_broken_strings_o
 MAPI  = (monetdb) /var/tmp/mtest-6318/.s.monetdb.30483
 QUERY = COPY BINARY INTO foo(id, s) FROM 
R'${TSTTRGBASE}/mTests/sql/test/bincopy/bincopy_ints.bin', 
R'${TSTTRGBASE}/mTests/sql/test/bincopy/bincopy_broken_strings.bin' ON CLIENT;
 ERROR = !malformed utf-8 byte sequence
+CODE  = 42000
 
 
 # 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
@@ -31,6 +31,7 @@ stderr of test 'bincopy_broken_strings_o
 MAPI  = (monetdb) /var/tmp/mtest-6318/.s.monetdb.30483
 QUERY = COPY BINARY INTO foo(id, s) FROM 
R'${TSTTRGBASE}/mTests/sql/test/bincopy/bincopy_ints.bin', 
R'${TSTTRGBASE}/mTests/sql/test/bincopy/bincopy_broken_strings.bin' ON SERVER;
 ERROR = !malformed utf-8 byte sequence
+CODE  = 42000
 
 # 16:40:12 >  
 # 16:40:12 >  "Done."
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to