Skip to content

Commit 3df8c75

Browse files
committed
[mssql] Update list of uncompilable expressions
1 parent 8cad2a6 commit 3df8c75

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

tests/src/python/test_provider_mssql.py

+107
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,113 @@ def enableCompiler(self):
5757
def disableCompiler(self):
5858
QgsSettings().setValue('/qgis/compileExpressions', False)
5959

60+
def partiallyCompiledFilters(self):
61+
filters = set([
62+
'name ILIKE \'QGIS\'',
63+
'name = \'Apple\'',
64+
'name = \'apple\'',
65+
'name LIKE \'Apple\'',
66+
'name LIKE \'aPple\'',
67+
'name ILIKE \'aPple\'',
68+
'name ILIKE \'%pp%\'',
69+
'"name" || \' \' || "name" = \'Orange Orange\'',
70+
'"name" || \' \' || "cnt" = \'Orange 100\'',
71+
'"name"="name2"'
72+
])
73+
return filters
74+
75+
def uncompiledFilters(self):
76+
filters = set([
77+
'"name" IS NULL',
78+
'"name" IS NOT NULL',
79+
'"name" NOT LIKE \'Ap%\'',
80+
'"name" NOT ILIKE \'QGIS\'',
81+
'"name" NOT ILIKE \'pEAR\'',
82+
'name <> \'Apple\'',
83+
'"name" <> \'apple\'',
84+
'(name = \'Apple\') is not null',
85+
'\'x\' || "name" IS NOT NULL',
86+
'\'x\' || "name" IS NULL',
87+
'"name" ~ \'[OP]ra[gne]+\'',
88+
'pk = 9 // 4',
89+
'false and NULL',
90+
'true and NULL',
91+
'NULL and false',
92+
'NULL and true',
93+
'NULL and NULL',
94+
'false or NULL',
95+
'true or NULL',
96+
'NULL or false',
97+
'NULL or true',
98+
'NULL or NULL',
99+
'not null',
100+
'not name = \'Apple\'',
101+
'not name IS NULL',
102+
'not name = \'Apple\' or name = \'Apple\'',
103+
'not name = \'Apple\' or not name = \'Apple\'',
104+
'not name = \'Apple\' and pk = 4',
105+
'not name = \'Apple\' and not pk = 4',
106+
'sqrt(pk) >= 2',
107+
'radians(cnt) < 2',
108+
'degrees(pk) <= 200',
109+
'abs(cnt) <= 200',
110+
'cos(pk) < 0',
111+
'sin(pk) < 0',
112+
'tan(pk) < 0',
113+
'acos(-1) < pk',
114+
'asin(1) < pk',
115+
'atan(3.14) < pk',
116+
'atan2(3.14, pk) < 1',
117+
'exp(pk) < 10',
118+
'ln(pk) <= 1',
119+
'log(3, pk) <= 1',
120+
'log10(pk) < 0.5',
121+
'pk < pi()',
122+
'round(3.14) <= pk',
123+
'round(0.314,1) * 10 = pk',
124+
'floor(3.14) <= pk',
125+
'ceil(3.14) <= pk',
126+
'pk < pi()',
127+
'round(cnt / 66.67) <= 2',
128+
'floor(cnt / 66.67) <= 2',
129+
'ceil(cnt / 66.67) <= 2',
130+
'pk < pi() / 2',
131+
'pk = char(51)',
132+
'pk = coalesce(NULL,3,4)',
133+
'lower(name) = \'apple\'',
134+
'upper(name) = \'APPLE\'',
135+
'name = trim(\' Apple \')',
136+
'x($geometry) < -70',
137+
'y($geometry) > 70',
138+
'xmin($geometry) < -70',
139+
'ymin($geometry) > 70',
140+
'xmax($geometry) < -70',
141+
'ymax($geometry) > 70',
142+
'disjoint($geometry,geom_from_wkt( \'Polygon ((-72.2 66.1, -65.2 66.1, -65.2 72.0, -72.2 72.0, -72.2 66.1))\'))',
143+
'intersects($geometry,geom_from_wkt( \'Polygon ((-72.2 66.1, -65.2 66.1, -65.2 72.0, -72.2 72.0, -72.2 66.1))\'))',
144+
'contains(geom_from_wkt( \'Polygon ((-72.2 66.1, -65.2 66.1, -65.2 72.0, -72.2 72.0, -72.2 66.1))\'),$geometry)',
145+
'distance($geometry,geom_from_wkt( \'Point (-70 70)\')) > 7',
146+
'intersects($geometry,geom_from_gml( \'<gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-72.2,66.1 -65.2,66.1 -65.2,72.0 -72.2,72.0 -72.2,66.1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>\'))',
147+
'x($geometry) < -70',
148+
'y($geometry) > 79',
149+
'xmin($geometry) < -70',
150+
'ymin($geometry) < 76',
151+
'xmax($geometry) > -68',
152+
'ymax($geometry) > 80',
153+
'area($geometry) > 10',
154+
'perimeter($geometry) < 12',
155+
'relate($geometry,geom_from_wkt( \'Polygon ((-68.2 82.1, -66.95 82.1, -66.95 79.05, -68.2 79.05, -68.2 82.1))\')) = \'FF2FF1212\'',
156+
'relate($geometry,geom_from_wkt( \'Polygon ((-68.2 82.1, -66.95 82.1, -66.95 79.05, -68.2 79.05, -68.2 82.1))\'), \'****F****\')',
157+
'crosses($geometry,geom_from_wkt( \'Linestring (-68.2 82.1, -66.95 82.1, -66.95 79.05)\'))',
158+
'overlaps($geometry,geom_from_wkt( \'Polygon ((-68.2 82.1, -66.95 82.1, -66.95 79.05, -68.2 79.05, -68.2 82.1))\'))',
159+
'within($geometry,geom_from_wkt( \'Polygon ((-75.1 76.1, -75.1 81.6, -68.8 81.6, -68.8 76.1, -75.1 76.1))\'))',
160+
'overlaps(translate($geometry,-1,-1),geom_from_wkt( \'Polygon ((-75.1 76.1, -75.1 81.6, -68.8 81.6, -68.8 76.1, -75.1 76.1))\'))',
161+
'overlaps(buffer($geometry,1),geom_from_wkt( \'Polygon ((-75.1 76.1, -75.1 81.6, -68.8 81.6, -68.8 76.1, -75.1 76.1))\'))',
162+
'intersects(centroid($geometry),geom_from_wkt( \'Polygon ((-74.4 78.2, -74.4 79.1, -66.8 79.1, -66.8 78.2, -74.4 78.2))\'))',
163+
'intersects(point_on_surface($geometry),geom_from_wkt( \'Polygon ((-74.4 78.2, -74.4 79.1, -66.8 79.1, -66.8 78.2, -74.4 78.2))\'))'
164+
])
165+
return filters
166+
60167
# HERE GO THE PROVIDER SPECIFIC TESTS
61168
def testDateTimeTypes(self):
62169
vl = QgsVectorLayer('%s table="qgis_test"."date_times" sql=' %

0 commit comments

Comments
 (0)