Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#1244 closed bug (fixed)

QGIS should warn/disallow selecting shapefiles that contain spaces

Reported by: pmcdermott Owned by: nobody
Priority: major: does not work as expected Milestone:
Component: OGR Layer support Version: Trunk
Keywords: shapefile, SQL Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

Description

QGIS should either warn or disallow selecting shapefiles which contain spaces in "Add a Vector Layer", and explain why.

The ESRI Shapefile Technical Description says that shapefiles should follow the 8.3 naming convention, using characters a-Z,0-9,_,-. The practical consequence of shapefile names containing spaces is that SQL queries of the shapefiles data using the GDAL library will fail, with an error message of the form:

ERROR 1: SQL: Failed to parse SELECT statement, extra input at 2 token.

I presume this is due to insufficient quoting in the construction of the SQL query statements.

The cause of this error is difficult to track down, and is ultimately due to user input which could be considered erroneous. But given the ease with which spaces can now be inserted into file names, this sort of user error is easy to make.

An alternative approach would be to allow long filesnames and filenames with spaces and other characters, but this would mean moving away from the ESRI specification. SQL queries would have to be properly quoted, and I presume there would need to be some sort of check for valid Xbase table names. (e.g. is a U with an umlaut a valid Xbase table name?)

Change History (4)

comment:1 by msieczka, 16 years ago

Must Fix for Release: NoYes
Platform: GentooAll
Version: 0.11.0HEAD

comment:2 by msieczka, 16 years ago

Type: enhancementbug

comment:3 by mhugent, 15 years ago

Resolution: fixed
Status: newclosed

Smizunos patch from ticket #1295 (applied to r9787) fixes this ticket too.

comment:4 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.