Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#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 pcav, 16 years ago

Milestone: Version 0.9.2

comment:2 by gjm, 16 years ago

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?

in reply to:  2 comment:3 by goyodiaz, 16 years ago

I think any form of explicit delimitation of column names would be OK.

comment:4 by gjm, 16 years ago

Resolution: fixed
Status: newclosed

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').

comment:5 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.