Opened 15 years ago

Closed 15 years ago

#646 closed defect (fixed)

Sqlite SelectAggregates on non featureclass does not apply filter

Reported by: bscott Owned by: romicadascalescu
Priority: blocker Milestone: 3.6.0
Component: SQLite Provider Version: 3.5.0
Severity: 3 Keywords:
Cc: External ID:

Description

I have 2 table , created the same way using FDO One is a point featureclass ( with a geometry column) and the other is point_xy non feature class ( with x and y)

If i run SelectAggregates against the feature class "select count(1) from point where key_1 = 1" it works fine ( return 1 )

But if i try the same thing on the non feature class "select count(1) from point_xy where key_1 = 1" it returns the total amount of record in the table just like if it skipped the where clause

I'm trying to locate the problem in the code but not found anything wrong yet.

Attachments (1)

SelectAggregatesOnNonFeatureClass.patch (575 bytes ) - added by bscott 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by bscott, 15 years ago

I have found a way to fix the defect. I don't exacly know if this could produce some side effets. But from our unit test (quite complete) point of view it works fine

Could you check this pacth.

Thanks Bruno

comment:2 by traianstanev, 15 years ago

Owner: changed from traianstanev to romicadascalescu

comment:3 by traianstanev, 15 years ago

While this patch probably fixes the problem, it will make queries by ID slow, since it will trigger generic SQL evalauation. A better fix would probably be to not optimize away the filter in the case of an aggregate query on a non-feature class. There are two code paths in the provider for aggregates, one is optimized for geometry-based classes and the other is generic, and you are probably hitting a bug in the generic code path.

comment:4 by romicadascalescu, 15 years ago

Resolution: fixed
Status: newclosed

Fixed by the following change: Date: 2010-05-10 13:19:37 -0400 (Mon, 10 May 2010) New Revision: 5501

Modified:

trunk/Providers/SQLite/Src/Provider/SltQueryTranslator.cpp

Note: See TracTickets for help on using tickets.