Bug report #10115

columns with a "%" in their name can cause crash and/or problems with symbology

Added by Dave Morgan about 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Vectors
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

Description

new description:
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).

old description:
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

PembsEDs.zip - data from SQL server table in shapefile form (2.21 MB) Dave Morgan, 2014-04-25 01:17 AM

WardHHSpace.csv Magnifier - csv file to join (2.66 KB) Dave Morgan, 2014-04-25 01:17 AM

PembsEDs.txt Magnifier - create table statement for sql server table (859 Bytes) Dave Morgan, 2014-04-25 01:17 AM

Associated revisions

Revision 2ffe3ce3
Added by Nathan Woodrow almost 10 years ago

Clean up MS SQL iterator. Fix #10115 - Fix crash on join

History

#1 Updated by Giovanni Manghi about 10 years ago

  • Priority changed from Normal to High
  • Category set to Data Provider/MSSQL

#2 Updated by Nathan Woodrow almost 10 years ago

  • Status changed from Open to Feedback
  • Assignee set to Nathan Woodrow
  • Target version set to Version 2.4

Can you confirm this is still a issue using the latest nightly build?

#3 Updated by Anonymous almost 10 years ago

  • Status changed from Feedback to Closed

#4 Updated by Dave Morgan almost 10 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 10 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 (Windows)
  • 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.

#6 Updated by Dave Morgan almost 10 years ago

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!
Dave

#7 Updated by Giovanni Manghi almost 10 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 (Nathan Woodrow)
  • Target version deleted (Version 2.4)

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!
Dave

QGIS should not crash, but we must admit that having a "%" in column name seems an edge case.

#8 Updated by Giovanni Manghi over 9 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

Closing this in favor of #11201 as it has a more general description.

Also available in: Atom PDF