[gdal-dev] GeoPackage fails after touching it with Spatialite-gui

Even Rouault even.rouault at mines-paris.org
Tue Feb 18 02:05:01 PST 2014


Selon "Rahkonen Jukka  (Tike)" <jukka.rahkonen at mmmtike.fi>:

> Hi,
>
> Creating indexes with sqlite3 feels safe. Renaming table is unsafe and leads
> to ogrinfo crash.
>
> sqlite> alter table test rename to test2;
>
> C:ohjelmatsqlite3>ogrinfo kuti.gpkg
> ERROR 1: (null)
> INFO: Open of `kuti.gpkg'
>       using driver `GPKG' successful.
>
> Next: Crash.
>
> What is good is that everything is good again after doing
> sqlite> alter table test2 rename to test;
>
> Renaming a table is not something that is absolutely needed but it is not a
> totally odd idea either and it should not lead to program crash. Now it looks
> like the crash comes from metadata and real table names being unsynchronized
> and a proper way to support renaming the tables would mean creating also
> triggers into the database for updating the metadata fields correctly.
> Because it is sure at the moment that renaming a table will lead to a not
> usable GeoPackage it might be good to mention it in the Limitations section
> of driver page http://www.gdal.org/ogr/drv_geopackage.html

I share your analysis. This is likely a lack of robustness when a table name
found in the metadata tables (like gpkg_contents) does not exist. I've not
checked if sqlite triggers could be used to update gpkg_contents accordingly,
which would be the right thing to do if doable. But anyway sqlite triggers can
be disabled by applications, so the driver ought to be robust for that. This is
IMHO worth a ticket. Please add pramsey in CC of the ticket

Even




More information about the gdal-dev mailing list