Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#6382 closed enhancement (wontfix)

SQL Query fails to find shortcut ticket ids in case that there is no whitespace after the last digit

Reported by: carstenklein@… Owned by: XayOn
Priority: normal Component: TicketBackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11


For example, the following is a valid shortcut reference to ticket number 10.
However, since the last digit is directly followed by a non whitespace character,
the macro will not find the reference.


The incorrect part of the query is

sql += 'OR w1.text LIKE \'%%#%s %%\' )' % thispage

It should read

sql += 'OR w1.text LIKE \'%%#%s%%\' )' % thispage

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by carstenklein@…

  • Type changed from defect to enhancement

I just noticed that you use this in order to circumvent the fact that %%#%s%% will also find #77 when searching for #7.

I am currently working on something that is using REGEXP instead. However, it seems that SQLITE quite frequently calls the user provided function during a single query.
In case of the queries in the macro, it will be called >100 times per ticket or page found. Why this is so I do not fully understand right now. When I run the queries manually, the result set does not contain any duplicates.

In addition, using a user defined REGEXP() function will require changes to the sqlite_backend that is included with trac. And, I presume that the changes to the backend will not be integrated concerning the above described behaviour of SQLITE.

comment:2 Changed 5 years ago by carstenklein@…

See issue #6383 for a corrected version of the query incl. also a small enhancement that will also search the ticket comments and descriptions for links to a ticket.

comment:3 Changed 5 years ago by anonymous

  • Resolution set to wontfix
  • Status changed from new to closed

comment:4 Changed 3 years ago by lucasrangit

I applied the change from the description and it fixed my issues. Thanks!

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.