Merge "Use string cast for Postgres compatibility"

This commit is contained in:
jenkins-bot 2019-04-11 21:50:06 +00:00 committed by Gerrit Code Review
commit ca6ef32a69
3 changed files with 6 additions and 5 deletions

View file

@ -97,11 +97,12 @@ class ApiQueryAbuseLog extends ApiQueryBase {
$this->addFieldsIf( 'afl_actions', $fld_result );
$this->addFieldsIf( 'afl_wiki', $fld_wiki );
$db = $this->getDB();
if ( $fld_filter ) {
$this->addTables( 'abuse_filter' );
$this->addFields( 'af_public_comments' );
$this->addJoinConds( [ 'abuse_filter' => [ 'LEFT JOIN',
'af_id=afl_filter' ] ] );
$db->buildStringCast( 'af_id' ) . '=afl_filter' ] ] );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );

View file

@ -45,7 +45,7 @@ class AbuseLogPager extends ReverseChronologicalPager {
[ 'abuse_filter' =>
[
'LEFT JOIN',
'af_id=afl_filter',
$this->mDb->buildStringCast( 'af_id' ) . '=afl_filter',
],
],
];

View file

@ -320,7 +320,7 @@ class SpecialAbuseLog extends SpecialPage {
[ 'afl_id' => $id ],
__METHOD__,
[],
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
);
if ( !$row ) {
@ -572,7 +572,7 @@ class SpecialAbuseLog extends SpecialPage {
[ 'afl_id' => $id ],
__METHOD__,
[],
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
);
$error = null;
@ -707,7 +707,7 @@ class SpecialAbuseLog extends SpecialPage {
[ 'afl_id' => $id ],
__METHOD__,
[],
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
);
$error = null;