Bug report #9290
Join problems if filename contains dot
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||openSUSE||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||17901|
If a shapefile being joined has more then one dot in its name (e. g. oo.pp.shp) and it is joined to another SHP file layer (say, rr.shp) then the names of the joined attributes from oo.pp.shp will contain a dot (e. g. oo.pp_aa) which causes problems.
How to reproduce:
1. Open QGIS.
2. Add the files oo.pp.shp and rr.shp (in attachment) as vector layers to the project.
3. Right-click on rr.shp, choose Properties->Joins, Join with oo.pp.shp on field "id".
4. Right-click on rr.shp, choose Save as..., save as "rr2.shp".
5. Right-click on rr.shp, choose Properties->Style->Categorized, choose column oo.pp_aa, click "Classify", click OK.
Expected result: QGIS displays layer rr.shp with the given style.
Actual result: QGIS crashes.
6. Open QGIS again.
7. Add the file rr2.shp as vector layer to the project.
8. Right-click on rr2.shp, choose Filter..., set filter "id = 3", click OK.
Expected result: the filter selects the (only) point on the layer.
Actual result: an error message box appears: "An error occurred when executing the query. The data provider said: OGR3 error 1: Unrecognised field name oo.pp_aa."
At least the bug at point 8 stems from Bug #3030 which is actually a bug of OGR. Has it been reported to OGR? If it's hard to fix in OGR, QGIS should work around it by replacing dots in joined attributes with something else.
I am using openSUSE 13.1 and qgis-master 140102-1.1-x86_64 from the repository http://download.opensuse.org/repositories/Application:/Geo/openSUSE_13.1/ .
Fix #9290 (crashes in symbology on fields with special characters)
Fixes several crashes and problems with backwards compatibility.
Before expressions were allowed, field names were loaded and saved
unquoted, e.g. x.y - with introduction of expressions it was
necessary to use properly quoted "x.y" name so that expression
is correctly parsed. With these changes both options are possible
and when possible, the unquoted field name is used for compatibility
#1 Updated by Matthias Kuhn over 7 years ago
- Crashes QGIS or corrupts data changed from No to Yes
I have fixed an issue which masked the real issue and led to a memory leak in the categorized renderer. However, it does not solve the real issue.