Changeset: 5badc4146b8c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5badc4146b8c
Modified Files:
        monetdb5/modules/mal/Tests/All
Branch: sciql
Log Message:

Merge with default branch.


diffs (truncated from 2011 to 300 lines):

diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1014,7 +1014,8 @@
         fd.write("\tmkdir -p $(DESTDIR)'%s'\n" % rd)
         fd.write("\tgem install --local --install-dir $(DESTDIR)'%s' --force 
--rdoc '%s'\n" % (rd, f[:-4]))
         fd.write("uninstall-local-%s: %s\n" % (sf, f[:-4]))
-        fd.write("\tgem uninstall --install-dir $(DESTDIR)'%s' '%s'\n" % (rd, 
f[:-4]))
+        # remove "-0.1.gemspec" from end of `f'
+        fd.write("\tgem uninstall --install-dir $(DESTDIR)'%s' '%s'\n" % (rd, 
f[:-12]))
         am['BUILT_SOURCES'].append(f[:-4])
         am['CLEAN'].append(f[:-4])
     fd.write('else\n')
diff --git a/clients/ChangeLog.Apr2011 b/clients/ChangeLog.Apr2011
--- a/clients/ChangeLog.Apr2011
+++ b/clients/ChangeLog.Apr2011
@@ -1,6 +1,9 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Fri Jul  1 2011 Fabian Groffen <[email protected]>
+- Fix stethoscope's mod.fcn filter when using multiple targets, bug #2827
+
 * Wed Jun 29 2011 Sjoerd Mullender <[email protected]>
 - The separate Python distribution now uses the same version number as
   the main package.
diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -297,20 +297,24 @@
        } else {
                for (a = 0; a < wthr->argc; a++) {
                        char *c;
-                       c = strchr(wthr->argv[a], '.');
+                       char *arg = strdup(wthr->argv[a]);
+                       c = strchr(arg, '.');
                        if (c) {
-                               mod = wthr->argv[a];
-                               if (mod == c) mod = "*";
+                               mod = arg;
+                               if (mod == c)
+                                       mod = "*";
                                fcn = c + 1;
-                               if (*fcn == 0) fcn = "*";
+                               if (*fcn == 0)
+                                       fcn = "*";
                                *c = 0;
                        } else {
-                               fcn = wthr->argv[a];
+                               fcn = arg;
                                mod = "*";
                        }
                        snprintf(buf, BUFSIZ, 
"profiler.setFilter(\"%s\",\"%s\");", mod, fcn);
                        printf("-- %s%s\n", id, buf);
                        doQ(buf);
+                       free(arg);
                }
        }
        printf("-- %sprofiler.start();\n", id);
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -451,7 +451,7 @@
        ;;
 esac
 AC_SUBST(oids)
-AC_MSG_RESULT($bits bits)
+AC_MSG_RESULT($oids bits)
 
 AC_C_BIGENDIAN()
 
@@ -3278,7 +3278,7 @@
 done
 echo
 echo "* Important options:"
-echo "    OID size:   " ${bits} bits
+echo "    OID size:   " ${oids} bits
 echo
 
 dnl give some hints to the user
diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -1806,7 +1806,7 @@
        if (GDKstopped == 0) {
                GDKstopped = 1; /* shouldn't there be a lock here? */
 #ifdef HAVE_POSIX_FADVISE
-               if (!GDKembedded && GDK_vm_trim)
+               if (!GDKembedded && GDK_vm_trim && GDKvmtrim_id)
                        MT_join_thread(GDKvmtrim_id);
 #endif
                GDKnrofthreads = 0;
diff --git a/geom/monetdb5/geom.mx b/geom/monetdb5/geom.mx
--- a/geom/monetdb5/geom.mx
+++ b/geom/monetdb5/geom.mx
@@ -1129,13 +1129,11 @@
        GEOSGeom_destroy(geosGeometry);
 
 #if @6
-       if (*out != @5)
-#else
-       if (1 == 1) /* trick compiler for the throw after this return */
+       if (*out == @5)
+               throw(MAL, "geom.@1", "@3 failed");
 #endif
-               return MAL_SUCCEED;
+       return MAL_SUCCEED;
 
-       throw(MAL, "geom.@1", "@3 failed");
 }
 @c
 @:basic(Dimension,int,GEOSGeom_getDimensions,,0,1)@
diff --git a/java/ChangeLog b/java/ChangeLog
--- a/java/ChangeLog
+++ b/java/ChangeLog
@@ -1,6 +1,12 @@
 # ChangeLog file for java
 # This file is updated with Maddlog
 
+* Thu Jun 30 2011 Fabian Groffen <[email protected]>
+- Add so_timeout Driver property to specify a SO_TIMEOUT value for the
+  socket in use to the database.  Setting this property to a value in
+  milliseconds defines the timeout for read calls, which may 'unlock'
+  the driver if the server hangs, bug #2828
+
 * Wed May 25 2011 Fabian Groffen <[email protected]>
 - Added a naive implementation for PreparedStatement.setCharacterStream
 
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetConnection.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetConnection.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetConnection.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetConnection.java
@@ -149,7 +149,12 @@
                boolean debug = 
Boolean.valueOf(props.getProperty("debug")).booleanValue();
                String hash = props.getProperty("hash");
                blobIsBinary = 
Boolean.valueOf(props.getProperty("treat_blob_as_binary")).booleanValue();
-
+               int sockTimeout = 0;
+               try {
+                       sockTimeout = 
Integer.parseInt(props.getProperty("so_timeout"));
+               } catch (NumberFormatException e) {
+                       sockTimeout = 0;
+               }
                // check input arguments
                if (hostname == null || hostname.trim().equals(""))
                        throw new IllegalArgumentException("hostname should not 
be null or empty");
@@ -173,6 +178,7 @@
                if (hash != null) server.setHash(hash);
                if (database != null) server.setDatabase(database);
                server.setLanguage(language);
+               server.setSoTimeout(sockTimeout);
 
                // we're debugging here... uhm, should be off in real life
                if (debug) {
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetDriver.java.in 
b/java/src/nl/cwi/monetdb/jdbc/MonetDriver.java.in
--- a/java/src/nl/cwi/monetdb/jdbc/MonetDriver.java.in
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetDriver.java.in
@@ -117,6 +117,7 @@
                props.put("port", PORT);
                props.put("debug", "false");
                props.put("language", "sql");   // mal, sql, <future>
+               props.put("so_timeout", "0");
 
                props.putAll(info);
                info = props;
@@ -239,6 +240,11 @@
                prop.description = "Whether BLOBs on the server should be 
treated as BINARY types, thus mapped to byte[]";
                props.add(prop);
 
+               prop = new DriverPropertyInfo("so_timeout", "0");
+               prop.required = false;
+               prop.description = "Defines the maximum time to wait in 
milliseconds on a blocking read socket call";
+               props.add(prop);
+
                DriverPropertyInfo[] dpi = new DriverPropertyInfo[props.size()];
                return((DriverPropertyInfo[])props.toArray(dpi));
        }
diff --git a/java/src/nl/cwi/monetdb/mcl/net/MapiSocket.java 
b/java/src/nl/cwi/monetdb/mcl/net/MapiSocket.java
--- a/java/src/nl/cwi/monetdb/mcl/net/MapiSocket.java
+++ b/java/src/nl/cwi/monetdb/mcl/net/MapiSocket.java
@@ -119,6 +119,9 @@
        /** A short in two bytes for holding the block size in bytes */
        private byte[] blklen = new byte[2];
 
+       /** SO_TIMEOUT value for the underlying java.net.Socket */
+       private int sockTimeout = 0;
+
        /**
         * Constructs a new MapiSocket.
         */
@@ -188,6 +191,20 @@
        }
 
        /**
+        * Set the SO_TIMEOUT on the underlying Socket.  When for some
+        * reason the connection to the database hangs, this setting can be
+        * useful to break out of this indefinite wait.
+        * This option must be enabled prior to entering the blocking
+        * operation to have effect.
+        *
+        * @param timeout The specified timeout, in milliseconds.  A timeout
+        *        of zero is interpreted as an infinite timeout.
+        */
+       public void setSoTimeout(int s) {
+               this.sockTimeout = s;
+       }
+
+       /**
         * Connects to the given host and port, logging in as the given
         * user.  If followRedirect is false, a RedirectionException is
         * thrown when a redirect is encountered.
@@ -203,7 +220,7 @@
         * @throws MCLParseException if bogus data is received
         * @throws MCLException if an MCL related error occurs
         */
-       public List connect(String host, int port, String user, String pass) 
+       public List connect(String host, int port, String user, String pass)
                throws IOException, MCLParseException, MCLException
        {
                // Wrap around the internal connect that needs to know if it
@@ -212,7 +229,7 @@
        }
 
        private List connect(String host, int port, String user, String pass,
-                       boolean makeConnection) 
+                       boolean makeConnection)
                throws IOException, MCLParseException, MCLException
        {
                if (ttl-- <= 0)
@@ -223,6 +240,8 @@
                        // set nodelay, as it greatly speeds up small messages 
(like we
                        // often do)
                        con.setTcpNoDelay(true);
+                       // limit time to wait on blocking operations (0 = 
indefinite)
+                       con.setSoTimeout(sockTimeout);
 
                        fromMonet = new BlockInputStream(con.getInputStream());
                        toMonet = new BlockOutputStream(con.getOutputStream());
@@ -678,7 +697,7 @@
 
                        // write the actual block
                        out.write(block, 0, writePos);
-                               
+
                        if (debug) {
                                if (last) {
                                        logTd("write final block: " + writePos 
+ " bytes");
diff --git a/monetdb5/modules/mal/Tests/All b/monetdb5/modules/mal/Tests/All
--- a/monetdb5/modules/mal/Tests/All
+++ b/monetdb5/modules/mal/Tests/All
@@ -33,6 +33,7 @@
 remote04
 remote06
 remote08
+remote09
 # needs Merovingian and aims at SQL
 #remote88
 #remote89
diff --git a/monetdb5/modules/mal/Tests/remote09.mal 
b/monetdb5/modules/mal/Tests/remote09.mal
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/remote09.mal
@@ -0,0 +1,42 @@
+# let connect figure out itself how to connect to the running db
+uri := sabaoth.getLocalConnectionURI();
+
+# create a persistent connecton to ourself
+conn1:str := remote.connect(uri, "monetdb", "monetdb");
+
+b := bat.new(:oid, :str);
+
+b := bat.insert(b, nil:oid, "maandag");
+b := bat.insert(b, nil:oid, "dinsdag");
+b := bat.insert(b, nil:oid, "woensdag");
+b := bat.insert(b, nil:oid, "donderdag");
+b := bat.insert(b, nil:oid, "vrijdag");
+b := bat.insert(b, nil:oid, "januari");
+b := bat.insert(b, nil:oid, "februari");
+b := bat.insert(b, nil:oid, "maart");
+b := bat.insert(b, nil:oid, "april");
+b := bat.insert(b, nil:oid, "mei");
+b := bat.insert(b, nil:oid, "juni");
+b := bat.insert(b, nil:oid, "juli");
+b := bat.insert(b, nil:oid, "augustus");
+b := bat.insert(b, nil:oid, "september");
+b := bat.insert(b, nil:oid, "oktober");
+b := bat.insert(b, nil:oid, "november");
+b := bat.insert(b, nil:oid, "december");
+b := bat.insert(b, nil:oid, "morgen");
+b := bat.insert(b, nil:oid, "middag");
+b := bat.insert(b, nil:oid, "avond");
+b := bat.insert(b, nil:oid, "nacht");
+b := bat.insert(b, nil:oid, "licht");
+b := bat.insert(b, nil:oid, "duisternis");
+
+b := algebra.markH(b);
+
+rb2 := remote.put(conn1, b);
+lb2:bat[:oid,:str] := remote.get(conn1, rb2);
+
+io.print(lb2);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to