Ticket #6382 (closed enhancement: wontfix)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: carstenklein@yahoo.de Assigned to: XayOn
Priority: normal Component: TicketBackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

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.

#10.

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

Change History

12/27/09 21:48:16 changed by carstenklein@yahoo.de

  • 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.

12/28/09 00:02:28 changed by carstenklein@yahoo.de

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.

02/26/10 18:35:14 changed by anonymous

  • status changed from new to closed.
  • resolution set to wontfix.

10/22/11 00:59:35 changed by lucasrangit

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


Add/Change #6382 (SQL Query fails to find shortcut ticket ids in case that there is no whitespace after the last digit)




Change Properties
Action