Modify ↓
#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: | 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 15 years ago by
Type: | defect → enhancement |
---|
comment:2 Changed 15 years ago by
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 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:4 Changed 13 years ago by
I applied the change from the description and it fixed my issues. Thanks!
Note: See
TracTickets for help on using
tickets.
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.