db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r784682 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
Date Mon, 15 Jun 2009 08:12:32 GMT
Author: kristwaa
Date: Mon Jun 15 08:12:32 2009
New Revision: 784682

URL: http://svn.apache.org/viewvc?rev=784682&view=rev
Log:
DERBY-4171: Connections to on-disk db go to in-memory db if in-memory db with same name is
booted.
Fixed incorrect handling of colon in paths with the Windows drive letter specification.
Patch file: derby-4171-2a.diff


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?rev=784682&r1=784681&r2=784682&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java
Mon Jun 15 08:12:32 2009
@@ -757,8 +757,11 @@
 		String protocolLeadIn = getType() + ":";
         int colon = name.indexOf( ':');
         // If no subsubprotocol is specified and the storage factory type isn't
-        // the default one, abort.
-        if (colon == -1 && !getType().equals(PersistentService.DIRECTORY)) {
+        // the default one, abort. We have to deal with Windows drive
+        // specifications here, which contain a colon (i.e. 'C:').
+        // The logic in this method may break in some cases if a colon is used
+        // in the directory or database name.
+        if (colon < 2 && !getType().equals(PersistentService.DIRECTORY)) {
             return null;
         }
         if( colon > 1) // Subsubprotocols must be at least 2 characters long



Mime
View raw message