Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 5121 invoked from network); 7 Sep 2006 14:55:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Sep 2006 14:55:24 -0000 Received: (qmail 10216 invoked by uid 500); 7 Sep 2006 14:55:24 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 10153 invoked by uid 500); 7 Sep 2006 14:55:24 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 10142 invoked by uid 99); 7 Sep 2006 14:55:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 07:55:24 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 07:55:23 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AFA9D1A981A; Thu, 7 Sep 2006 07:55:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r441105 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/tests/lang/ Date: Thu, 07 Sep 2006 14:55:03 -0000 To: derby-commits@db.apache.org From: djd@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060907145503.AFA9D1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: djd Date: Thu Sep 7 07:55:02 2006 New Revision: 441105 URL: http://svn.apache.org/viewvc?view=rev&rev=441105 Log: DERBY-1700 (partial) Change the compile time code generation to always pass null for the close cleanup method when generating ResultSets. This is because the close cleanup method adds no value since it is only used for current time & date resetting, which is also performed at every execute if a statement uses the SQL current time or date constructs. Incremental development, first just run with no close cleanup method, future steps will include removal of related code from the implementations of ResultSets, then from the ResultSetFactory api and its callers. Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java?view=diff&rev=441105&r1=441104&r2=441105 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java Thu Sep 7 07:55:02 2006 @@ -419,7 +419,7 @@ /* The first time a current datetime is needed, create the class level support for it. The first half of the logic is in our parent - class. Then we add logic here to tidy up for ResultSet management. + class. */ protected LocalField getCurrentSetup() { @@ -433,22 +433,6 @@ executeMethod.getField(lf); executeMethod.callMethod(VMOpcode.INVOKEVIRTUAL, (String) null, "forget", "void", 0); - - // 4) a resultSetClosed method is set up to be passed to - // the outermost result set, if it is an open/close result set, - // so that cdt can be told to forget when a result set closes: - // GeneratedMethod rscm; // the name is just a generated name, simpler. - // void rscm() { - // cdt.forget(); - // } - MethodBuilder mb = newExprFun(); - mb.getField(lf); // the instance - mb.callMethod(VMOpcode.INVOKEVIRTUAL, (String) null, "forget", "void", 0); - mb.pushNull("java.lang.Object"); - mb.methodReturn(); - mb.complete(); - - resultSetClosedMethod = mb; return lf; } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java?view=diff&rev=441105&r1=441104&r2=441105 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java Thu Sep 7 07:55:02 2006 @@ -110,8 +110,6 @@ //protected final JavaFactory javaFac; - protected MethodBuilder resultSetClosedMethod; - private String currentRowScanResultSetName; @@ -717,24 +715,6 @@ // mb.pushThis(); mb.callMethod(getEF); - } - - /** - This utility method returns the resultSetClosed method reference that the - activation wants called when a result set closes, to let it clean up. - This will be null if none was needed. - - REMIND: because ObjectManager returns exceptions on its invoke() method - and close() is not supposed to return exceptions, we may want to - move this to be something done on open() instead of on close(). - Otherwise, we have to do try/catch/THROWASSERT in the close code, - which looks unfriendly. - */ - void pushResultSetClosedMethodFieldAccess(MethodBuilder mb) { - if (resultSetClosedMethod != null) - pushMethodReference(mb, resultSetClosedMethod); - else - mb.pushNull(ClassName.GeneratedMethod); } /** Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?view=diff&rev=441105&r1=441104&r2=441105 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java Thu Sep 7 07:55:02 2006 @@ -408,7 +408,7 @@ date/time request, then a method will have been generated. Otherwise, a simple null is passed in to the result set method. */ - acb.pushResultSetClosedMethodFieldAccess(mb); + mb.pushNull(ClassName.GeneratedMethod); mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet", ClassName.NoPutResultSet, 10); Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java?view=diff&rev=441105&r1=441104&r2=441105 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java Thu Sep 7 07:55:02 2006 @@ -1050,19 +1050,8 @@ void closeMethodArgument(ExpressionClassBuilder acb, MethodBuilder mb) { - /* - For supporting current datetime, we may have a method - that needs to be called when the statement's result set - is closed. - */ - if (statementResultSet) - { - acb.pushResultSetClosedMethodFieldAccess(mb); - } - else - { + mb.pushNull(ClassName.GeneratedMethod); - } } /** Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java?view=diff&rev=441105&r1=441104&r2=441105 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java Thu Sep 7 07:55:02 2006 @@ -61,6 +61,7 @@ suite.addTest(LangScripts.suite()); suite.addTest(GroupByExpressionTest.suite()); suite.addTest(MathTrigFunctionsTest.suite()); + suite.addTest(TimeHandlingTest.suite()); // Tests that are compiled using 1.4 target need to // be added this way, otherwise creating the suite