Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#5564 closed defect (wontfix)

Dynamic variable parsing interferes with SQL function definition syntax

Reported by: Dave Abrahams <dave@…> Owned by: Jonas Borgström
Priority: normal Milestone:
Component: ticket system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I don't know if this is a PostGreSQL-specific issue or not, but in:

CREATE OR REPLACE FUNCTION xticket1(query_param TEXT)
   RETURNS SETOF tix
   AS
$foo$
  ...
$foo$

Trac incorrectly attempts to perform a dynamic variable substitution on $foo, which naturally fails.

The workaround I have, which seems to work, is to use $$ instead of $foo$. I'm too SQL-illiterate to know whether that's a serious limitation or not.

Attachments (0)

Change History (4)

comment:1 by Noah Kantrowitz, 17 years ago

Generally you wouldn't be making a stored procedure in the report itself, you would just be using it.

in reply to:  1 comment:2 by Dave Abrahams <dave@…>, 17 years ago

Replying to nkantrowitz:

Generally you wouldn't be making a stored procedure in the report itself, you would just be using it.

Yes, it's not the most common use case, but I needed it. You might consider checking for $<identifier>$<not-an-identifier> and avoiding expansion, though.

comment:3 by sid, 17 years ago

Having stored procedures within a report really seems to be an edge case. Propose closing this as wontfix.

comment:4 by Christian Boos, 17 years ago

Resolution: wontfix
Status: newclosed

… and apparently there's a workaround as you said (using $$), so that seems good enough.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.