hidebyothers was extremely slow (on large data sets) due to the
lack of an index on rc_user. To fix this, changed to use rc_user_text.
hidemyself seems to be fine (assuming normal usage patterns), but
to avoid edge cases and ensure full coverage, it's been changed as
well.
I'll inquire about adding an index for this.
Bug: T161557
Change-Id: I61efe11de12e8ab6c01e8d913cdeda471132a6ee
&$query_options, &$join_conds ) {
$user = $ctx->getUser();
&$query_options, &$join_conds ) {
$user = $ctx->getUser();
- if ( $user->getId() ) {
- $conds[] = 'rc_user != ' . $dbr->addQuotes( $user->getId() );
- } else {
- $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
- }
+ $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
},
'cssClassSuffix' => 'self',
'isRowApplicableCallable' => function ( $ctx, $rc ) {
},
'cssClassSuffix' => 'self',
'isRowApplicableCallable' => function ( $ctx, $rc ) {
&$query_options, &$join_conds ) {
$user = $ctx->getUser();
&$query_options, &$join_conds ) {
$user = $ctx->getUser();
- if ( $user->getId() ) {
- $conds[] = 'rc_user = ' . $dbr->addQuotes( $user->getId() );
- } else {
- $conds[] = 'rc_user_text = ' . $dbr->addQuotes( $user->getName() );
- }
+ $conds[] = 'rc_user_text = ' . $dbr->addQuotes( $user->getName() );
},
'cssClassSuffix' => 'others',
'isRowApplicableCallable' => function ( $ctx, $rc ) {
},
'cssClassSuffix' => 'others',
'isRowApplicableCallable' => function ( $ctx, $rc ) {
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
- "rc_user != '{$user->getId()}'",
+ "rc_user_text != '{$user->getName()}'",
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
- "rc_user = '{$user->getId()}'",
+ "rc_user_text = '{$user->getName()}'",
],
[
'hidebyothers' => 1,
],
[
'hidebyothers' => 1,
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
$user = $this->getTestUser()->getUser();
$this->assertConditions(
[ # expected
- "rc_user != '{$user->getId()}'",
- "rc_user = '{$user->getId()}'",
+ "rc_user_text != '{$user->getName()}'",
+ "rc_user_text = '{$user->getName()}'",