db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r1627895 - in /db/derby/code/branches/10.11: ./ java/engine/org/apache/derby/impl/jdbc/ java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/
Date Fri, 26 Sep 2014 21:38:00 GMT
Author: myrnavl
Date: Fri Sep 26 21:37:59 2014
New Revision: 1627895

URL: http://svn.apache.org/r1627895
Log:
DERBY-6662; DatabaseMetaData.usesLocalFiles() returns true for in-memory databases
  merge of revision 1627671 and 1627851 from trunk

Added:
    db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java
      - copied, changed from r1627671, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java
Modified:
    db/derby/code/branches/10.11/   (props changed)
    db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/_Suite.java

Propchange: db/derby/code/branches/10.11/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1627671,1627851

Modified: db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=1627895&r1=1627894&r2=1627895&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
(original)
+++ db/derby/code/branches/10.11/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
Fri Sep 26 21:37:59 2014
@@ -331,7 +331,10 @@ public class EmbedDatabaseMetaData exten
      * @return true if so
      */
 	public boolean usesLocalFiles() {
-		return true;
+        if (url.contains("memory"))
+            return false;
+        else
+            return true;
 	}
 
     /**
@@ -340,7 +343,10 @@ public class EmbedDatabaseMetaData exten
      * @return true if the database uses a local file for each table
      */
 	public boolean usesLocalFilePerTable() {
-		return true;
+        if (url.contains("memory"))
+            return false;
+        else
+            return true;
 	}
 
     /**

Copied: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java
(from r1627671, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java)
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java?p2=db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java&p1=db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java&r1=1627671&r2=1627895&rev=1627895&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/Derby6662Test.java
Fri Sep 26 21:37:59 2014
@@ -41,6 +41,7 @@ public class Derby6662Test extends BaseJ
     protected void tearDown() throws Exception
     {
       super.tearDown();
+      dropInMemoryDb();
     }
     
     public void testDatabaseMetaDataCalls() throws SQLException
@@ -50,6 +51,22 @@ public class Derby6662Test extends BaseJ
         assertFalse(dmd.usesLocalFiles());
     }
     
+    public void testOptionalToolMetaData() throws SQLException
+    {
+        Connection conn = obtainConnection();
+        // register the database metadata wrapper
+        goodStatement( conn, "call syscs_util.syscs_register_tool" +
+            "('databaseMetaData', true)");
+        // run the routines
+        assertResults(conn,"values usesLocalFiles()",
+             new String[][]{ { "false" }},false);
+        assertResults(conn,"values usesLocalFilePerTable()",
+             new String[][]{ { "false" }},false);
+        // unregister the database metadata wrapper
+        goodStatement( conn, "call syscs_util.syscs_register_tool" +
+            "('databaseMetaData', false)");
+    }
+    
     private DatabaseMetaData getDMD() throws SQLException
     {
         return obtainConnection().getMetaData();

Modified: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/_Suite.java?rev=1627895&r1=1627894&r2=1627895&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/_Suite.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/_Suite.java
Fri Sep 26 21:37:59 2014
@@ -46,6 +46,7 @@ public class _Suite extends BaseTestCase
         // Tests are not yet compatible with JSR169 / JavaME
         if (!JDBC.vmSupportsJSR169()) {
             suite.addTest(BasicInMemoryDbTest.suite());
+            suite.addTest(Derby6662Test.suite());
             suite.addTest(MogTest.suite());
         }
         return suite;



Mime
View raw message