Skip to content
Permalink
Browse files

Compile some string functions

  • Loading branch information
nyalldawson committed Jan 3, 2017
1 parent 30f498f commit 57917ab1180c2305c84908105f1bfcb367f0764d
@@ -92,7 +92,12 @@ static const QMap<QString, QString>& functionNamesSqlFunctionsMap()
fnNames =
{
{ "abs", "abs" },
{ "round", "round" }
{ "char", "char" },
{ "coalesce", "coalesce" },
{ "lower", "lower" },
{ "round", "round" },
{ "trim", "trim" },
{ "upper", "upper" },
};
}
return fnNames;
@@ -102,7 +102,12 @@ static const QMap<QString, QString>& functionNamesSqlFunctionsMap()
{ "union", "ST_Union" },
#endif
{ "geom_from_wkt", "ST_GeomFromText" },
{ "geom_from_gml", "ST_GeomFromGML" }
{ "geom_from_gml", "ST_GeomFromGML" },
{ "char", "chr" },
{ "coalesce", "coalesce" },
{ "lower", "lower" },
{ "trim", "trim" },
{ "upper", "upper" },
};
}
return fnNames;
@@ -252,6 +252,11 @@ def runGetFeatureTests(self, provider):
self.assert_query(provider, 'floor(cnt / 66.67) <= 2', [1, 2, 5])
self.assert_query(provider, 'ceil(cnt / 66.67) <= 2', [1, 5])
self.assert_query(provider, 'pk < pi() / 2', [1])
self.assert_query(provider, 'pk = char(51)', [3])
self.assert_query(provider, 'pk = coalesce(NULL,3,4)', [3])
self.assert_query(provider, 'lower(name) = \'apple\'', [2])
self.assert_query(provider, 'upper(name) = \'APPLE\'', [2])
self.assert_query(provider, 'name = trim(\' Apple \')', [2])

# geometry
# azimuth and touches tests are deactivated because they do not pass for WFS provider
@@ -155,6 +155,11 @@ def uncompiledFilters(self):
'floor(cnt / 66.67) <= 2',
'ceil(cnt / 66.67) <= 2',
'pk < pi() / 2',
'pk = char(51)',
'pk = coalesce(NULL,3,4)',
'lower(name) = \'apple\'',
'upper(name) = \'APPLE\'',
'name = trim(\' Apple \')',
'x($geometry) < -70',
'y($geometry) > 70',
'xmin($geometry) < -70',

0 comments on commit 57917ab

Please sign in to comment.
You can’t perform that action at this time.