Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4326 closed defect (fixed)

OGR SQL: OGRFeatureQuery::EvaluateAgainstIndices() : field type is used instead of the node type

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: tamas

Description

Side issue seen in #4259

There's a bug in OGRFeatureQuery::EvaluateAgainstIndices?() that should be fixed (by testing the node type and doing the appropriate cast), and not in your new code (SWQAutoConvertStringToNumeric). Because we currently have a bug *without* your new code :

ogr2ogr mypoly.shp ../autotest/ogr/data/poly.shp -sql "select cast(EAS_ID as integer) as EAS_ID_INT, * from poly"
ogrinfo mypoly.shp -sql "create index on mypoly using EAS_ID_INT"
ogrinfo mypoly.shp -where "EAS_ID_INT in (170)" -al --> works
ogrinfo mypoly.shp -where "EAS_ID_INT in (170.0)" -al --> doesn't work

Change History (3)

comment:1 by Even Rouault, 12 years ago

Milestone: 1.8.2
Resolution: fixed
Status: newclosed

r23307 /trunk/ (autotest/ogr/ogr_index_test.py gdal/ogr/ogrfeaturequery.cpp): Fix bug in OGRFeatureQuery::EvaluateAgainstIndices() when querying a integer field that is indexed with a request with a float value (#4326)

r23308 /branches/1.8/ (autotest/ogr/ogr_index_test.py gdal/ogr/ogrfeaturequery.cpp): Fix bug in OGRFeatureQuery::EvaluateAgainstIndices() when querying a integer field that is indexed with a request with a float value (#4326)

comment:2 by Even Rouault, 12 years ago

r23309 /trunk/ (autotest/ogr/ogr_index_test.py gdal/ogr/ogrfeaturequery.cpp): Complementary fix for #4326 in the equality case

rouault * r23310 /branches/1.8/ (autotest/ogr/ogr_index_test.py gdal/ogr/ogrfeaturequery.cpp): Complementary fix for #4326 in the equality case

comment:3 by Even Rouault, 11 years ago

Milestone: 1.8.2

Milestone 1.8.2 deleted

Note: See TracTickets for help on using tickets.