Changeset: 6f8bfc0739e0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6f8bfc0739e0 Modified Files: sql/backends/monet5/sql_bincopyconvert.c sql/backends/monet5/sql_result.c Branch: ascii-flag Log Message:
UTF8_strwidth returns the display width of a string, so not relevant for counting codepoints. diffs (32 lines): diff --git a/sql/backends/monet5/sql_bincopyconvert.c b/sql/backends/monet5/sql_bincopyconvert.c --- a/sql/backends/monet5/sql_bincopyconvert.c +++ b/sql/backends/monet5/sql_bincopyconvert.c @@ -369,7 +369,7 @@ load_zero_terminated_text(BAT *bat, stre } if (tpe == TYPE_str) { if (width > 0) { - int w = UTF8_strwidth(start); + int w = UTF8_strlen(start); if (w > width) { msg = createException(SQL, "sql.importColumn", "string too wide for column"); goto end; diff --git a/sql/backends/monet5/sql_result.c b/sql/backends/monet5/sql_result.c --- a/sql/backends/monet5/sql_result.c +++ b/sql/backends/monet5/sql_result.c @@ -459,14 +459,10 @@ static void * break; case TYPE_str: { sql_column *col = (sql_column *) c->extra; - int slen; s = c->data; - slen = strNil(s) ? int_nil : UTF8_strlen(s); - if (col->type.digits > 0 && len > 0 && slen > (int) col->type.digits) { - len = UTF8_strwidth(c->data); - if (len > (ssize_t) col->type.digits) - return NULL; + if (col->type.digits > 0 && len > 0 && !strNil(s) && UTF8_strlen(s) > (int) col->type.digits) { + return NULL; } break; } _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org