Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/98254
Change subject: UserArray: Avoid * and double keys in select
......................................................................
UserArray: Avoid * and double keys in select
Use User::selectFields to get all fields instead of *,
also use array_unqiue to make the sql nicer by having only single value
in the IN statement.
Change-Id: I0a4888be20f84f2955e82ced621aed526cc83f20
---
M includes/UserArray.php
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/54/98254/1
diff --git a/includes/UserArray.php b/includes/UserArray.php
index 1f55ef3..9709857 100644
--- a/includes/UserArray.php
+++ b/includes/UserArray.php
@@ -47,8 +47,12 @@
return new ArrayIterator( array() );
}
$dbr = wfGetDB( DB_SLAVE );
- $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ),
- __METHOD__ );
+ $res = $dbr->select(
+ 'user',
+ User::selectFields(),
+ array( 'user_id' => array_unique( $ids ) ),
+ __METHOD__
+ );
return self::newFromResult( $res );
}
--
To view, visit https://gerrit.wikimedia.org/r/98254
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a4888be20f84f2955e82ced621aed526cc83f20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits