Changeset: 7e21e8a49359 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7e21e8a49359
Modified Files:
        sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat
        sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh
        sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err
        sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out
        sql/jdbc/tests/Tests/Test_PSlargeamount.timeout
Branch: default
Log Message:

merging


diffs (truncated from 608 to 300 lines):

diff --git a/clients/mapiclient/stethoscope.c b/clients/mapiclient/stethoscope.c
--- a/clients/mapiclient/stethoscope.c
+++ b/clients/mapiclient/stethoscope.c
@@ -45,12 +45,6 @@
 # endif
 #endif
 
-enum modes {
-    MAL,
-    SQL
-};
-static enum modes mode = SQL;
-
 #define COUNTERSDEFAULT "ISTest"
 
 static struct {
@@ -325,7 +319,6 @@ main(int argc, char **argv)
        char *dbname = NULL;
        char *user = NULL;
        char *password = NULL;
-       char *language = NULL;
 
        /* some .monetdb properties are used by mclient, perhaps we need them 
as well later */
        struct stat statb;
@@ -390,22 +383,6 @@ main(int argc, char **argv)
                                user = strdup(q);       /* leak */
                        } else if (strcmp(buf, "password") == 0 || strcmp(buf, 
"passwd") == 0) {
                                password = strdup(q);   /* leak */
-                       } else if (strcmp(buf, "language") == 0) {
-                               language = strdup(q);   /* leak */
-                               if (strcmp(language, "sql") == 0) {
-                                       mode = SQL;
-                               } else if (strcmp(language, "mal") == 0) {
-                                       mode = MAL;
-                               } else {
-                                       /* make sure we don't set garbage */
-                                       fprintf(stderr,
-                                                 "%s:%d: unsupported "
-                                                 "language: %s\n",
-                                                 mnstr_name(config),
-                                                 line, q);
-                                       free(language);
-                                       language = NULL;
-                               }
                        }
                }
                mnstr_destroy(config);
diff --git a/java/tests/Test_PSsomeamount.java 
b/java/tests/Test_PSsomeamount.java
new file mode 100644
--- /dev/null
+++ b/java/tests/Test_PSsomeamount.java
@@ -0,0 +1,56 @@
+/*
+ * 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-2012 MonetDB B.V.
+ * All Rights Reserved.
+ */
+
+import java.sql.*;
+import java.util.*;
+
+/* Create a lot of PreparedStatements, to emulate webloads such as those
+ * from Hibernate. */
+
+public class Test_PSsomeamount {
+       public static void main(String[] args) throws Exception {
+               Class.forName("nl.cwi.monetdb.jdbc.MonetDriver");
+               Connection con = DriverManager.getConnection(args[0]);
+               Statement stmt = con.createStatement();
+               PreparedStatement pstmt;
+
+               // >> true: auto commit should be on
+               System.out.println("0. true\t" + con.getAutoCommit());
+
+               try {
+                       System.out.println("1. Preparing and executing a unique 
statement");
+                       for (int i = 0; i < 10000; i++) {
+                               pstmt = con.prepareStatement("select " + i + ", 
" + i + " = ?");
+                               pstmt.setInt(1, i);
+                               ResultSet rs = pstmt.executeQuery();
+                               if (rs.next() && i % 1000 == 0) {
+                                       System.out.println(rs.getInt(1) + ", " 
+ rs.getBoolean(2));
+                               }
+                               /* this call should cause resources on the 
server to be
+                                * freed */
+                               pstmt.close();
+                       }
+               } catch (SQLException e) {
+                       System.out.println("FAILED :( "+ e.getMessage());
+                       System.out.println("ABORTING TEST!!!");
+               }
+
+               con.close();
+       }
+}
diff --git a/java/tests/build.xml b/java/tests/build.xml
--- a/java/tests/build.xml
+++ b/java/tests/build.xml
@@ -112,6 +112,7 @@ All Rights Reserved.
     <antcall target="Test_PSgeneratedkeys" />
     <antcall target="Test_PSlargeresponse" />
     <antcall target="Test_PSlargeamount" />
+    <antcall target="Test_PSsomeamount" />
     <antcall target="Test_PSlargebatchval" />
     <antcall target="Test_PStimedate" />
     <antcall target="Test_PStimezone" />
@@ -219,6 +220,12 @@ All Rights Reserved.
     </antcall>
   </target>
 
+  <target name="Test_PSsomeamount">
+    <antcall target="test_class">
+      <param name="test.class" value="Test_PSsomeamount" />
+    </antcall>
+  </target>
+
   <target name="Test_PSlargebatchval">
     <antcall target="test_class">
       <param name="test.class" value="Test_PSlargebatchval" />
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
@@ -6,7 +6,7 @@ HAVE_JDBCTESTS?Test_Csavepoints
 HAVE_JDBCTESTS?Test_Ctransaction
 HAVE_JDBCTESTS?Test_Dobjects
 HAVE_JDBCTESTS?Test_PSgeneratedkeys
-HAVE_JDBCTESTS?Test_PSlargeamount
+HAVE_JDBCTESTS?Test_PSsomeamount
 HAVE_JDBCTESTS?Test_PSlargebatchval
 HAVE_JDBCTESTS?Test_PStimedate
 HAVE_JDBCTESTS?Test_PStimezone
diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat 
b/sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.bat
rename from sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.bat
rename to sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.bat
diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh 
b/sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.sh
rename from sql/jdbc/tests/Tests/Test_PSlargeamount.SQL.sh
rename to sql/jdbc/tests/Tests/Test_PSsomeamount.SQL.sh
diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err 
b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err
rename from sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err
rename to sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err
--- a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.err
+++ b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'Test_PSlargeamount` in directory 'jdbc/tests` itself:
+stderr of test 'Test_PSsomeamount` in directory 'jdbc/tests` itself:
 
 
 # 10:38:37 >  
diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out 
b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out
rename from sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out
rename to sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out
--- a/sql/jdbc/tests/Tests/Test_PSlargeamount.stable.out
+++ b/sql/jdbc/tests/Tests/Test_PSsomeamount.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'Test_PSlargeamount` in directory 'jdbc/tests` itself:
+stdout of test 'Test_PSsomeamount` in directory 'jdbc/tests` itself:
 
 
 # 10:38:37 >  
@@ -37,98 +37,8 @@ 6000, true
 7000, true
 8000, true
 9000, true
-10000, true
-11000, true
-12000, true
-13000, true
-14000, true
-15000, true
-16000, true
-17000, true
-18000, true
-19000, true
-20000, true
-21000, true
-22000, true
-23000, true
-24000, true
-25000, true
-26000, true
-27000, true
-28000, true
-29000, true
-30000, true
-31000, true
-32000, true
-33000, true
-34000, true
-35000, true
-36000, true
-37000, true
-38000, true
-39000, true
-40000, true
-41000, true
-42000, true
-43000, true
-44000, true
-45000, true
-46000, true
-47000, true
-48000, true
-49000, true
-50000, true
-51000, true
-52000, true
-53000, true
-54000, true
-55000, true
-56000, true
-57000, true
-58000, true
-59000, true
-60000, true
-61000, true
-62000, true
-63000, true
-64000, true
-65000, true
-66000, true
-67000, true
-68000, true
-69000, true
-70000, true
-71000, true
-72000, true
-73000, true
-74000, true
-75000, true
-76000, true
-77000, true
-78000, true
-79000, true
-80000, true
-81000, true
-82000, true
-83000, true
-84000, true
-85000, true
-86000, true
-87000, true
-88000, true
-89000, true
-90000, true
-91000, true
-92000, true
-93000, true
-94000, true
-95000, true
-96000, true
-97000, true
-98000, true
-99000, true
 
-# 10:52:24 >  
-# 10:52:24 >  Done.
-# 10:52:24 >  
+# 18:56:08 >  
+# 18:56:08 >  "Done."
+# 18:56:08 >  
 
diff --git a/sql/jdbc/tests/Tests/Test_PSlargeamount.timeout 
b/sql/jdbc/tests/Tests/Test_PSsomeamount.timeout
rename from sql/jdbc/tests/Tests/Test_PSlargeamount.timeout
rename to sql/jdbc/tests/Tests/Test_PSsomeamount.timeout
diff --git a/sql/server/rel_bin.c b/sql/server/rel_bin.c
--- a/sql/server/rel_bin.c
+++ b/sql/server/rel_bin.c
@@ -1324,8 +1324,24 @@ rel2bin_join( mvc *sql, sql_rel *rel, li
          */
        if (rel->exps) {
                int idx = 0;
+               list *jexps = sa_list(sql->sa);
                list *jns = sa_list(sql->sa);
 
+               /* get equi-joins first */
+               if (list_length(rel->exps) > 1) {
+                       for( en = rel->exps->h; en; en = en->next ) {
+                               sql_exp *e = en->data;
+                               if (e->type == e_cmp && e->flag == cmp_equal)
+                                       append(jexps, e);
+                       }
+                       for( en = rel->exps->h; en; en = en->next ) {
+                               sql_exp *e = en->data;
+                               if (e->type != e_cmp || e->flag != cmp_equal)
+                                       append(jexps, e);
+                       }
+                       rel->exps = jexps;
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to