Changeset: 403eb33ce4e5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=403eb33ce4e5
Modified Files:
        clients/ChangeLog.Apr2012
        clients/mapiclient/mclient.c
        sql/storage/bat/bat_storage.c
        tools/merovingian/daemon/merovingian.c
Branch: Jul2012
Log Message:

Merge with Apr2012 branch.


diffs (89 lines):

diff --git a/clients/ChangeLog.Apr2012 b/clients/ChangeLog.Apr2012
--- a/clients/ChangeLog.Apr2012
+++ b/clients/ChangeLog.Apr2012
@@ -1,3 +1,8 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Wed May 23 2012 Fabian Groffen <[email protected]>
+- Resolved a cosmetical error where tab-characters would cause
+  misalignments in tabular result views.  For the time being, tabs are
+  now represented as a single space in tabular view.
+
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -471,6 +471,15 @@ SQLrow(int *len, int *numeric, char **re
                                                mnstr_printf(toConsole, "%*s",
                                                             (int) (len[i] - 
(ulen - utf8strlen(t, NULL))),
                                                             "");
+
+                                       if (!numeric[i]) {
+                                               /* replace tabs with a single 
space to avoid
+                                                * screwup the width 
calculations */
+                                               for (s = rest[i]; *s != *t; s++)
+                                                       if (*s == '\t')
+                                                               *s = ' ';
+                                       }
+
                                        s = t;
                                        if (trim == 1)
                                                while (isascii((int) *s) &&
@@ -515,16 +524,26 @@ SQLrow(int *len, int *numeric, char **re
                                } else {
                                        mnstr_printf(toConsole, "%c",
                                                        first ? '|' : i > 0 && 
cutafter[i - 1] == 0 ? '>' : ':');
-                                       if (numeric[i])
+                                       if (numeric[i]) {
                                                mnstr_printf(toConsole, "%*s",
                                                              (int) (len[i] - 
ulen),
                                                              "");
-                                       mnstr_printf(toConsole, " %s ",
-                                                     rest[i]);
-                                       if (!numeric[i])
+                                               mnstr_printf(toConsole, " %s ",
+                                                                 rest[i]);
+                                       }
+                                       if (!numeric[i]) {
+                                               char *p;
+                                               /* replace tabs with a single 
space to avoid
+                                                * screwup the width 
calculations */
+                                               for (p = rest[i]; *p != '\0'; 
p++)
+                                                       if (*p == '\t')
+                                                               *p = ' ';
+                                               mnstr_printf(toConsole, " %s ",
+                                                                 rest[i]);
                                                mnstr_printf(toConsole, "%*s",
                                                              (int) (len[i] - 
ulen),
                                                              "");
+                                       }
                                        rest[i] = 0;
                                        /* avoid > as border marker if 
everything
                                         * actually just fits */
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -268,7 +268,10 @@ delta_append_bat( sql_delta *bat, BAT *i
                BATappend(b, i, TRUE);
        } else {
                temp_destroy(bat->ibid);
-               bat->ibid = ebat2real(i->batCacheid, bat->ibase);
+               bat->ibid = ebat2real(b->batCacheid, bat->ibase);
+               bat_destroy(b);
+               b = temp_descriptor(bat->ibid);
+               BATappend(b, i, TRUE);
        }
        bat_destroy(b);
 }
diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -910,7 +910,7 @@ main(int argc, char *argv[])
        p = getConfVal(_mero_props, "logfile");
        /* write to the given file */
        _mero_topdp->out = open(p, O_WRONLY | O_APPEND | O_CREAT,
-                       S_IRUSR | S_IWUSR);
+                       S_IRUSR | S_IWUSR, 0666);
        if (_mero_topdp->out == -1) {
                Mfprintf(stderr, "unable to open '%s': %s\n",
                                p, strerror(errno));
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to