db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
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 GMT
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



Mime
View raw message