[rt-users] Problematic Search/Display Query

Curtis Bruneau curtisb at vianet.ca
Fri Jul 18 14:04:19 EDT 2008


To add detail to my issue it seems to only happen when clicking from a 
Search/Results.html link, but it doesn't appear to be referrer based 
because if you turn them off it still happens, which makes me think it's 
possibly a session variable that's triggering it? Refreshes or direct 
url doesn't do it either.. for example here is the query output when 
clicking from the search results with surrounding queries.. They may be 
from tickets but the behavior is the same.

233 Query       SELECT ACL.id, ACL.ObjectType, ACL.ObjectId FROM ACL, 
Principals, CachedGroupMembers WHERE (ACL.RightName = 'SuperUser' OR 
ACL.RightName = 'ShowTicketComments') AND Principals.id = 
ACL.PrincipalId AND Principals.PrincipalType = 'Group' AND 
Principals.Disabled = 0 AND CachedGroupMembers.GroupId  = 
ACL.PrincipalId AND CachedGroupMembers.GroupId  = Principals.id AND 
CachedGroupMembers.MemberId = 12 AND CachedGroupMembers.Disabled = 0  
AND ((ACL.ObjectType = 'RT::System' AND ACL.ObjectId = 1) OR 
(ACL.ObjectType = 'RT::Queue' AND ACL.ObjectId = 1) OR (ACL.ObjectType = 
'RT::Ticket' AND ACL.ObjectId = 3)) LIMIT 1
233 Query       SELECT main.* FROM Tickets main  WHERE (main.Status != 
'deleted') AND ( ( main.Subject LIKE '%e%' ) ) AND (main.Effecti
veId = main.id) AND (main.Type = 'ticket')  ORDER BY main.id ASC
33 Query       SELECT  * FROM Users WHERE id = '12'

And this is what happens from anywhere else, the query is missing and 
working as intended.

245 Query       SELECT ACL.id, ACL.ObjectType, ACL.ObjectId FROM ACL, 
Principals, CachedGroupMembers WHERE (ACL.RightName = 'SuperUser' OR 
ACL.RightName = 'ShowTicketComments') AND Principals.id = 
ACL.PrincipalId AND Principals.PrincipalType = 'Group' AND 
Principals.Disabled = 0 AND CachedGroupMembers.GroupId  = 
ACL.PrincipalId AND CachedGroupMembers.GroupId  = Principals.id AND 
CachedGroupMembers.MemberId = 12 AND CachedGroupMembers.Disabled = 0  
AND ((ACL.ObjectType = 'RT::System' AND ACL.ObjectId = 1) OR 
(ACL.ObjectType = 'RT::Queue' AND ACL.ObjectId = 1) OR (ACL.ObjectType = 
'RT::Ticket' AND ACL.ObjectId = 2)) LIMIT 1
245 Query       SELECT  * FROM Users WHERE id = '12'


Does anyone have any idea how to fix this? Is this suppose to happen? 
Any kind of confirmation would be great.

Curtis

Curtis Bruneau wrote:
> Just an update, I have reinstalled the machine in attempt to solve 
> this problem, I am using etch packaged apache2+mod_perl2 and mysql5 
> and the problem still occurs,  here is a trimmed sql output from a 
> Ticket/Display.html?id=x, attached is the full log for that one page 
> view.
>
> 233 Query       SELECT  * FROM Tickets WHERE id = '3' <- The query 
> which gets the ticket details.
> 233 Query       SELECT main.* FROM Tickets main  WHERE (main.Status != 
> 'deleted') AND ( ( main.Subject LIKE '%e%' ) ) AND (main.Effecti
> veId = main.id) AND (main.Type = 'ticket')  ORDER BY main.id ASC <- 
> the problem query derived from search criteria with no limit.
>
> Anyone know what it's used for? It's a dangerous query with 
> potentially large results. *Can anyone confirm if this happens to them?*
>
> I tried to use as many packages as possible that reasonably met the 
> version requirements, the others were done from source. make testdeps 
> comes back fine, I attempted to upgrade to the latest versions for 
> modules that could be related to the db/query. The module versions are 
> also attached.
>
> Thanks



More information about the rt-users mailing list