You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Suresh Thalamati (JIRA)" <de...@db.apache.org> on 2006/02/21 01:12:25 UTC

[jira] Updated: (DERBY-304) If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!

     [ http://issues.apache.org/jira/browse/DERBY-304?page=all ]

Suresh Thalamati updated DERBY-304:
-----------------------------------

    Attachment: derby-304.diff

DERBY-304:  If the given backup path is same as the database home, backup 
was failing in trying to copy the backup onto itself, while copying the 
directories in the database home recursively into the backup. 

Fix :

1) Do not allow backup path to be any derby database directory. A directory is
   assumed to be a derby database directory if it has service.properties file in it. 

2) copy files needed from the database home into the backup  one by one 
   instead of recursive copy from the top directory. 

3) while copying the directories under jar directory, copy each sub directory
   separately without copying any subdirectories under them (There should not
   be any unless if user has created explicitly or created backup at that location).

4) Log and Seg0 directory are NOT already copied recursively, this was changed as part of
   online backup work (DERBY-239).

    
TESTS : derbyall test suite passed on Windows XP/JDK142, except for known failures.

It would be great if some can review and commit this patch. 

svn stat:
M      java\engine\org\apache\derby\impl\sql\execute\JarDDL.java
M      java\engine\org\apache\derby\impl\store\raw\RawStore.java
M      java\engine\org\apache\derby\iapi\services\io\FileUtil.java
M      java\engine\org\apache\derby\iapi\store\access\FileResource.java
M      java\engine\org\apache\derby\loc\messages_en.properties
M      java\shared\org\apache\derby\shared\common\reference\SQLState.java
M      java\testing\org\apache\derbyTesting\functionTests\tests\store\copyfiles.ant
A      java\testing\org\apache\derbyTesting\functionTests\tests\store\BackupPathTests.java
A      java\testing\org\apache\derbyTesting\functionTests\tests\store\BackupPathTests_app.properties
A      java\testing\org\apache\derbyTesting\functionTests\master\BackupPathTests.out
M      java\testing\org\apache\derbyTesting\functionTests\suites\storemore.runall


> If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-304
>          URL: http://issues.apache.org/jira/browse/DERBY-304
>      Project: Derby
>         Type: Bug
>   Components: Store
>     Versions: 10.1.1.0
>  Environment: With JDK 142 on Windows XP
>     Reporter: Manjula Kutty
>     Assignee: Suresh Thalamati
>     Priority: Minor
>  Attachments: derby-304.diff
>
> If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until it crashes! 
> Repro:
> 			CallableStatement cs = conn.prepareCall("CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(?, ?)");
> 			cs.setString(1, "c:/maildb");
> 			cs.setInt(2, 1);
> 			cs.execute();
> 			cs.close();
> result:
> C:\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\maildb\..................... Until windows can not show the path!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira