OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.92k stars 2.56k forks source link

SetAttributeFilter / ApplicationException #11295

Open dcasalino opened 3 days ago

dcasalino commented 3 days ago

What is the bug?

Dear all,

i'm opening a GeoDB file ad on a layer would like to set a AttributeFilter but i obtain this applicationException

error

What i'm doing wrong ?

Thanks in advance

Steps to reproduce the issue

Try to set AttributeFilter

Versions and provenance

Windows

Additional context

No response

rouault commented 3 days ago

Please attached the zipped FileGeodatabase

dcasalino commented 3 days ago

Sorry but I can't attach, but if i look the code, there is this check

https://github.com/OSGeo/gdal/blob/957c178ecba2f5ac04b3c642dec6b03f7ea4cd6a/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp#L2568

returnErrorAndCleanupIf(nColNameCarCount > 1024, VSIFree(pabyIdx));

Maybe in my geodb the number of the charactes of all column of this layer is > 1024. It's possibile to by-pass this check ?

rouault commented 3 days ago

It's possibile to by-pass this check ?

if you change the source code yes, otherwise no. This was meant as a sanity check. How come the name of your columns is so long... ?

dcasalino commented 1 day ago

The total length of all column of layer in my geodb is 2167 chars. This was not my choose. If i set filter on field OBJECTID i have no errors.

rouault commented 1 day ago

The total length of all column of layer in my geodb is 2167 chars

the total length of all columns is not much of an issue, here it fails because the expression of one column is larger than 1024 characters. Can you just attach the files ending with .gdbindexes ? They are the ones relevant here and they don't contain any information other than the column names.

dcasalino commented 11 hours ago

Here we go

https://1drv.ms/u/c/968a95dc557962c5/EQ5oyp85mRtDuVXIWi07WdIBTNTJ1_yDwwCnU82Miw2W7A?e=Avp9q4