MCPcopy Index your code
hub / github.com/MapServer/MapServer / FLTGetSQLExpression

Function FLTGetSQLExpression

mapogcfilter.c:2024–2137  ·  view source on GitHub ↗

/ FLTGetSQLExpression */ / Build SQL expressions from the mapserver nodes. */ /

Source from the content-addressed store, hash-verified

2022/* Build SQL expressions from the mapserver nodes. */
2023/************************************************************************/
2024char *FLTGetSQLExpression(FilterEncodingNode *psFilterNode, layerObj *lp)
2025{
2026 char *pszExpression = NULL;
2027 int connectiontype;
2028 const char *pszAttribute = NULL;
2029 char szTmp[256];
2030 char **tokens = NULL;
2031 int nTokens = 0, i=0, bString=0;
2032
2033 if (psFilterNode == NULL || lp == NULL)
2034 return NULL;
2035
2036 connectiontype = lp->connectiontype;
2037 if (psFilterNode->eType == FILTER_NODE_TYPE_COMPARISON)
2038 {
2039 if ( psFilterNode->psLeftNode && psFilterNode->psRightNode)
2040 {
2041 if (FLTIsBinaryComparisonFilterType(psFilterNode->pszValue))
2042 {
2043 pszExpression =
2044 FLTGetBinaryComparisonSQLExpresssion(psFilterNode, lp);
2045 }
2046 else if (strcasecmp(psFilterNode->pszValue,
2047 "PropertyIsBetween") == 0)
2048 {
2049 pszExpression =
2050 FLTGetIsBetweenComparisonSQLExpresssion(psFilterNode, lp);
2051 }
2052 else if (strcasecmp(psFilterNode->pszValue,
2053 "PropertyIsLike") == 0)
2054 {
2055 pszExpression =
2056 FLTGetIsLikeComparisonSQLExpression(psFilterNode, lp);
2057
2058 }
2059 }
2060 }
2061 else if (psFilterNode->eType == FILTER_NODE_TYPE_LOGICAL)
2062 {
2063 if (strcasecmp(psFilterNode->pszValue, "AND") == 0 ||
2064 strcasecmp(psFilterNode->pszValue, "OR") == 0)
2065 {
2066 pszExpression =
2067 FLTGetLogicalComparisonSQLExpresssion(psFilterNode, lp);
2068
2069 }
2070 else if (strcasecmp(psFilterNode->pszValue, "NOT") == 0)
2071 {
2072 pszExpression =
2073 FLTGetLogicalComparisonSQLExpresssion(psFilterNode, lp);
2074
2075 }
2076 }
2077
2078 else if (psFilterNode->eType == FILTER_NODE_TYPE_SPATIAL)
2079 {
2080 /* TODO */
2081 }

Callers 3

msSLDApplySLDFunction · 0.85
FLTApplySimpleSQLFilterFunction · 0.85

Calls 14

strcasecmpFunction · 0.85
msOWSLookupMetadataFunction · 0.85
msStringSplitFunction · 0.85
FLTIsNumericFunction · 0.85
msLayerEscapeSQLParamFunction · 0.85
msFreeFunction · 0.85
msStringConcatenateFunction · 0.85

Tested by

no test coverage detected