Changeset: 7cf06dfd4085 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7cf06dfd4085
Modified Files:
        configure.ag
        gdk/gdk_cbp.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_builder.c
        monetdb5/mal/mal_builder.h
        monetdb5/mal/mal_import.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_interpreter.h
        monetdb5/modules/mal/Tests/inspect05.stable.out
        monetdb5/modules/mal/extensions.c
        monetdb5/modules/mal/extensions.mal
        monetdb5/modules/mal/inout.c
        monetdb5/modules/mal/mal_init.mal
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/remote.h
        monetdb5/modules/mal/remote.mal
        monetdb5/optimizer/Makefile.ag
        monetdb5/optimizer/opt_commonTerms.c
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_datacell.c
        monetdb5/optimizer/opt_datacell.h
        monetdb5/optimizer/opt_dataflow.c
        monetdb5/optimizer/opt_dataflow.h
        monetdb5/optimizer/opt_mitosis.c
        monetdb5/optimizer/opt_multiplex.c
        monetdb5/optimizer/opt_octopus.c
        monetdb5/optimizer/opt_pipes.c
        monetdb5/optimizer/opt_pipes.h
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/optimizer.mal
        monetdb5/tests/gdkTests/Tests/binsearchmultijoin.stable.out
        sql/backends/monet5/LSST/Tests/htmxmatch.sql
        sql/backends/monet5/Makefile.ag
        sql/backends/monet5/UDF/udf.sql
        sql/backends/monet5/sql.mx
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
        sql/backends/monet5/sql_optimizer.h
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_scenario.h
        sql/storage/bat/bat_storage.c
Branch: headless
Log Message:

Merge with default branch.


diffs (truncated from 20628 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -265,9 +265,8 @@
 %{gemdir}/cache/*.gem
 %dir %{gemdir}/gems/activerecord-monetdb-adapter-0.1
 %dir %{gemdir}/gems/ruby-monetdb-sql-0.1
-%{gemdir}/gems/activerecord-monetdb-adapter-0.1/*
-%{gemdir}/gems/ruby-monetdb-sql-0.1/*
-%{gemdir}/gems/ruby-monetdb-sql-0.1/.require_paths
+%{gemdir}/gems/activerecord-monetdb-adapter-0.1
+%{gemdir}/gems/ruby-monetdb-sql-0.1
 %{gemdir}/specifications/*.gemspec
 
 %package client-tests
diff --git a/NT/Makefile b/NT/Makefile
--- a/NT/Makefile
+++ b/NT/Makefile
@@ -33,7 +33,7 @@
        $(INSTALL) ..\NT\installer$(bits)\*.sln "$(prefix)"
        $(INSTALL) ..\NT\installer$(bits)\*.vdproj "$(prefix)"
        -if exist "C:\Program Files (x86)" if $(bits)==32 cd 
"$(prefix)"&&C:\cygwin\bin\sed.exe -i "s/Program Files/Program Files (x86)/" 
*.vdproj
-       if not exist "C:\Program Files (x86)\Microsoft Visual Studio 10.0" if 
not exist "C:\Program Files\Microsoft Visual Studio 10.0" cd 
"$(prefix)"&&C:\cygwin\bin\sed.exe -i "s/Format Version 11.00/Format Version 
10.00/;s/Visual Studio 2010/Visual Studio 2008/;s/-vs10//;s/_VC100_/_VC90_/" 
*.vdproj *.sln
+       if not exist "C:\Program Files (x86)\Microsoft Visual Studio 10.0" if 
not exist "C:\Program Files\Microsoft Visual Studio 10.0" cd 
"$(prefix)"&&C:\cygwin\bin\sed.exe -i "s/Format Version 11.00/Format Version 
10.00/;s/Visual Studio 2010/Visual Studio 
2008/;s/-vs10//;s/_VC100_CRT_x64/_VC90_CRT_x86_x64/;s/_VC100_/_VC90_/" *.vdproj 
*.sln
 
 $(srcdir)\Makefile.msc: "$(srcdir)\Makefile.ag"
         cd "$(srcdir)"&&set PYTHONPATH=buildtools\autogen&&python 
buildtools\autogen\autogen.py
diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
--- a/clients/mapiclient/Makefile.ag
+++ b/clients/mapiclient/Makefile.ag
@@ -45,6 +45,13 @@
                $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS)
 }
 
+bin_mnc = {
+       NOINST
+       SOURCES = mnc.c
+       LIBS = ../../common/stream/libstream \
+               $(curl_LIBS) $(MALLOC_LIBS) $(PTHREAD_LIBS)
+}
+
 man_MANS = mclient.1 msqldump.1
 
 EXTRA_DIST = msqldump.h mprompt.h ReadlineTools.h $(man_MANS)
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1224,7 +1224,7 @@
 #endif
        printf(LLFMT " tuple%s%s%s%s", rows, rows != 1 ? "s" : "",
                        singleinstr ? " (" : "",
-                       singleinstr ? timerHuman() : "",
+                       singleinstr && formatter != TESTformatter ? 
timerHuman() : "",
                        singleinstr ? ")" : "");
 
        if (fields != printfields || croppedfields > 0)
@@ -1394,7 +1394,7 @@
                                                        (aff == 1 ? "" : "s"),
                                                        lid,
                                                        singleinstr ? " (" : "",
-                                                       singleinstr ? 
timerHuman() : "",
+                                                       singleinstr && 
formatter != TESTformatter ? timerHuman() : "",
                                                        singleinstr ? ")" : "");
                                } else {
                                        mnstr_printf(toConsole,
@@ -1402,7 +1402,7 @@
                                                        aff,
                                                        (aff == 1 ? "" : "s"),
                                                        singleinstr ? " (" : "",
-                                                       singleinstr ? 
timerHuman() : "",
+                                                       singleinstr && 
formatter != TESTformatter ? timerHuman() : "",
                                                        singleinstr ? ")" : "");
                                }
                        }
@@ -1414,7 +1414,7 @@
                                mnstr_printf(toConsole,
                                              "operation successful%s%s%s\n",
                                              singleinstr ? " (" : "",
-                                             singleinstr ? timerHuman() : "",
+                                             singleinstr && formatter != 
TESTformatter ? timerHuman() : "",
                                              singleinstr ? ")" : "");
                        continue;
                case Q_TRANS:
@@ -1712,7 +1712,6 @@
        size_t length;
        MapiHdl hdl = mapi_get_active(mid);
        MapiMsg rc = MOK;
-       int sent = 0;           /* whether we sent any data to the server */
        int lineno = 1;
        enum hmyesno hassysfuncs = UNKNOWN;
 
@@ -2313,7 +2312,6 @@
                assert(hdl != NULL);
 
                if (length > 0) {
-                       sent = 1;
                        SQLsetSpecial(line);
                        mapi_query_part(hdl, line, length);
                        CHECK_RESULT(mid, hdl, buf, continue);
diff --git a/clients/mapiclient/mnc.c b/clients/mapiclient/mnc.c
new file mode 100644
--- /dev/null
+++ b/clients/mapiclient/mnc.c
@@ -0,0 +1,285 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2011 MonetDB B.V.
+ * All Rights Reserved.
+ */
+
+/**
+ * mnc
+ * Fabian Groffen
+ *
+ * MCL netcat
+ * Simple utility meant to measure the protocol overhead incurred by our
+ * stream library compared to "plain" netcat (nc).
+ */
+
+#include "monetdb_config.h"
+#include "monet_options.h"
+#include <mapi.h>
+#include <stream.h>
+#include <stream_socket.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+
+#ifndef HAVE_GETOPT_LONG
+# include "monet_getopt.h"
+#else
+# ifdef HAVE_GETOPT_H
+#  include "getopt.h"
+# endif
+#endif
+
+#define SOCKPTR struct sockaddr *
+#ifdef HAVE_SOCKLEN_T
+#define SOCKLEN socklen_t
+#else
+#define SOCKLEN int
+#endif
+
+
+static void
+usage()
+{
+       fprintf(stderr, "mnc [options] destination port\n");
+       fprintf(stderr, "  -l | --listen   listen for connection instead\n");
+       /* TODO
+       fprintf(stderr, "  -u | --udp      use UDP instead of TCP\n");
+       fprintf(stderr, "  -g | --gzip     use gzip stream wrapper\n");
+       fprintf(stderr, "  -j | --bzip2    use bzip2 stream wrapper\n");
+       fprintf(stderr, "  -b | --buffer   use buffered stream\n");
+       */
+       fprintf(stderr, "  -B | --block    use block stream\n");
+}
+
+int
+main(int argc, char **argv)
+{
+       int a = 1;
+       char *host = NULL;
+       int port = 0;
+       char clisten = 0;
+       char udp = 0;
+       char zip = 0;
+       char buffer = 0;
+       char block = 0;
+       SOCKET s = INVALID_SOCKET;
+       stream *in = NULL;
+       stream *out = NULL;
+       char buf[8096];
+       size_t len;
+       fd_set fds;
+
+       static struct option long_options[8] = {
+               { "listen", 0, 0, 'l' },
+               { "udp", 0, 0, 'u' },
+               { "gzip", 0, 0, 'g' },
+               { "bzip2", 0, 0, 'j' },
+               { "buffer", 0, 0, 'b' },
+               { "block", 0, 0, 'B' },
+               { "help", 0, 0, '?' },
+               { 0, 0, 0, 0 }
+       };
+       while (1) {
+               int option_index = 0;
+               int c = getopt_long(argc, argv, "lugjbB?h",
+                       long_options, &option_index);
+               if (c == -1)
+                       break;
+               switch (c) {
+                       case 'l':
+                               clisten = 1;
+                               break;
+                       case 'u':
+                               udp = 1;
+                               break;
+                       case 'g':
+                               zip = 1;
+                               break;
+                       case 'j':
+                               zip = 2;
+                               break;
+                       case 'b':
+                               buffer = 1;
+                               break;
+                       case 'B':
+                               block = 1;
+                               break;
+                       default:
+                               usage();
+                               exit(0);
+               }
+       }
+
+       a = optind;
+       if (argc - a != 2) {
+               fprintf(stderr, "%s: need destination and port arguments\n", 
argv[0]);
+               usage();
+               exit(-1);
+       }
+
+       host = argv[a++];
+       port = atoi(argv[a]);
+       
+       /* call the stream wrappers based on the user's choice, stream
+        * everything from/to stdin/stdout */
+
+       if (!clisten) {
+#ifdef HAVE_GETADDRINFO
+               struct addrinfo hints, *res, *rp;
+               char sport[32];
+               int ret;
+
+               snprintf(sport, sizeof(sport), "%d", port & 0xFFFF);
+
+               memset(&hints, 0, sizeof(hints));
+               hints.ai_family = AF_UNSPEC;
+               hints.ai_socktype = SOCK_STREAM;
+               hints.ai_protocol = IPPROTO_TCP;
+               ret = getaddrinfo(host, sport, &hints, &res);
+               if (ret) {
+                       fprintf(stderr, "getaddrinfo failed: %s\n", 
gai_strerror(ret));
+                       exit(1);
+               }
+               for (rp = res; rp; rp = rp->ai_next) {
+                       s = socket(rp->ai_family, rp->ai_socktype, 
rp->ai_protocol);
+                       if (s == INVALID_SOCKET)
+                               continue;
+                       if (connect(s, rp->ai_addr, (socklen_t) rp->ai_addrlen) 
!= -1)
+                               break;  /* success */
+                       closesocket(s);
+               }
+               freeaddrinfo(res);
+               if (rp == NULL) {
+                       fprintf(stderr, "could not connect to %s:%s: %s\n",
+                                       host, sport, strerror(errno));
+                       exit(1);
+               }
+#else
+               struct sockaddr_in server;
+               struct hostent *hp;
+               struct sockaddr *serv = (struct sockaddr *) &server;
+
+               if ((hp = gethostbyname(host)) == NULL) {
+                       fprintf(stderr, "gethostbyname failed: %s\n", errno ? 
strerror(errno) : hstrerror(h_errno));
+                       exit(1);
+               }
+               memset(&server, 0, sizeof(server));
+               memcpy(&server.sin_addr, hp->h_addr_list[0], hp->h_length);
+               server.sin_family = hp->h_addrtype;
+               server.sin_port = htons((unsigned short) (port & 0xFFFF));
+               s = socket(server.sin_family, SOCK_STREAM, IPPROTO_TCP);
+
+               if (s == INVALID_SOCKET) {
+                       fprintf(stderr, "opening socket failed: %s\n", 
strerror(errno));
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to