Changeset: a9e001c2fc92 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a9e001c2fc92
Modified Files:
        
Branch: Jun2010
Log Message:

merging


diffs (truncated from 586 to 300 lines):

diff -r 735ff5c4c3e3 -r a9e001c2fc92 
MonetDB/NT/MonetDB-Common/MonetDB-Common.vdproj
--- a/MonetDB/NT/MonetDB-Common/MonetDB-Common.vdproj   Fri Aug 13 23:50:19 
2010 +0200
+++ b/MonetDB/NT/MonetDB-Common/MonetDB-Common.vdproj   Sun Aug 15 18:52:27 
2010 +0200
@@ -307,7 +307,7 @@
             }
             
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BB4791ABAA4349E4A0DE1EDA0772E622"
             {
-            "SourcePath" = "8:C:\\pthreads\\lib\\pthreadVC2.dll"
+            "SourcePath" = "8:C:\\Libraries\\Pthreads\\lib\\pthreadVC2.dll"
             "TargetName" = "8:pthreadVC2.dll"
             "Tag" = "8:"
             "Folder" = "8:_AC71646495814C55B03F69019B5070C2"
diff -r 735ff5c4c3e3 -r a9e001c2fc92 
MonetDB/NT/MonetDB-Common/MonetDB-Common64.vdproj
--- a/MonetDB/NT/MonetDB-Common/MonetDB-Common64.vdproj Fri Aug 13 23:50:19 
2010 +0200
+++ b/MonetDB/NT/MonetDB-Common/MonetDB-Common64.vdproj Sun Aug 15 18:52:27 
2010 +0200
@@ -287,7 +287,7 @@
             }
             
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BB4791ABAA4349E4A0DE1EDA0772E622"
             {
-            "SourcePath" = "8:C:\\pthreads\\lib64\\pthreadVC2.dll"
+            "SourcePath" = "8:C:\\Libraries\\Pthreads\\lib64\\pthreadVC2.dll"
             "TargetName" = "8:pthreadVC2.dll"
             "Tag" = "8:"
             "Folder" = "8:_AC71646495814C55B03F69019B5070C2"
diff -r 735ff5c4c3e3 -r a9e001c2fc92 clients/ChangeLog.Jun2010
--- a/clients/ChangeLog.Jun2010 Fri Aug 13 23:50:19 2010 +0200
+++ b/clients/ChangeLog.Jun2010 Sun Aug 15 18:52:27 2010 +0200
@@ -2,6 +2,7 @@
 # This file is updated with Maddlog
 
 * Fri Aug 13 2010 Fabian Groffen <[email protected]>
+- Slight rendering improvements to mclient's tabular output when rendering 
results larger than the available screen width, headers were previously 
unnecessarily squeezed.
 - Fix bug #2650, a too small buffer caused the active database as reported by 
mclient's welcome message to be truncated
 
 * Wed Jul 21 2010 Fabian Groffen <[email protected]>
diff -r 735ff5c4c3e3 -r a9e001c2fc92 clients/src/mapiclient/mclient.mx
--- a/clients/src/mapiclient/mclient.mx Fri Aug 13 23:50:19 2010 +0200
+++ b/clients/src/mapiclient/mclient.mx Sun Aug 15 18:52:27 2010 +0200
@@ -998,7 +998,8 @@
 static void
 SQLrenderer(MapiHdl hdl)
 {
-       int i, total, vartotal, fields, oldfields = 0, max = 1, graphwaste = 0;
+       int i, total, lentotal, vartotal;
+       int fields, oldfields = 0, max = 1, graphwaste = 0;
        int *len = NULL, *hdr = NULL, *numeric = NULL;
        char **rest = NULL;
        char buf[50];
@@ -1033,6 +1034,8 @@
                        memset(numeric, 0, sizeof(int) * fields);
 
                        total = 0;
+                       lentotal = 0;
+                       vartotal = 0;
                        for (i = 0; i < fields; i++) {
                                char *s;
 
@@ -1055,9 +1058,6 @@
                                } else {
                                        hdr[i] = 0;
                                }
-                               if (hdr[i] < len[i])
-                                       hdr[i] = len[i];
-                               total += hdr[i];
                                s = mapi_get_type(hdl, i);
                                numeric[i] = s != NULL &&
                                        (strcmp(s, "int") == 0 ||
@@ -1067,43 +1067,18 @@
                                         strcmp(s, "smallint") == 0 ||
                                         strcmp(s, "double") == 0 ||
                                         strcmp(s, "float") == 0);
+
+                               if (!numeric[i])
+                                       vartotal += len[i];
+                               total += len[i];
+                               lentotal += (hdr[i] > len[i] ? hdr[i] : len[i]);
                        }
+
                        /* what we waste on space on the display is
                         * the column separators ' | ', but the edges
                         * lack the edgespace of course */
                        graphwaste = ((fields * 3) - 1) + 2;
-                       /* punish the column headers first until you
-                        * cannot squeeze */
-                       while (graphwaste + total > pagewidth) {
-                               /* pick the column where the header is
-                                * longest compared to its content */
-                               max = -1;
-                               for (i = 0; i < fields; i++) {
-                                       if (hdr[i] > len[i]) {
-                                               if (max == -1 ||
-                                                   hdr[max] - len[max] < 
hdr[i] - len[i])
-                                                       max = i;
-                                       }
-                               }
-                               if (max == -1)
-                                       break;
-                               hdr[max]--;
-                               total--;
-                       }
-                       total = 0;
-                       vartotal = 0;
-                       /* punish fields that are longer than the
-                        * terminal width, can't display them as a
-                        * whole anyway */
-                       for (i = 0; i < fields; i++) {
-                               if (!numeric[i]) {
-                                       /* 4 = left and right borders */
-                                       if (hdr[i] >= pagewidth - 4)
-                                               hdr[i] = pagewidth - 4;
-                                       vartotal += hdr[i];
-                               }
-                               total += hdr[i];
-                       }
+
                        /* Punishing the value fields is done based on
                         * how much squeezing will result in.  The
                         * objective is to have at most a single
@@ -1125,11 +1100,41 @@
                                        mypagewidth += pagewidth;
                                }
                        }
-                       /* finetune the long value fields */
+
+                       /* punish the column headers first until you
+                        * cannot squeeze */
+                       while (graphwaste + lentotal > mypagewidth) {
+                               /* pick the column where the header is
+                                * longest compared to its content */
+                               max = -1;
+                               for (i = 0; i < fields; i++) {
+                                       if (hdr[i] > len[i]) {
+                                               if (max == -1 ||
+                                                   hdr[max] - len[max] < 
hdr[i] - len[i])
+                                                       max = i;
+                                       }
+                               }
+                               if (max == -1)
+                                       break;
+                               hdr[max]--;
+                               lentotal--;
+                       }
+
+                       /* correct the lengths in case only the headers were
+                        * squeezed, if the content itself is wider, the headers
+                        * will be squeezed to their size (see below) */
+                       if (lentotal == total) {
+                               for (i = 0; i < fields; i++)
+                                       if (len[i] < hdr[i])
+                                               len[i] = hdr[i];
+                       }
+
+                       /* worst case: lentotal = total, which means it still
+                        * doesn't fit, values will be squeezed next */
                        while (graphwaste + total > mypagewidth) {
                                max = -1;
                                for (i = 0; i < fields; i++) {
-                                       if (!numeric[i] && (max == -1 || hdr[i] 
> hdr[max]))
+                                       if (!numeric[i] && (max == -1 || len[i] 
> len[max]))
                                                max = i;
                                }
 
@@ -1137,14 +1142,14 @@
                                if (max == -1)
                                        break;
                                /* penalty for largest field */
-                               hdr[max]--;
+                               len[max]--;
                                total--;
                                /* no more squeezing possible */
-                               if (hdr[max] == 1)
+                               if (len[max] == 1)
                                        break;
                        }
 
-                       SQLheader(hdl, hdr, fields);
+                       SQLheader(hdl, len, fields);
                        oldfields = fields;
                }
 
@@ -1176,16 +1181,16 @@
                }
 
                if (ps > 0 && rows >= ps && fromConsole != NULL) {
-                       SQLpagemove(hdr, fields, &ps, &silent);
+                       SQLpagemove(len, fields, &ps, &silent);
                        rows = 0;
                        if (silent)
                                continue;
                }
 
-               rows += SQLrow(hdr, numeric, rest, fields, 1);
+               rows += SQLrow(len, numeric, rest, fields, 1);
        }
        if (oldfields)
-               SQLseparator(hdr, oldfields, '-');
+               SQLseparator(len, oldfields, '-');
        rows = mapi_get_row_count(hdl);
        snprintf(buf, sizeof(buf), LLFMT " rows", rows);
        mark2 = strdup(buf);
diff -r 735ff5c4c3e3 -r a9e001c2fc92 geom/src/sql/Tests/geom_polygon.stable.err
--- a/geom/src/sql/Tests/geom_polygon.stable.err        Fri Aug 13 23:50:19 
2010 +0200
+++ b/geom/src/sql/Tests/geom_polygon.stable.err        Sun Aug 15 18:52:27 
2010 +0200
@@ -89,7 +89,7 @@
 ERROR = !MALException:wkb.FromText:Geometry type 'Polygon' not found
 MAPI  = mone...@ottar:32754
 QUERY = INSERT INTO polygons values ('POLYGON((10 10, 10 20, 20 20, 20 15))');
-ERROR = !MALException:wkb.FromText:IllegalArgumentException: points must form 
a closed linestring
+ERROR = !MALException:wkb.FromText:IllegalArgumentException: Points of 
LinearRing do not form a closed linestring
 MAPI  = mone...@ottar:32754
 QUERY = INSERT INTO polygons values ('POINT(10 10)');
 ERROR = !MALException:wkb.FromText:Geometry type 'Polygon' not found
diff -r 735ff5c4c3e3 -r a9e001c2fc92 
geom/src/sql/Tests/geom_polygon.stable.err.Debian4.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/geom/src/sql/Tests/geom_polygon.stable.err.Debian4.0      Sun Aug 15 
18:52:27 2010 +0200
@@ -0,0 +1,118 @@
+stderr of test 'geom_polygon` in directory 'src/sql` itself:
+
+
+# 21:15:16 >  
+# 21:15:16 >  Mtimeout -timeout 180 Mserver 
"--config=/ufs/niels/scratch/monetdb/Linux-x86_64/etc/MonetDB.conf" --debug=10 
--set 
"monet_mod_path=/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB4:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB4/lib:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB4/bin"
 --set "gdk_dbfarm=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB4/dbfarm" 
--set 
"sql_logdir=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB4/sql_logs" 
--set 
"xquery_logdir=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB4/xquery_logs"
 --set mapi_port=36438 --set xrpc_port=48112 --set monet_prompt= --trace 
"--dbname=mTests_src_sql" --dbinit="module(geom);module(sql_server); 
module(sql_server);" ; echo ; echo Over..
+# 21:15:16 >  
+
+# builtin opt  gdk_arch = 64bitx86_64-unknown-linux-gnu
+# builtin opt  gdk_version = 1.25.0
+# builtin opt  monet_pid = 4460
+# builtin opt  prefix = /home/sjoerd/Monet
+# builtin opt  exec_prefix = ${prefix}
+# builtin opt  gdk_dbname = tst
+# builtin opt  gdk_dbfarm = ${prefix}/var/MonetDB
+# builtin opt  gdk_debug = 8
+# builtin opt  gdk_mem_bigsize = 262144
+# builtin opt  gdk_alloc_map = yes
+# builtin opt  gdk_mem_pagebits = 14
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_admin = adm
+# builtin opt  monet_prompt = >
+# builtin opt  monet_welcome = yes
+# builtin opt  monet_mod_path = ${prefix}/lib64/MonetDB:${prefix}/lib64/bin
+# builtin opt  monet_daemon = yes
+# builtin opt  host = localhost
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_noheaders = no
+# builtin opt  mapi_debug = 0
+# builtin opt  mapi_clients = 2
+# builtin opt  sql_debug = 0
+# builtin opt  sql_logdir = ${prefix}/var/MonetDB
+# builtin opt  xquery_logdir = ${prefix}/var/MonetDB
+# builtin opt  standoff_ns = http://monetdb.cwi.nl/standoff
+# builtin opt  standoff_start = start
+# builtin opt  standoff_end = end
+# config opt   prefix = /home/sjoerd/Monet
+# config opt   config = ${prefix}/etc/monetdb5.conf
+# config opt   prefix = /home/sjoerd/Monet
+# config opt   exec_prefix = ${prefix}
+# config opt   gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm
+# config opt   gdk_dbname = demo
+# config opt   gdk_alloc_map = no
+# config opt   gdk_embedded = no
+# config opt   gdk_debug = 0
+# config opt   monet_mod_path = 
${prefix}/lib64/MonetDB5:${prefix}/lib64/MonetDB5/lib:${prefix}/lib64/MonetDB5/bin
+# config opt   monet_daemon = no
+# config opt   monet_welcome = yes
+# config opt   mero_msglog = ${prefix}/var/log/merovingian.log
+# config opt   mero_errlog = ${prefix}/var/log/merovingian.log
+# config opt   mero_timeinterval = 600
+# config opt   mero_pidfile = ${prefix}/var/run/merovingian.pid
+# config opt   mero_exittimeout = 7
+# config opt   mero_doproxy = yes
+# config opt   mero_discoveryttl = 600
+# config opt   mal_init = ${prefix}/lib64/MonetDB5/mal_init.mal
+# config opt   mal_listing = 58
+# config opt   checkpoint_dir = ${prefix}/var/MonetDB5/chkpnt
+# config opt   mapi_port = 50000
+# config opt   mapi_open = false
+# config opt   sql_debug = 0
+# config opt   sql_logdir = ${prefix}/var/MonetDB5/sql_logs
+# config opt   sql_init = ${prefix}/lib64/MonetDB5/sql_init.sql
+# cmdline opt  config = /home/sjoerd/Monet/etc/monetdb5.conf
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  monet_mod_path = 
/home/sjoerd/src/MonetDB/devel/geom/x86_64-unknown-linux-gnu/src/monetdb5/.libs:/home/sjoerd/src/MonetDB/devel/geom/x86_64-unknown-linux-gnu/src/monetdb5:/home/sjoerd/Monet/lib64/MonetDB5:/home/sjoerd/Monet/lib64/MonetDB5/lib:/home/sjoerd/Monet/lib64/MonetDB5/bin:/home/sjoerd/Monet/lib64/MonetDB5:/home/sjoerd/Monet/lib64/MonetDB5/lib:/home/sjoerd/Monet/lib64/MonetDB5/bin
+# cmdline opt  gdk_dbfarm = 
/home/sjoerd/src/MonetDB/devel/geom/x86_64-unknown-linux-gnu/dbfarm
+# cmdline opt  sql_logdir = 
/home/sjoerd/src/MonetDB/devel/geom/x86_64-unknown-linux-gnu/sql_logs
+# cmdline opt  xquery_logdir = 
/home/sjoerd/src/MonetDB/devel/geom/x86_64-unknown-linux-gnu/xquery_logs
+# cmdline opt  mapi_open = true
+# cmdline opt  xrpc_open = true
+# cmdline opt  mapi_port = 38689
+# cmdline opt  xrpc_port = 41370
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbname = mTests_src_sql
+# cmdline opt  mal_listing = 0
+# cmdline opt  gdk_debug = 10
+#warning: please don't forget to set your vault key!
+#(see /home/sjoerd/Monet/etc/monetdb5.conf)
+
+# 20:49:35 >  
+# 20:49:35 >  mclient -lsql -umonetdb -Pmonetdb --host=koolmees --port=38689 
+# 20:49:35 >  
+
+MAPI  = mone...@ottar:32754
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to