Closed
Bug 429793
Opened 16 years ago
Closed 16 years ago
Bug in get_permissions causes all pages to break after cache clear
Categories
(support.mozilla.org :: Knowledge Base Software, task)
support.mozilla.org
Knowledge Base Software
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: oremj, Assigned: clouserw)
References
()
Details
(Whiteboard: sumo_only)
Attachments
(1 file)
943 bytes,
patch
|
oremj
:
review+
|
Details | Diff | Splinter Review |
When this function is called: tiki-setup_base.php Line 461: $allperms = $userlib->get_permissions(0, -1, 'permName_desc', '', ''); lib/userslib.php Line 1702: if ($type) { <- $type is '' $mid = ' where `type`= ? '; $values[] = $type; } else { <- runs this code // Mozilla opt: this index is not getting used // (and it should be; otherwise the order by uses filesort $mid = ' force index (permName) '; <- this sets up $mid } if ($mid) { <- $mid is set above or true $mid .= " and `permName` > ''"; <- $mid appends this } else { $mid .= " where `permName` > ''"; } Code ends up generating this query: select * from `users_permissions` force index (permName) and `permName` > '' order by `permName` desc; Which of course is invalid and ends up displaying an error on the front page.
Updated•16 years ago
|
OS: Mac OS X → All
Hardware: PC → All
Reporter | ||
Comment 1•16 years ago
|
||
Running svn blame it looks like the bug was introduced in revision 12313: 12313 lthomson@mozilla.com } else { 12313 lthomson@mozilla.com // Mozilla opt: this index is not getting used 12313 lthomson@mozilla.com // (and it should be; otherwise the order by uses filesort 12313 lthomson@mozilla.com $mid = ' force index (permName) '; 12313 lthomson@mozilla.com }
OS: All → Mac OS X
Hardware: All → PC
Assignee | ||
Comment 2•16 years ago
|
||
Sounds like the problem is we're putting stuff in $mid. Instead of overloading $mid, this patch adds a $bonus to the query.
Reporter | ||
Comment 3•16 years ago
|
||
Comment on attachment 316547 [details] [diff] [review] fix problem Looks like that would fix the problem.
Attachment #316547 -
Flags: review?(oremj) → review+
Comment 4•16 years ago
|
||
Comment on attachment 316547 [details] [diff] [review] fix problem >--- userslib.php 2008-04-16 12:45:39.000000000 -0700 >+++ userslib2.php 2008-04-18 23:21:55.000000000 -0700 >@@ -1699,13 +1699,14 @@ > $values = array(); > $sort_mode = $this->convert_sortmode($sort_mode); > $mid = ''; >+ $bonus = ''; Spaces vs. tabs.
Assignee | ||
Comment 5•16 years ago
|
||
r12400. Hopefully that variable isn't the straw that breaks this bloated camel's back.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
OS: Mac OS X → All
Hardware: PC → All
Comment 6•16 years ago
|
||
Thanks guys -- will figure out why this wasn't caught earlier.
Updated•15 years ago
|
Whiteboard: tiki_triage
Updated•15 years ago
|
Whiteboard: tiki_triage → sumo_triage
Updated•15 years ago
|
Whiteboard: sumo_triage → tiki_bug
Comment 7•15 years ago
|
||
Seems to be sumo-only from the discussion.
Whiteboard: tiki_bug → tiki_bug, sumo_triage
Comment 8•15 years ago
|
||
morgamic: anything here that should be upstreamed?
Whiteboard: tiki_bug, sumo_triage → sumo_triage, tiki_discuss
Updated•15 years ago
|
Whiteboard: sumo_triage, tiki_discuss → sumo_only
You need to log in
before you can comment on or make changes to this bug.
Description
•