[gdal-dev] Clearing OGR Attribute Filter on ESRI Personal
Geodatabase
Joel Odom
joelodom at gmail.com
Fri Jul 30 09:57:29 EDT 2010
What's the process by which I can submit that change, or request to have
someone with commit access add it? Thanks.
On Fri, Jul 30, 2010 at 9:54 AM, Frank Warmerdam <warmerdam at pobox.com>wrote:
> Joel Odom wrote:
>
>> I'm encountering an issue where once I've set an attribute filter on an
>> ESRI personal geodatabase, I cannot clear that filter. If I pass NULL to
>> SetAttributeFilter, the filter is internally set to "", which makes future
>> queries return zero results instead of all rows. Examining the personal
>> geodatabase driver code, I find:
>>
>> OGRErr OGRPGeoTableLayer::SetAttributeFilter( const char *pszQuery )
>> {
>> if( (pszQuery == NULL && this->pszQuery == NULL)
>> || (pszQuery != NULL && this->pszQuery != NULL &&
>> EQUAL(pszQuery,this->pszQuery)) )
>> return OGRERR_NONE;
>>
>> CPLFree( this->pszQuery );
>> this->pszQuery = CPLStrdup( pszQuery );
>>
>> ClearStatement();
>>
>> return OGRERR_NONE;
>> }
>>
>> Around the line, "this->pszQuery = CPLStrdup( pszQuery );" should there be
>> an additional bit of logic that sets this->pszQuery to NULL if pszQuery is
>> NULL? I've searched this mailing list and find no reference to this. Is
>> there a possible work around? Thanks.
>>
>
> Joel,
>
> Yes, I think you are right. I imagine this:
>
> this->pszQuery = CPLStrdup( pszQuery );
>
> should be replaced with:
> if( pszQuery )
> this->pszQuery = CPLStrdup(pszQuery);
> else
> this->pszQuery = NULL;
>
> Could you file a ticket on this issue at http://trac.osgeo.org/gdal?
>
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush | Geospatial Programmer for Rent
>
>
--
http://www.operationliberate.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100730/a34bd5c4/attachment-0001.html
More information about the gdal-dev
mailing list