Changeset: 50ff7afd4fe4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=50ff7afd4fe4 Modified Files: MonetDB5/ChangeLog.Jun2010 MonetDB5/src/modules/mal/tablet_sql.mx Branch: Jun2010 Log Message:
Fix for bug 2575, comment #6. If snprintf fails (e.g. because of a bad UTF-8 sequence), report the error message without the value. diffs (38 lines): diff -r cc77af968725 -r 50ff7afd4fe4 MonetDB5/ChangeLog.Jun2010 --- a/MonetDB5/ChangeLog.Jun2010 Mon Aug 30 10:57:02 2010 +0200 +++ b/MonetDB5/ChangeLog.Jun2010 Mon Aug 30 14:40:55 2010 +0200 @@ -1,3 +1,8 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog +* Mon Aug 30 2010 Sjoerd Mullender <sjo...@acm.org> +- When attempting to insert incorrect UTF-8 sequences in a COPY INTO + statement, the error message was truncated. This is now fixed. + Bug 2575. + diff -r cc77af968725 -r 50ff7afd4fe4 MonetDB5/src/modules/mal/tablet_sql.mx --- a/MonetDB5/src/modules/mal/tablet_sql.mx Mon Aug 30 10:57:02 2010 +0200 +++ b/MonetDB5/src/modules/mal/tablet_sql.mx Mon Aug 30 14:40:55 2010 +0200 @@ -166,12 +166,16 @@ char *val; val = *s ? GDKstrdup(s) : GDKstrdup(""); if ( *err == NULL){ - snprintf(buf, BUFSIZ, "value '%.*s%s' from line " BUNFMT - " field %d not inserted, expecting type %s\n", - BUFSIZ - 200, val, - strlen(val) > (size_t) BUFSIZ - 200 ? "..." : "", - BATcount(fmt->c[0])+1, - col, fmt->type); + if (snprintf(buf, BUFSIZ, "value '%.*s%s' from line " BUNFMT + " field %d not inserted, expecting type %s\n", + BUFSIZ - 200, val, + strlen(val) > (size_t) BUFSIZ - 200 ? "..." : "", + BATcount(fmt->c[0])+1, + col, fmt->type) < 0) + snprintf(buf, BUFSIZ, "value from line " BUNFMT + " field %d not inserted, expecting type %s\n", + BATcount(fmt->c[0])+1, + col, fmt->type); *err= GDKstrdup(buf); } GDKfree(val); _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list