Changeset: 7935005886fc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7935005886fc
Modified Files:
        clients/mapiclient/dump.c
        clients/mapiclient/mclient.c
        sql/backends/monet5/sql_result.mx
Branch: default
Log Message:

Merged from Aug2011


diffs (79 lines):

diff --git a/clients/ChangeLog.Aug2011 b/clients/ChangeLog.Aug2011
--- a/clients/ChangeLog.Aug2011
+++ b/clients/ChangeLog.Aug2011
@@ -1,3 +1,8 @@
 # ChangeLog file for clients
 # 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/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1522,7 +1522,8 @@ dump_database(Mapi mid, stream *toConsol
                             "\"sys\".\"_tables\" \"t\" "
                        "WHERE \"t\".\"type\" BETWEEN 0 AND 1 AND "
                              "\"t\".\"system\" = FALSE AND "
-                             "\"s\".\"id\" = \"t\".\"schema_id\" "
+                             "\"s\".\"id\" = \"t\".\"schema_id\" AND "
+                             "\"s\".\"name\" <> 'tmp' "
                        "UNION "
                        "SELECT \"s\".\"name\" AS \"sname\", "
                               "\"tr\".\"name\" AS \"name\", "
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1069,9 +1069,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)
diff --git a/sql/backends/monet5/datacell/basket.c 
b/sql/backends/monet5/datacell/basket.c
--- a/sql/backends/monet5/datacell/basket.c
+++ b/sql/backends/monet5/datacell/basket.c
@@ -123,7 +123,7 @@ BSKTnewbasket(sql_schema *s, sql_table *
 {
        int idx, i;
        node *o;
-       str msg = MAL_SUCCEED;;
+       str msg = MAL_SUCCEED;
        BAT *b;
        sql_column  *c;
        char buf[BUFSIZ];
diff --git a/sql/backends/monet5/sql_result.mx 
b/sql/backends/monet5/sql_result.mx
--- a/sql/backends/monet5/sql_result.mx
+++ b/sql/backends/monet5/sql_result.mx
@@ -274,10 +274,13 @@ bat_max_@1length(BAT *b)
                if (m < min) min = m;
        }
 
-       if ((-min * 10) > max) 
-               max = (-min * 10);
-       while (max /= 10) ret++;
+       if (-min > max / 10) {
+               max = -min;
+               ret++;          /* '-' */
+       }
+       while (max /= 10)
                ret++;
+       ret++;
        return ret;
 }
 @
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to