/ ApplyFilter: Apply filtering for a table (where or having clause). */ New algorithm: evaluate from the root a de-linearized filter so */ AND/OR clauses can be optimized throughout the whole tree. */ /
| 1733 | /* AND/OR clauses can be optimized throughout the whole tree. */ |
| 1734 | /***********************************************************************/ |
| 1735 | DllExport bool ApplyFilter(PGLOBAL g, PFIL filp) |
| 1736 | { |
| 1737 | if (!filp) |
| 1738 | return TRUE; |
| 1739 | |
| 1740 | // Must be done for null tables |
| 1741 | filp->Reset(); |
| 1742 | |
| 1743 | //if (tdbp && tdbp->IsNull()) |
| 1744 | // return TRUE; |
| 1745 | |
| 1746 | if (filp->Eval(g)) |
| 1747 | throw (int)TYPE_FILTER; |
| 1748 | |
| 1749 | if (trace(2)) |
| 1750 | htrc("PlugFilter filp=%p result=%d\n", |
| 1751 | filp, filp->GetResult()); |
| 1752 | |
| 1753 | return filp->GetResult(); |
| 1754 | } // end of ApplyFilter |