[Rt-devel] BUG: Search Builder link searching

Todd Chapman todd at chaka.net
Tue Dec 6 15:17:30 EST 2005


On Tue, Dec 06, 2005 at 02:33:39PM -0500, Jesse Vincent wrote:
> 
> 
> 
> On Tue, Dec 06, 2005 at 03:10:24PM -0500, Todd Chapman wrote:
> > On Tue, Dec 06, 2005 at 03:05:33PM -0500, Todd Chapman wrote:
> > > MySQL Query:
> > > 
> > > SELECT COUNT(DISTINCT main.id) FROM Tickets main , Links Links_1  WHERE ((main.EffectiveId = main.id)) AND ((main.Status != 'deleted')) AND ((main.Type = 'ticket')) AND ( ( (Links_1.Type = 'RefersTo')AND(Links_1.LocalTarget = '2')AND(main.id = Links_1.LocalBase) ) )
> > 
> > And of course this one isn't right either if you have RTFM installed
> > and are looking for links to other tickets and not links to articles.
> 
> Why? Only Tickets should be using LocalBase and LocalTarget.

I didn't know that, and apparently neither does RTFM.

mysql> select * from Links where LocalTarget='2';

| 11495 | fsck.com-rt://gedasusa.com/ticket/13653 | fsck.com-rtfm://gedasusa.com/article/2 | RefersTo |           2 |     13653 |           158 | 2005-04-07 19:05:16 |     158 | 2005-04-07 19:05:16 |
| 11911 | fsck.com-rt://gedasusa.com/ticket/14068 | fsck.com-rtfm://gedasusa.com/article/2 | RefersTo |           2 |     14068 |           158 | 2005-04-14 15:11:40 |     158 | 2005-04-14 15:11:40 |
| 16512 | fsck.com-rt://gedasusa.com/ticket/18587 | fsck.com-rtfm://gedasusa.com/article/2 | RefersTo |           2 |     18587 |           158 | 2005-06-23 14:34:16 |     158 | 2005-06-23 14:34:16 |
| 16513 | fsck.com-rt://gedasusa.com/ticket/18787 | fsck.com-rtfm://gedasusa.com/article/2 | RefersTo |           2 |     18787 |           158 | 2005-06-23 14:34:38 |     158 | 2005-06-23 14:34:38 |
| 16514 | fsck.com-rt://gedasusa.com/ticket/18924 | fsck.com-rtfm://gedasusa.com/article/2 | RefersTo |           2 |     18924 |           158 | 2005-06-23 14:41:12 |     158 | 2005-06-23 14:41:12 |



More information about the Rt-devel mailing list