Changeset: d369972039ad for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d369972039ad Modified Files: clients/ChangeLog.Aug2011 clients/mapiclient/mclient.c Branch: Aug2011 Log Message:
mclient: fix display of varchar columns with only NULL values. diffs (33 lines): diff --git a/clients/ChangeLog.Aug2011 b/clients/ChangeLog.Aug2011 --- a/clients/ChangeLog.Aug2011 +++ b/clients/ChangeLog.Aug2011 @@ -2,6 +2,7 @@ # This file is updated with Maddlog * Tue Sep 13 2011 Sjoerd Mullender <sjo...@acm.org> +- mclient: fix display of varchar columns with only NULL values. - Fixed a bug in mclient/msqldump where an internal error occurred during dump when there are GLOBAL TEMPORARY tables. diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -1061,9 +1061,15 @@ SQLrenderer(MapiHdl hdl, char singleinst char *s; len[i] = mapi_get_len(hdl, i); - if (len[i] == 0) { - /* no table width known, use maximum, rely on squeezing - * lateron to fix it to whatever is available */ + if (len[i] == 0 && + ((s = mapi_get_type(hdl, i)) == NULL || + strcmp(s, "varchar") != 0)) { + /* no table width known, use maximum, rely on + * squeezing later on to fix it to whatever is + * available; note that for a column type of + * varchar, 0 means the complete column is + * NULL or empty string, so MINCOLSIZE (below) + * will work great */ len[i] = pagewidth <= 0 ? DEFWIDTH : pagewidth; } if (len[i] < MINCOLSIZE) _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list