Ticket #2206 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Odd OGR SQL Casting

Reported by: warmerdam Assigned to: tamas
Priority: normal Milestone: 1.6.0
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: RFC 21 OGR SQL
Cc:

Description

Following the implementation of RFC 21 many test suite tests are failing for OGR. In an attempt to isolate it I found the following odd behavior (using autotest/ogr/data/poly.shp).

ogrinfo data/poly.shp -sql 'select prfedea from poly'
...
OGRFeature(poly):9
  prfedea (String) = 35043413
...

ogrinfo data/poly.shp -sql 'select * from poly'
...
OGRFeature(poly):9
  AREA (Integer) = 5268
  EAS_ID (Integer) = 170
  PRFEDEA (Integer) = 35043413

The odd thing here is that PRFEDEA in the original file is Integer. If I select it explicitly by name, the type is changed to string for some reason. If I implicitly select it via "select *" it remains an integer.

The test suite failures also seem to related unexpected changes in types in ExecuteSQL results though I haven't review them all.

Change History

02/07/08 17:42:40 changed by tamas

  • status changed from new to closed.
  • resolution set to fixed.

The wildcard-expanded fields haven't been initialized properly that was the problem. Applied the fix in r13726