Bug report #10115
columns with a "%" in their name can cause crash and/or problems with symbology
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||18580|
If a column of a joined table has a "%" in its name, using it for the symbology can lead to wrong results (categorized) or even crashes (graduated).
When I join an attribute only csv file (loaded using the 'Add delimited text layer' button) to a SQL Server spatial table, the identify tool works, displaying the original and joined fields, but when I attempt to open the attribute table, or apply a categorised or graduated style based on a joined field QGIS crashes. The SQL server table has 60 features of type Multipolygon. Occurs in QGIS versions 2.0.1 and 2.2.0, running on Windows XP and 7. I've attached a shapefile copied from the SQL server spatial table, a csv file I tried to join and a text file containing the create table DDL for the SQL server table
#4 Updated by Dave Morgan almost 6 years ago
- Status changed from Closed to Reopened
Just checked this in the weekly release candidate (9 June 2014). Now when I create a join the attribute table will open without causing a crash, and I can create categorised and graduated styles on fields in the original (spatial) table without a problem. I can also create categorised and graduated styles on the joined fields if the data type is text or integer. However, when I try to create a categorised style on a field with data type double, QGIS doesn't crash but the map is rendered as a single colour (though the legend shows the categorisation correctly). When I try to create a graduated style on the same double field QGIS crashes. When I checked the data, one of the data values in the double field had rounded to an integer. I tried changing this to have something to the right of the decimal point, but it made no difference, trying to create a graduated style on the field cause a crash.
Thanks & best wishes, Dave
#5 Updated by Giovanni Manghi almost 6 years ago
- Status changed from Reopened to Feedback
- Affected QGIS version changed from 2.2.0 to master
- OS version deleted (
XP and 7)
- Operating System deleted (
- Category changed from Data Provider/MSSQL to Vectors
- Subject changed from Joining csv to MS SQL Server table causes crash to Joining csv to table causes crash
I just tested using your data, but using/importing the vector into PostGIS: it happens the same, but the culprit seems to be the "%" in the name of the (double) column used to crated the symbology.
If you remove the "%" from column name them it all works as expected with no crash.
#7 Updated by Giovanni Manghi almost 6 years ago
- Subject changed from Joining csv to table causes crash to columns with a "%" in their name can cause crash and/or problems with symbology
- Status changed from Feedback to Open
- Assignee deleted (
- Target version deleted (
Dave Morgan wrote:
Thanks Giovanni, - removing the % character also works for me on SQL server. It's probably good practice to avoid characters like % in field names anyway!
QGIS should not crash, but we must admit that having a "%" in column name seems an edge case.