Opened 14 years ago

#3465 new defect

Regular expression conficts with column name in EXPRESSION

Reported by: szigeti Owned by: sdlime
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords: regex, expression, column name
Cc:

Description

I don't know all the concept of EXPRESSION, but until now I was able to define regex match with it, e.g.:

    CLASS
      EXPRESSION (("[name_ref]" =~ /^[0-9]*$/) AND (length("[name_ref]")<3))
      [...]
    END

worked fine and filtered the rows where [name_ref] was a number below 100. Now the postgresql interface searched for a column named 0-9.

So, defining a column with "[col_name]" instead of [col_name] was satisfying for me, whereas the current behaviour of expression handling disables the usage of regular expression with alternative ([abc]) or exceptional ([^abc]) chars.

An ultimate solution for this problem would be a well defined and documented escaping strategy for

  • column names
  • regular expression
  • constant matches
  • functions

Anyway, the attached small patch brings back the "old behaviour", parsing column names only between "[ and ]".

Attachments (1)

regex_conflict_column.patch (731 bytes ) - added by szigeti 14 years ago.

Download all attachments as: .zip

Change History (1)

by szigeti, 14 years ago

Attachment: regex_conflict_column.patch added
Note: See TracTickets for help on using tickets.