Bug report #14258

Line width size assistant fails to load values when column is name "LENGTH"

Added by Paolo Cavallini almost 5 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:22254

Description

The assistant fails to load values of a variable (length, real) from a particular layer.
Other variables (integers, strings) are loaded.

strade.zip (1.71 KB) Paolo Cavallini, 2016-02-09 05:27 AM

History

#1 Updated by Paolo Cavallini almost 5 years ago

#2 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback

it works if you use the same datatype but use a different column name... "LENGTH" looks like a reserved word.

#3 Updated by Paolo Cavallini almost 5 years ago

Good point. However, LENGTH is a valid column name in DBF, and I do not think we should impose additional limitations.

#4 Updated by Giovanni Manghi almost 5 years ago

  • OS version deleted (Sid)
  • Subject changed from Line width size assistant fails to load values to Line width size assistant fails to load values when column is name "LENGTH"
  • Status changed from Feedback to Open
  • Operating System deleted (Debian)

Paolo Cavallini wrote:

Good point. However, LENGTH is a valid column name in DBF, and I do not think we should impose additional limitations.

It is a bad practice anyway, I would not be contrary having QGIS not creating columns after any reserved word.

#5 Updated by Regis Haubourg almost 5 years ago

I think it is related to #14257. Can you test adding double quotes on field name "LENGTH" manually the size expression generated?

#6 Updated by Paolo Cavallini almost 5 years ago

I confirm that with quotes the expression is valid. I cannot check whether variable content is recognized.
I do not agree calling length (or area, etc.) is bad practice: field calc automatically add it.

#7 Updated by Regis Haubourg almost 5 years ago

Well, if postgres can be a reference implementation of SQL for us, user fields name is illegal as a SQL keyword when "user" is legal.
Can we just focus on QGIS quoting correctly field names with capitalized , special characters or reserved keywords ?

#8 Updated by Giovanni Manghi almost 5 years ago

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

duplicate of #14257

#9 Updated by Paolo Cavallini almost 5 years ago

  • Status changed from Closed to Reopened
  • Resolution deleted (duplicate)

Duplication is possible, but AFAIK not demonstrated. Better leave it open and close it after fix of #14257 and verification.

#10 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No
  • Regression? set to No

#11 Updated by Paolo Cavallini over 2 years ago

  • Status changed from Reopened to Closed
  • Description updated (diff)
  • Resolution set to fixed/implemented

Fixed now. Tested in QGIS 3.

Also available in: Atom PDF