db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1504205 - in /db/derby/code/branches/10.8: ./ java/engine/org/apache/derby/impl/sql/catalog/ java/testing/org/apache/derbyTesting/functionTests/tests/memory/ java/testing/org/apache/derbyTesting/functionTests/util/
Date Wed, 17 Jul 2013 17:12:50 GMT
Author: mamta
Date: Wed Jul 17 17:12:50 2013
New Revision: 1504205

URL: http://svn.apache.org/r1504205
Log:
DERBY-5730 (DataDictionaryImpl leaks references to itself via SYSFUN_AD)
DERBY-5753: (Derby5730Test fails on Java 5)


Backporting to 10.8. Original fix contributed by Knut.



Added:
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java
      - copied, changed from r1335423, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java
Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
  Reverse-merged /db/derby/code/trunk:r1188109,1188828,1347888,1350361,1353764
  Merged /db/derby/code/trunk:r1335423,1336526

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1504205&r1=1504204&r2=1504205&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Wed Jul 17 17:12:50 2013
@@ -280,7 +280,7 @@ public final class	DataDictionaryImpl
 	 * Runtime definition of the functions from SYSFUN_FUNCTIONS.
 	 * Populated dynamically as functions are called.
 	 */
-	private static final AliasDescriptor[] SYSFUN_AD =
+	private final AliasDescriptor[] sysfunDescriptors =
 		new AliasDescriptor[SYSFUN_FUNCTIONS.length];
 
 	// the structure that holds all the core table info
@@ -7727,7 +7727,7 @@ public final class	DataDictionaryImpl
 				if (!name.equals(routineName))
 					continue;
 				
-				AliasDescriptor ad = DataDictionaryImpl.SYSFUN_AD[f];
+				AliasDescriptor ad = sysfunDescriptors[f];
 				if (ad == null)
 				{
 					// details[1] Return type
@@ -7764,7 +7764,7 @@ public final class	DataDictionaryImpl
 							AliasInfo.ALIAS_NAME_SPACE_FUNCTION_AS_CHAR,
 							true, ai, null);
 
-					DataDictionaryImpl.SYSFUN_AD[f] = ad;
+					sysfunDescriptors[f] = ad;
 				}
 				list.add(ad);
 			}

Copied: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java
(from r1335423, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java?p2=db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java&r1=1335423&r2=1504205&rev=1504205&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/Derby5730Test.java
Wed Jul 17 17:12:50 2013
@@ -107,7 +107,8 @@ public class Derby5730Test extends BaseT
      * between. Eventually runs out of memory if DERBY-5730 is not fixed.
      * Must run with capped memory size (-Xmx16M) to expose the memory leak.
      */
-    public static void main(String[] args) throws SQLException {
+    public static void main(String[] args) throws Exception {
+        Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
         for (int i = 0; i < FUNCTIONS.length; i++) {
             Connection c = DriverManager.getConnection(
                     "jdbc:derby:memory:derby5730;create=true");

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java?rev=1504205&r1=1504204&r2=1504205&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/memory/_Suite.java
Wed Jul 17 17:12:50 2013
@@ -41,6 +41,7 @@ public class _Suite extends BaseJDBCTest
         suite.addTest(MultiByteClobTest.suite());
         suite.addTest(RolesDependencyTest.suite());
         suite.addTest(Derby3009Test.suite());
+        suite.addTest(Derby5730Test.suite());
         suite.addTest(MemoryLeakFixesTest.suite());
 
         // DERBY-5394: Let this test run as the last test - it eats up memory.

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?rev=1504205&r1=1504204&r2=1504205&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
Wed Jul 17 17:12:50 2013
@@ -229,6 +229,9 @@ grant codeBase "${derbyTesting.testjar}d
   // Access all files under ${user.dir}to write the test directory structure
   permission java.io.FilePermission "${user.dir}${/}-", "read,write,delete"; 
 
+  // Tests need to be able to exec a java program.
+  permission java.io.FilePermission "${java.home}${/}-", "execute";	
+
   // When running with useprocess=false need to install and uninstall
   // the security manager and allow setIO to change the system err and out
   // streams. Currently the nist suite runs with useprocess=false.
@@ -301,6 +304,9 @@ grant codeBase "${derbyTesting.codeclass
   // Access all files under ${user.dir}to write the test directory structure
   // Also covers extin, extout and extinout locations
   permission java.io.FilePermission "${user.dir}${/}-", "read,write,delete"; 
+   
+  // Tests need to be able to exec a java program.
+  permission java.io.FilePermission "${java.home}${/}-", "execute";
     
   // These permissions are needed to load the JCE for encryption with Sun and IBM JDK131.
   // JDK14 has the JCE  preloaded



Mime
View raw message