Ticket #1823 (assigned defect)

Opened 1 year ago

Last modified 1 month ago

ogr2ogr import to mysql produces sql with 'natural' keyword

Reported by: nickb Assigned to: mloskot (accepted)
Priority: low Milestone: 1.6.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: mysql sql keywords
Cc: warmerdam, hobu

Description

ogr2ogr (gdal-bin Version: 1.3.2-2ubuntu1 installed with apt) produces SQL statements that include MySQL's 'natural' keyword, causing an error from MySQL eg:

ALTER TABLE nicks_test_data ADD COLUMN natural VARCHAR(32)

Change History

09/12/07 11:45:32 changed by warmerdam

  • keywords changed from mysql ogr2ogr natural to mysql sql keywords.
  • priority changed from normal to low.
  • cc set to warmerdam, hobu.
  • owner changed from warmerdam to mloskot.
  • milestone set to 1.5.0.

Mateusz,

Could you review our options to resolve this in a reasonable general way? Perhaps if we quote field names sql keyword conflicts won't matter? Alternatively, perhaps we should have an sql keyword list and launder conflicting field and table names?

We can defer this to 1.6 if it looks too involved before 1.5.

12/18/07 13:13:25 changed by hobu

  • milestone changed from 1.5.0 to 1.6.0.

It appears the user's data has a field called 'natural', and this is why it is attempting to be created.

Maintaining a keyword list to check against adds lots of work, especially if we're expected to maintain it across all of the various MySQL versions. IMO, the solution is to leave the error as is and the user must rename their column(s) to not be SQL keywords.

08/06/08 12:00:20 changed by mloskot

  • status changed from new to assigned.