Ticket #4466 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

[PATCH] FGDB driver does not ensure layer names are valid

Reported by: ryanl Owned by: warmerdam
Priority: normal Milestone: 1.9.1
Component: OGR_SF Version: 1.9.0
Severity: normal Keywords: FileGDB, File Geodatabase
Cc: robert.coup@…

Description

If an input contains layer names that are invalid in a FGDB the driver attempts to add them directly, error messages are displayed and the resulting database does not contain the layers.

The FGDB API also exits when you create layers with reserved words.

The attached patch cleans layer names by changing invalid characters to "_", appending "_" to reserved words, prepending "-" to unsupported prefixes, shrinks names to 160 characters and ensures uniqueness of the names. It also adds an alias to the original layer name.

I have attached an example csv/vrt that contains several layers with invalid and duplicate names.

This is similar to #4458.

References:

Attachments

invalid_layers.diff Download (6.7 KB) - added by ryanl 4 months ago.
fix against r23791
tests.csv Download (66 bytes) - added by ryanl 4 months ago.
Examples I tested with
tests.vrt Download (2.1 KB) - added by ryanl 4 months ago.
Examples I tested with

Change History

Changed 4 months ago by ryanl

fix against r23791

Changed 4 months ago by ryanl

Examples I tested with

Changed 4 months ago by ryanl

Examples I tested with

Changed 4 months ago by rouault

  • status changed from new to closed
  • version changed from svn-trunk to 1.9.0
  • resolution set to fixed
  • milestone set to 1.9.1

Thanks. Patch committed with just a simplification : I removed the conditionnal laundering based on creation options : my quick testing shows that the SDK refuses anyway almost all the invalid cases taken into account by the patch.

Committed in trunk (r23796) and branches/1.9 (r23797)

Note: See TracTickets for help on using tickets.