Ticket #953 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

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:
Platform Version: Platform: All
Must Fix for Release: No 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

  Changed 5 years ago by pcav

  • milestone set to Version 0.9.2

follow-up: ↓ 3   Changed 5 years ago by gjm

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   Changed 5 years ago by goyodiaz

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

  Changed 5 years ago by gjm

  • status changed from new to closed
  • resolution set to fixed

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

  Changed 4 years ago by anonymous

  • milestone Version 1.0.0 deleted

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.