Opened 2 months ago

Closed 2 months ago

Last modified 2 months 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 Changed 2 months ago by Even Rouault

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 Changed 2 months ago by Even Rouault

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 Changed 2 months ago by Even Rouault

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 Changed 2 months ago by Even Rouault

Milestone: 2.1.5

comment:5 Changed 2 months ago by elpaso

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 Changed 2 months ago by Even Rouault

In 39936:

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

comment:7 in reply to:  5 Changed 2 months ago by Even Rouault

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.