Bug report #17423
QGIS select by expression mismatch with MSSQL layers
|Affected QGIS version:||2.18.14||Regression?:||No|
|Operating System:||Windows 7 Enterprise - 32 bit||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||no timely feedback|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25320|
When trying to select features using "select by expression", QGIS did select a wrong feature in this case.
I tried on two different days, same result (so I have restarted the PC and QGIS).
- Load a layer and select it to use select by expression
- Made sure that no features are selected in any layer
- Clicked the select by expression button from the toolbar
- Put in a very simple criteria: "matrikelnummer" = '10ae'
- Clicked select/vælg (see Screenshot_1.png)
- In Screenshot_2.png you can see which features QGIS selected in the opened attribute table. As you can see, feature with ID = 8337 (or just line 43) is selected. This should not be selected, because '10ae' != '10an'
- Instead it should have selected line 24 (ID = 8339), because as you can see that have '10ae' as the "matrikelnummer"
- I also tried to resize the window to see if it was a graphical glitch, no luck.
What i did to further test expressions was:
- Deselect all features
- Opened up the layer's filter and tested the expression. Correctly returned 2 rows as you can see on Screenshot_3.png
- Applied the filter and opened the attribute table. As you can see on Screenshot_4.png the correct features is viewed.
- The layer is calld Hovedejer matrikel
- MSSQL spatial data provider
- Polygon (WKB type: "Polygon")
- character encoding infomation not available, but since æ, ø, å is displayed correctly, I would guess that it's one that follows this standard: https://en.wikipedia.org/wiki/ISO/IEC_8859-1#Similar_character_sets
- Interestingly nothing is shown in the layer properties window under "Data Source Encoding", and I'm not able to select any option (there is none).
- I think the layer is provided by a Microsoft server