Opened 16 years ago

Closed 16 years ago

#2206 closed defect (fixed)

Odd OGR SQL Casting

Reported by: warmerdam Owned by: 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 (1)

comment:1 by tamas, 16 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.