Changeset: 004e11206d1d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=004e11206d1d
Modified Files:
        MonetDB.spec
        NT/installer32/MonetDB-ODBC-Installer.vdproj
        NT/installer32/MonetDB5-Geom-Module.vdproj
        NT/installer32/MonetDB5-SQL-Installer.vdproj
        NT/installer64/MonetDB-ODBC-Installer.vdproj
        NT/installer64/MonetDB5-Geom-Module.vdproj
        NT/installer64/MonetDB5-SQL-Installer.vdproj
        NT/monetdb_config.h.in
        NT/rules.msc
        clients/mapilib/mapi.rc
        clients/odbc/driver/driver.rc
        clients/odbc/winsetup/setup.rc
        clients/python/setup.py
        configure.ag
        gdk/libbat.rc
        monetdb5/tools/libmonetdb5.rc
        sql/server/rel_prop.c
        sql/server/rel_prop.h
        sql/server/rel_select.c
        vertoo.data
Branch: default
Log Message:

Merged from Dec2011


diffs (truncated from 629 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -459,3 +459,5 @@ 477cc2a87348df99b4eab237501d1113e5cb21d8
 5ab2786b8f740c3e9fd1578605cec2bcd7725bc2 Aug2011_7
 477cc2a87348df99b4eab237501d1113e5cb21d8 Aug2011_SP2_release
 f022d32377c51b00599ecb014a72ea7ea2d6b8ba Aug2011_SP2_release
+ac3f3d4d8a52e2e2839632b6927f242f64d77823 Aug2011_9
+17f19b9f9fa866ff449a626080761d3c73638f9a Aug2011_SP3_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -27,7 +27,7 @@ Vendor: MonetDB BV <[email protected]>
 Group: Applications/Databases
 License: MPL - http://www.monetdb.org/Legal/MonetDBLicense
 URL: http://www.monetdb.org/
-Source: 
http://dev.monetdb.org/downloads/sources/Aug2011-SP2/%{name}-%{version}.tar.bz2
+Source: 
http://dev.monetdb.org/downloads/sources/Aug2011-SP3/%{name}-%{version}.tar.bz2
 
 BuildRequires: bison
 BuildRequires: bzip2-devel
@@ -625,6 +625,17 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libmonet
 rm -fr $RPM_BUILD_ROOT
 
 %changelog
+* Fri Nov 11 2011 Fabian Groffen <[email protected]> - 11.5.9-20111111
+- Rebuilt.
+
+* Sun Nov  6 2011 Fabian Groffen <[email protected]> - 11.5.9-20111111
+- merovingian: Fixed a bug where monetdbd's socket files from /tmp were 
removed when
+  a second monetdbd was attempted to be started using the same port.
+
+* Wed Oct 26 2011 Fabian Groffen <[email protected]> - 11.5.9-20111111
+- sql: Added a fix for bug #2834, which caused weird (failing) behaviour
+  with PreparedStatements.
+
 * Fri Oct 21 2011 Sjoerd Mullender <[email protected]> - 11.5.7-20111021
 - Rebuilt.
 
diff --git a/buildtools/Mx/Def.c b/buildtools/Mx/Def.c
--- a/buildtools/Mx/Def.c
+++ b/buildtools/Mx/Def.c
@@ -499,7 +499,7 @@ DefBlk(void)
                }
                if (f + size + 1 > blk + M_BLK)
                        Fatal("Mx:Too long block, use extra 
directives:[%s:%d].\n", mx_file, mx_line);
-               strncat(f, line, size + 1);
+               memcpy(f, line, size + 1);
                f += size;
                line = NextLine();
        }
diff --git a/clients/ChangeLog.Dec2011 b/clients/ChangeLog.Dec2011
--- a/clients/ChangeLog.Dec2011
+++ b/clients/ChangeLog.Dec2011
@@ -1,6 +1,18 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Wed Nov  9 2011 Sjoerd Mullender <[email protected]>
+- mclient: The exact interpretation of the -i (--interactive) option
+  and the - filename argument have changed.  The - filename argument
+  means read from standard input and no longer implies that no \
+  interpretation is done on the input.  Instead, \ interpretation is done
+  if either standard input is a terminal, or if the -i option is given.
+  The -i option no longer causes mclient to read from standard input.
+  It only means to do \ interpretation when reading from standard input.
+  Use the - filename argument to read from standard input.  Note that
+  if no -s option is specified and no filename arguments are present,
+  mclient still reads from standard input.
+
 * Wed Nov  2 2011 Sjoerd Mullender <[email protected]>
 - ODBC: Improved internal query for SQLSpecialColumns.  Before, the query
   returned all columns taking part in a PRIMARY KEY *and* all columns
diff --git a/clients/mapiclient/Tests/mclient--help.stable.err 
b/clients/mapiclient/Tests/mclient--help.stable.err
--- a/clients/mapiclient/Tests/mclient--help.stable.err
+++ b/clients/mapiclient/Tests/mclient--help.stable.err
@@ -21,7 +21,7 @@ Options are:
  -E charset  | --encoding=charset specify encoding (character set) of the 
terminal
  -f kind     | --format=kind      specify output format {csv,tab,raw,sql,xml}
  -H          | --history         load/save cmdline history (default off)
- -i          | --interactive[=tm] read stdin after command line args, use time 
formatting {ms,s,m}
+ -i          | --interactive[=tm] interpret \ commands on stdin, use time 
formatting {ms,s,m}
  -l language | --language=lang    {sql,mal}
  -L logfile  | --log=logfile     save client/server interaction
  -s stmt     | --statement=stmt  run single statement
@@ -36,6 +36,7 @@ SQL specific opions
  -w nr       | --width=nr         for pagination
  -D          | --dump             create an SQL dump
  -N          | --inserts          use INSERT INTO statements when dumping
+The file argument can be - for stdin
 
 # 18:57:57 >  
 # 18:57:57 >  Done.
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -25,42 +25,34 @@ is the command-line interface to the Mon
 If the
 .BI \-\-statement= query
 .RB ( \-s
-.IR query)
-option is given, the query is executed as if it were given in a file.
+.IR query )
+option is given, the query is executed.
 If any files are listed after the options, queries are read from the
 files and executed.
-In either case,
+The special filename
+.B \-
+refers to standard input.
+Note that if there is both a
+.B \-\-statement
+option and filename arguments, the query given with
+.B \-\-statement
+is executed first.
+If no
+.B \-\-statement
+option is given and no files are specified on the command line,
 .I mclient
-exits after executing the query or queries, unless the
+reads queries from standard input.
+.PP
+When reading from standard input, if standard input is a terminal
+or if the
 .B \-\-interactive
 .RB ( \-i )
-option is given, in which case it continues reading queries from
-standard input.
-The file name
-.B \-
-refers to the standard input.
-If
-.I mclient
-is started without any non-option arguments and without the
-.B \-\-statement
-.RB ( \-s )
-option, it reads queries from standard input.
-.PP
-When reading from standard input because no file arguments and no
-.B \-\-statement
-.RB ( \-s )
-option were passed on the command line, or because the
-.B \-\-interactive
-.RB ( \-i )
-option was given,
+option is given,
 .I mclient
 interprets lines starting with
 .B \e
 (backslash) specially.
 See the section BACKSLASH COMMANDS below.
-Note that this is not done when reading from standard input when the
-.B \-
-file argument is given.
 .PP
 Before
 .I mclient
@@ -102,7 +94,9 @@ and to the argument of the
 .B \-\-statement
 .RB ( \-s )
 option but not to the contents of files specified on the command line
-or files specified using the
+(except for
+.B \-
+which refers to standard input) or files specified using the
 .B \e<
 command (those must be encoded using UTF-8).  The default encoding is
 taken from the locale.
@@ -134,14 +128,19 @@ platforms where these are supported.
 \fB\-\-port=\fP\fIportnr\fP (\fB\-p\fP \fIportnr\fP)
 Specify the portnumber of the server (default: 50000).
 .TP
-\fB\-\-interactive[=\fP\fItimermode\fP\fB]\fP 
(\fB\-i[\fP\fItimermode\fP\fB]\fP)
-After executing the queries from the
-.B \-\-statement
-option (if given) and any file specified on the command
-line, read queries from standard input.  When this option is set, all
-files are read line by line, like if it were entered on mclient's
-console.  The optional \fItimermode\fP argument controls the
-format of the time reported for queries.  The default mode is
+\fB\-\-interactive\fP[\fB=\fP\fItimermode\fP] (\fB\-i\fP[\fItimermode\fP])
+When reading from standard input, interpret lines starting with
+.B \e
+(backslash) specially.
+See the section BACKSLASH COMMANDS below.
+This is the default if standard input is a terminal.
+The optional \fItimermode\fP argument controls the
+format of the time reported for queries.  Note that no space is
+allowed between
+.B \-i
+and
+.IR timermode .
+The default mode is
 \fBhuman\fP which adjusts the time precision to the measured value.  The
 modes \fBms\fP, \fBs\fP and \fBm\fP force millisecond, second and minute
 + second precision respectively.
@@ -174,11 +173,12 @@ is a pretty format which is meant for hu
 is a valid (in the XML sense) document.
 In addition to plain \fBcsv\fP, two other forms are possible.
 \fBcsv=\fP\fIc\fP uses \fIc\fP as column separator; \fBcsv+\fP\fIc\fP
-uses \fIc\fP as column separator, but produces a single header line in
+uses \fIc\fP as column separator and produces a single header line in
 addition to the data.
 .TP
 \fB\-\-echo\fP (\fB\-e\fP)
 Echo the query.
+Note that using this option slows down processing.
 .TP
 \fB\-\-history\fP (\fB\-H\fP)
 Load and save the command line history (default off).
@@ -188,9 +188,7 @@ Save client/server interaction in the sp
 .TP
 \fB\-\-statement=\fP\fIstmt\fP (\fB\-s\fP \fIstmt\fP)
 Execute the specified query.  The query is run before any queries from
-files specified on the command line are run, and before the
-interactive session is started (if the \fB\-\-interactive\fP option is
-given).
+files specified on the command line are run.
 .TP
 \fB\--timezone\fP (\fB\-z\fP)
 Do not tell the client's timezone to the server.
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -150,7 +150,6 @@ static char *pager = 0;             /* use external
 static int rowsperpage = 0;    /* for SQL pagination */
 static int pagewidth = -1;     /* -1: take whatever is necessary, >0: limit */
 static int pagewidthset = 0;   /* whether the user set the width explicitly */
-static int interactive_stdin = 0;
 static int croppedfields = 0;  /* whatever got cropped/truncated */
 static char firstcrop = 1;     /* first time we see cropping/truncation */
 
@@ -1554,7 +1553,7 @@ format_result(Mapi mid, MapiHdl hdl, cha
 }
 
 static int
-doRequest(Mapi mid, const char *buf, int interactive)
+doRequest(Mapi mid, const char *buf)
 {
        MapiHdl hdl;
 
@@ -1569,7 +1568,7 @@ doRequest(Mapi mid, const char *buf, int
 
        format_result(mid, hdl, 0);
 
-       if (mapi_get_active(mid) == NULL || !interactive)
+       if (mapi_get_active(mid) == NULL)
                mapi_close_handle(hdl);
        return 0;
 }
@@ -1604,9 +1603,8 @@ doRequest(Mapi mid, const char *buf, int
                }
 
 static int
-doFile(Mapi mid, const char *file)
+doFileBulk(Mapi mid, FILE *fp)
 {
-       FILE *fp;
        char *buf = NULL;
        size_t length;
        MapiHdl hdl = mapi_get_active(mid);
@@ -1615,18 +1613,11 @@ doFile(Mapi mid, const char *file)
        int first = 1;          /* first line processing */
        size_t skip;
 
-       if (file == NULL || strcmp(file, "-") == 0)
-               fp = stdin;
-       else if ((fp = fopen(file, "r")) == NULL) {
-               fprintf(stderr, "%s: cannot open\n", file);
-               return 1;
-       }
-
        bufsize = BLOCK - 1;
        buf = malloc(bufsize + 1);
        if (!buf) {
                fprintf(stderr, "cannot allocate memory for send buffer\n");
-               if (file != NULL)
+               if (fp != stdin)
                        fclose(fp);
                return 1;
        }
@@ -1636,9 +1627,9 @@ doFile(Mapi mid, const char *file)
                timerPause();
                if ((length = fread(buf, 1, bufsize, fp)) == 0) {
                        /* end of file */
-                       if (file != NULL) {
+                       if (fp != stdin) {
                                fclose(fp);
-                               file = NULL;
+                               fp = NULL;
                        }
                        if (hdl == NULL)
                                break;  /* nothing more to do */
@@ -1706,7 +1697,7 @@ doFile(Mapi mid, const char *file)
        timerEnd();
 
        free(buf);
-       if (file != NULL)
+       if (fp != NULL && fp != stdin)
                fclose(fp);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to