Changeset: 9ae2cda54aeb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9ae2cda54aeb
Modified Files:
clients/mapiclient/mclient.c
clients/mapilib/mapi.c
sql/server/rel_bin.c
testing/Mtest.py.in
Branch: default
Log Message:
Merge with Aug2011 branch.
diffs (truncated from 554 to 300 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1728,6 +1728,8 @@ showCommands(void)
enum hmyesno { UNKNOWN, YES, NO };
+#define READBLOCK 8192
+
static int
doFileByLines(Mapi mid, FILE *fp, const char *prompt, const char useinserts)
{
@@ -1742,7 +1744,7 @@ doFileByLines(Mapi mid, FILE *fp, const
#ifdef HAVE_LIBREADLINE
if (prompt == NULL)
#endif
- oldbuf = buf = malloc(BUFSIZ);
+ oldbuf = buf = malloc(READBLOCK);
do {
if (prompt) {
@@ -1789,7 +1791,7 @@ doFileByLines(Mapi mid, FILE *fp, const
free(buf);
buf = oldbuf;
line = buf;
- while (line < buf + BUFSIZ - 1 &&
+ while (line < buf + READBLOCK - 1 &&
(c = getc(fp)) != EOF) {
if (c == 0) {
fprintf(stderr, "NULL byte in input on
line %d of input\n", lineno);
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -4154,7 +4154,7 @@ mapi_query_part(MapiHdl hdl, const char
if (sz < 512 &&
(q = realloc(hdl->query, sz + size + 1)) != NULL)
- hdl->query = strcat(q, query);
+ hdl->query = strncat(q, query, size);
}
if (mid->trace == MAPI_TRACE) {
diff --git a/java/build.xml b/java/build.xml
--- a/java/build.xml
+++ b/java/build.xml
@@ -152,6 +152,7 @@ All Rights Reserved.
optimize="${optimize}"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<src path="${srcdir}" />
<src path="${builddir}/src" />
@@ -169,6 +170,7 @@ All Rights Reserved.
optimize="${optimize}"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<include name="${mcl-package}/**/*.java" />
</javac>
@@ -184,6 +186,7 @@ All Rights Reserved.
optimize="${optimize}"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<include name="${client-package}/**/*.java" />
</javac>
@@ -199,6 +202,7 @@ All Rights Reserved.
optimize="${optimize}"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<include name="${util-package}/**/*.java" />
</javac>
@@ -214,6 +218,7 @@ All Rights Reserved.
optimize="${optimize}"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<include name="${mero-control-package}/**/*.java" />
</javac>
diff --git a/java/tests/Test_PSmanycon.java b/java/tests/Test_PSmanycon.java
new file mode 100644
--- /dev/null
+++ b/java/tests/Test_PSmanycon.java
@@ -0,0 +1,64 @@
+/*
+ * 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://www.monetdb.org/Legal/MonetDBLicense
+ *
+ * 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.
+ */
+
+import java.sql.*;
+import java.util.*;
+
+public class Test_PSmanycon {
+ public static void main(String[] args) throws Exception {
+ Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
+ List pss = new ArrayList(100); // Connections go in here
+
+ try {
+ // spawn a lot of Connections, just for fun...
+ int i;
+ for (i = 0; i < 50; i++) {
+ System.out.print("Establishing Connection " + i
+ "...");
+ Connection con =
DriverManager.getConnection(args[0]);
+ System.out.print(" done...");
+
+ // do something with the connection to test if
it works
+ PreparedStatement pstmt =
con.prepareStatement("select " + i);
+ System.out.println(" alive");
+
+ pss.add(pstmt);
+ }
+
+ // now try to nicely execute them
+ i = 0;
+ for (Iterator it = pss.iterator(); it.hasNext(); i++) {
+ PreparedStatement pstmt =
(PreparedStatement)(it.next());
+
+ // see if the connection still works
+ System.out.print("Executing PreparedStatement "
+ i + "...");
+ if (!pstmt.execute())
+ throw new Exception("should have seen a
ResultSet!");
+
+ ResultSet rs = pstmt.getResultSet();
+ if (!rs.next())
+ throw new Exception("ResultSet is
empty");
+ System.out.print(" result: " + rs.getString(1));
+ pstmt.getConnection().close();
+ System.out.println(", done");
+ }
+ } catch (SQLException e) {
+ System.out.println("FAILED! " + e.getMessage());
+ }
+ }
+}
diff --git a/java/tests/build.xml b/java/tests/build.xml
--- a/java/tests/build.xml
+++ b/java/tests/build.xml
@@ -58,6 +58,7 @@ All Rights Reserved.
optimize="false"
target="${javac_version}"
source="${javac_version}"
+ includeantruntime="false"
>
<include name="**/*.java" />
<classpath>
@@ -115,6 +116,7 @@ All Rights Reserved.
<antcall target="Test_PStimedate" />
<antcall target="Test_PStimezone" />
<antcall target="Test_PStypes" />
+ <antcall target="Test_PSmanycon" />
<antcall target="Test_Rbooleans" />
<antcall target="Test_Rmetadata" />
<antcall target="Test_Rpositioning" />
@@ -229,6 +231,12 @@ All Rights Reserved.
</antcall>
</target>
+ <target name="Test_PSmanycon">
+ <antcall target="test_class">
+ <param name="test.class" value="Test_PSmanycon" />
+ </antcall>
+ </target>
+
<target name="Test_Rbooleans">
<antcall target="test_class">
<param name="test.class" value="Test_Rbooleans" />
diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All
--- a/sql/jdbc/tests/Tests/All
+++ b/sql/jdbc/tests/Tests/All
@@ -9,6 +9,7 @@ HAVE_JDBCTESTS?Test_PSlargeamount
HAVE_JDBCTESTS?Test_PStimedate
HAVE_JDBCTESTS?Test_PStimezone
HAVE_JDBCTESTS?Test_PStypes
+HAVE_JDBCTESTS?Test_PSmanycon
HAVE_JDBCTESTS?Test_Rbooleans
HAVE_JDBCTESTS?Test_Rmetadata
HAVE_JDBCTESTS?Test_Rpositioning
diff --git a/sql/jdbc/tests/Tests/Test_PStypes.SQL.bat
b/sql/jdbc/tests/Tests/Test_PSmanycon.SQL.bat
copy from sql/jdbc/tests/Tests/Test_PStypes.SQL.bat
copy to sql/jdbc/tests/Tests/Test_PSmanycon.SQL.bat
diff --git a/sql/jdbc/tests/Tests/Test_PStypes.SQL.sh
b/sql/jdbc/tests/Tests/Test_PSmanycon.SQL.sh
copy from sql/jdbc/tests/Tests/Test_PStypes.SQL.sh
copy to sql/jdbc/tests/Tests/Test_PSmanycon.SQL.sh
diff --git a/sql/jdbc/tests/Tests/Test_PSmanycon.stable.err
b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.err
@@ -0,0 +1,42 @@
+stderr of test 'Test_PSmanycon` in directory 'jdbc/tests` itself:
+
+
+# 11:28:52 >
+# 11:28:52 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-Aug2011-volund.ins.cwi.nl/sql/dbfarm"
"--set" "mapi_open=true" "--set" "mapi_port=39865" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_jdbc_tests"
"--set" "mal_listing=0"
+# 11:28:52 >
+
+# builtin opt gdk_dbname = demo
+# builtin opt gdk_dbfarm =
/ufs/fabian/scratch/monetdb/Aug2011/program-x86_64/var/lib/monetdb5/dbfarm
+# builtin opt gdk_debug = 0
+# builtin opt gdk_alloc_map = no
+# builtin opt gdk_vmtrim = yes
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt gdk_dbfarm =
/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-Aug2011-volund.ins.cwi.nl/sql/dbfarm
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 39865
+# cmdline opt monet_prompt =
+# cmdline opt mal_listing = 2
+# cmdline opt gdk_dbname = mTests_jdbc_tests
+# cmdline opt mal_listing = 0
+
+# 11:28:52 >
+# 11:28:52 > "./Test_PSmanycon.SQL.sh" "Test_PSmanycon"
+# 11:28:52 >
+
+
+# 11:28:52 >
+# 11:28:52 > java Test_PSmanycon
"jdbc:monetdb://volund:39865/mTests_jdbc_tests?user=monetdb&password=monetdb"
+# 11:28:52 >
+
+
+# 11:28:53 >
+# 11:28:53 > "Done."
+# 11:28:53 >
+
diff --git a/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/jdbc/tests/Tests/Test_PSmanycon.stable.out
@@ -0,0 +1,157 @@
+stdout of test 'Test_PSmanycon` in directory 'jdbc/tests` itself:
+
+
+# 11:28:52 >
+# 11:28:52 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-Aug2011-volund.ins.cwi.nl/sql/dbfarm"
"--set" "mapi_open=true" "--set" "mapi_port=39865" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_jdbc_tests"
"--set" "mal_listing=0"
+# 11:28:52 >
+
+# MonetDB 5 server v11.5.4 "Aug2011-41b19066710b"
+# Serving database 'mTests_jdbc_tests', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked
+# Found 7.749 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://volund.ins.cwi.nl:39865/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+# MonetDB/DataCell module not loaded
+# SQLException:mvc:SQL module not initialized
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_history.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_compress.sql
+# loading sql script: 18_dictionary.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 50_datacell.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 11:28:52 >
+# 11:28:52 > "./Test_PSmanycon.SQL.sh" "Test_PSmanycon"
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list