#953 closed bug (fixed)
Actions fail getting columns with digits in their name
Reported by: | goyodiaz | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | Vectors | Version: | 0.9.1 |
Keywords: | actions | Cc: | |
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
Having real columns named like col1 and col10, %col10 gets the value of col1 and appends a '0'.
Detailed steps:
Create a point shapefile with two columns of tipe Real, named col1 and col10 (only the digits are relevant).
Create a point in that layer and give value 1 to col1 and 2 to col10.
Create an action for the layer, something like:
bash -c echo %col10
Identify the created point end execute the action. You get 10, this is the value of col1 plus a '0' appened.
Using binaries from the web in Ubuntu 7.10 (0.9.2 RC1) and Windows XP (0.9.1)
Change History (5)
comment:1 by , 16 years ago
Milestone: | → Version 0.9.2 |
---|
follow-up: 3 comment:2 by , 16 years ago
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r9014. Use square brackets around the field name to delimit it if necessary. For example, using [%col10] will prevent the %col10 field being treated as the %col1 field with a trailing 0. The user documentation has been updated (in r9015) to reflect this change. Use a second set of square brackets if you actually want square brackets around the substituted field (e.g., %col10 will yield [abcd] if %col10='abcd').
The bug is not to do with column names with digits in their name, but rather having column names that are a substring of another.
How to deal with this? One could require each column name to be delimited by spaces (e.g., %col1 %col10 ). However this then prevents things like this: %colA_%colB, which can be quite useful. The algorithm that does the substitution is quite simple. Perhaps the ability to optionally quote column names would be enough to cope with the problem that causes this bug report?