[Fdo-trac] [fdo-trac] #1019: Better handle large chains of OR conditions

FDO trac_fdo at osgeo.org
Wed Oct 21 01:48:45 PDT 2026


#1019: Better handle large chains of OR conditions
-----------------------+----------------------
   Reporter:  jng      |      Owner:  jng
       Type:  defect   |     Status:  assigned
   Priority:  major    |  Milestone:  4.2.0
  Component:  FDO API  |    Version:
   Severity:  3        |   Keywords:
External ID:           |
-----------------------+----------------------
 Copy from: https://trac.osgeo.org/mapguide/ticket/2751

 DeepSeek analysis of the problem:

 At the FDO level, there are 2 issues:

 1. The SQLite provider has an internal max expression depth of 1000, which
 would cause SQLite to error out with "Expression tree is too large" if
 given a sufficiently large chain of OR conditions. Fix: Attempt to
 optimize this down to an IN(...) clause during FDO filter -> query
 translation.

 2. FdoExpressionEngine::OptimizeFilter (called by SetFilter) walks the
 expression tree recursively, which for really large chains can cause a
 stack overflow. Fix: Make the walking non-recursive.
-- 
Ticket URL: <https://trac.osgeo.org/fdo/ticket/1019>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list