r106985 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106984‎ | r106985 | r106986 >
Date:21:54, 21 December 2011
Author:bsitu
Status:ok (Comments)
Tags:
Comment:
adding more condtions to the where clause to reduce table record scan
Modified paths:
  • /trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulItem.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulItem.php
@@ -264,8 +264,10 @@
265265 if ( $user ) {
266266 if ( $user->isAnon() ) {
267267 $conds['mah_user_ip'] = $user->getName();
 268+ $conds['mah_user_id'] = 0;
268269 } else {
269270 $conds['mah_user_id'] = $user->getId();
 271+ $conds[] = 'mah_user_ip IS NULL';
270272 }
271273 } else {
272274 // Invalid User object, we can't treat this user has marked an item

Follow-up revisions

RevisionCommit summaryAuthorDate
r107078follow up to -r106985 - Use assignment style for NULL value in where clausebsitu17:45, 22 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:18, 22 December 2011

$conds['mah_user_ip'] = null; should work too.

Status & tagging log