Changeset: f7f70b3c49ff for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f7f70b3c49ff Modified Files: sql/backends/monet5/sql.c sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err Branch: copybinary Log Message:
Improve inconsistent row count message diffs (42 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 @@ -3344,6 +3344,7 @@ mvc_bin_import_table_wrap(Client cntxt, mvc *m = NULL; str msg; BUN cnt = 0; + sql_column *cnt_col = NULL; bool init = false; int i; const char *sname = *getArgReference_str(stk, pci, 0 + pci->retc); @@ -3461,11 +3462,17 @@ mvc_bin_import_table_wrap(Client cntxt, goto bailout; } if (init && cnt != BATcount(c)) { + BUN this_cnt = BATcount(c); BBPunfix(c->batCacheid); - msg = createException(SQL, "sql", SQLSTATE(42000) "Binary files for table '%s' have inconsistent counts", tname); + msg = createException(SQL, "sql", + SQLSTATE(42000) "Binary files for table '%s' have inconsistent counts: " + "%s has %zu rows, %s has %zu", tname, + cnt_col->base.name, (size_t)cnt, + col->base.name, (size_t)this_cnt); goto bailout; } cnt = BATcount(c); + cnt_col = col; init = true; *getArgReference_bat(stk, pci, i - (3 + pci->retc)) = c->batCacheid; BBPkeepref(c->batCacheid); diff --git a/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err b/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err --- a/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err +++ b/sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.stable.err @@ -31,7 +31,7 @@ stderr of test 'binary_copy_into.Bug-334 MAPI = (monetdb) /var/tmp/mtest-15437/.s.monetdb.35953 QUERY = start transaction;create table bug (n_nationkey INTEGER,n_regionkey INTEGER); copy binary into bug from E'${TSTTRGBASE}/mTests/sql/test/BugTracker-2013/n_nationkey.sorted', E'${TSTTRGBASE}/mTests/sql/test/BugTracker-2013/n_regionkey.sorted'; -ERROR = !Binary files for table 'bug' have inconsistent counts +ERROR = !Binary files for table 'bug' have inconsistent counts: n_nationkey has 10 rows, n_regionkey has 5 CODE = 42000 # 11:33:26 > _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list