[gdal-dev] Non-standard characters in GeoPackage table names

Even Rouault even.rouault at spatialys.com
Sun Aug 2 09:49:03 PDT 2015


On Sunday 02 August 2015 11:52:53 Jukka Rahkonen wrote:
> Even Rouault <even.rouault <at> spatialys.com> writes:
> > On Saturday 01 August 2015 13:35:30 Jukka Rahkonen wrote:
> > > Hi,
> > > 
> > > Have a look at this QGIS issue https://hub.qgis.org/issues/13140.
> > 
> > Jukka,
> > 
> > I guess this report must be a QGIS running against GDAL 1.11. There has
> 
> been a
> 
> > bug fix in GDAL 2.0 to always quote identifiers (
> > https://trac.osgeo.org/gdal/ticket/5472 ), so now "test-table" is a valid
> > table name.
> > 
> > I guess the applicable standard is SQL-92, with which SQLite is largely
> > conformant, which allows unusual characters to be used in identifiers
> 
> provided
> 
> > the identifier is properly quoted. I doubt the GeoPackage standard would
> > want to specify over that, but you could potentially raise it to
> > https://lists.opengeospatial.org/mailman/listinfo/geopackage
> > 
> > Another possibility would be for GDAL to "launder" identifiers by default
> 
> like
> 
> > it does in a few drivers like PostGIS. The laundering as implemented in
> > that driver consists in converting to lowercase (works properly only on
> > ASCII characters as currently implemented) and replacing single quote,
> > dash and sharp characters by underscore.
> 
> Third and and perhaps best possibility might be to edit the "Annex A
> Conformance / Abstract Test Suite (Normative)" part of the GeoPackage
> standard to use quoted identifiers everywhere. Now the first test in the
> test suite that fails with "test-table" seems to be already the third one:
> 
>  A.1.1.1.1.3 File Contents
> Test Case ID: /base/core/container/data/file_contents
> Test Purpose: Verify that the Geopackage only contains specified contents
> Test Method:
> 1) For each gpkg_* table_name
> a) PRAGMA table_info(table_name)
> ...
> 
> Should be written as PRAGMA table_info("table_name")...

In the above, table_name is intended to be a variable / symbolic name. If the 
test was written  PRAGMA table_info("table_name"), it could potentially be 
confused with the "table_name" identifier.
I guess this is the reason for this test suite to be qualified as "Abstract", 
because it only gives the intent of the test, but the actual test suite has to 
be implemented in a programming language.

> There must be quite many other tests which can fail in a similar way with
> unquoted table names.
> 
> Anyway, good to know that GDAL 2.0 behaves right.
> 
> -Jukka-
> 
> 
> 
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list