Modify

Opened 14 years ago

Closed 14 years ago

Last modified 12 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: David Francos Cuartero
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 (0)

Change History (4)

comment:1 Changed 14 years ago by carstenklein@…

Type: defectenhancement

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 14 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 14 years ago by anonymous

Resolution: wontfix
Status: newclosed

comment:4 Changed 12 years ago by Lucas Rangit MAGASWERAN

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain David Francos Cuartero.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.