Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7019 closed defect (fixed)

DefaultCreateCopy()/gdal_translate deletes the target file in case of failure when -co APPEND_SUBDATASET=YES is used

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 2.1.5
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

All in title. This is undesired behaviour. We should preserve the original file (which might be corrupted, but people have at least a better starting point to repare it...)

Change History (7)

comment:1 by Even Rouault, 7 years ago

Resolution: fixed
Status: assignedclosed

In 39933:

DefaultCreateCopy()/gdal_translate: do not destroy target file in case of failed copy wen using -co APPEND_SUBDATASET=YES (fixes #7019)

comment:2 by Even Rouault, 7 years ago

In 39934:

DefaultCreateCopy()/gdal_translate: do not destroy target file in case of failed copy wen using -co APPEND_SUBDATASET=YES (fixes #7019)

comment:3 by Even Rouault, 7 years ago

In 39935:

DefaultCreateCopy()/gdal_translate: do not destroy target file in case of failed copy wen using -co APPEND_SUBDATASET=YES (fixes #7019)

comment:4 by Even Rouault, 7 years ago

Milestone: 2.1.5

comment:5 by elpaso, 7 years ago

May I suggest to do some cleanup of the tables before exiting, so that the gpkg is left in a consistent state? Would it be possible to wrap it all in a transaction and just rollback in case of error?

comment:6 by Even Rouault, 7 years ago

In 39936:

Fix compilation error related to latest commit (refs #7019)

in reply to:  5 comment:7 by Even Rouault, 7 years ago

Replying to elpaso:

May I suggest to do some cleanup of the tables before exiting, so that the gpkg is left in a consistent state?

Would be for a different ticket. Here this is a general fix for all drivers.

Would it be possible to wrap it all in a transaction and just rollback in case of error?

There are transactions used for some parts, but probably not for the whole process (would probably involved created a huge journal and copying it back to main file). I'm no longer sure.

Note: See TracTickets for help on using tickets.