Pass 1 always as string to IDatabase::select and friends
Column names or other sql fragments are strings, not integer Change-Id: I7950b6e7ce4fa3b97c8b8ed55c8d7d0119eaac7e
This commit is contained in:
parent
0958a0bce4
commit
92a0db8165
9 changed files with 13 additions and 13 deletions
|
|
@ -349,8 +349,8 @@ class Category {
|
|||
[ 'LOCK IN SHARE MODE' ]
|
||||
);
|
||||
// Get the aggregate `categorylinks` row counts for this category
|
||||
$catCond = $dbw->conditional( [ 'page_namespace' => NS_CATEGORY ], 1, 'NULL' );
|
||||
$fileCond = $dbw->conditional( [ 'page_namespace' => NS_FILE ], 1, 'NULL' );
|
||||
$catCond = $dbw->conditional( [ 'page_namespace' => NS_CATEGORY ], '1', 'NULL' );
|
||||
$fileCond = $dbw->conditional( [ 'page_namespace' => NS_FILE ], '1', 'NULL' );
|
||||
$result = $dbw->selectRow(
|
||||
[ 'categorylinks', 'page' ],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ class PageHistoryCountHandler extends SimpleHandler {
|
|||
'EXISTS(' .
|
||||
$dbr->selectSQLText(
|
||||
'user_groups',
|
||||
1,
|
||||
'1',
|
||||
[
|
||||
'actor.actor_user = ug_user',
|
||||
'ug_group' => $this->permissionManager->getGroupsWithPermission( 'bot' ),
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class PageHistoryHandler extends SimpleHandler {
|
|||
case 'bot':
|
||||
$cond[] = 'EXISTS(' . $dbr->selectSQLText(
|
||||
'user_groups',
|
||||
1,
|
||||
'1',
|
||||
[
|
||||
'actor_rev_user.actor_user = ug_user',
|
||||
'ug_group' => $this->permissionManager->getGroupsWithPermission( 'bot' ),
|
||||
|
|
@ -205,7 +205,7 @@ class PageHistoryHandler extends SimpleHandler {
|
|||
}
|
||||
$cond[] = 'EXISTS(' . $dbr->selectSQLText(
|
||||
'change_tag',
|
||||
1,
|
||||
'1',
|
||||
[ 'ct_rev_id = rev_id', 'ct_tag_id' => $tagIds ],
|
||||
__METHOD__
|
||||
) . ')';
|
||||
|
|
|
|||
|
|
@ -656,7 +656,7 @@ class PostgresInstaller extends DatabaseInstaller {
|
|||
*/
|
||||
$conn = $status->value;
|
||||
|
||||
$exists = $conn->selectField( '"pg_catalog"."pg_language"', 1,
|
||||
$exists = $conn->selectField( '"pg_catalog"."pg_language"', '1',
|
||||
[ 'lanname' => 'plpgsql' ], __METHOD__ );
|
||||
if ( $exists ) {
|
||||
// Already exists, nothing to do
|
||||
|
|
@ -667,7 +667,7 @@ class PostgresInstaller extends DatabaseInstaller {
|
|||
// should be able to create it
|
||||
$exists = $conn->selectField(
|
||||
[ '"pg_catalog"."pg_class"', '"pg_catalog"."pg_namespace"' ],
|
||||
1,
|
||||
'1',
|
||||
[
|
||||
'pg_namespace.oid=relnamespace',
|
||||
'nspname' => 'pg_catalog',
|
||||
|
|
|
|||
|
|
@ -1236,7 +1236,7 @@ SQL;
|
|||
* @return bool
|
||||
*/
|
||||
public function roleExists( $roleName ) {
|
||||
$exists = $this->selectField( '"pg_catalog"."pg_roles"', 1,
|
||||
$exists = $this->selectField( '"pg_catalog"."pg_roles"', '1',
|
||||
[ 'rolname' => $roleName ], __METHOD__ );
|
||||
|
||||
return (bool)$exists;
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ class WikiPage implements Page, IDBAccessObject {
|
|||
} else {
|
||||
// NOTE: keep in sync with RevisionRenderer::getLinkCount
|
||||
// NOTE: keep in sync with DerivedPageDataUpdater::isCountable
|
||||
$hasLinks = (bool)wfGetDB( DB_REPLICA )->selectField( 'pagelinks', 1,
|
||||
$hasLinks = (bool)wfGetDB( DB_REPLICA )->selectField( 'pagelinks', '1',
|
||||
[ 'pl_from' => $this->getId() ], __METHOD__ );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ class DeduplicateArchiveRevId extends LoggedUpdateMaintenance {
|
|||
// to try to prevent deletions or undeletions from confusing things.
|
||||
$dbw->selectRowCount(
|
||||
'archive',
|
||||
1,
|
||||
'1',
|
||||
[ 'ar_rev_id >= ' . (int)$id, 'ar_rev_id <= ' . (int)$endId ],
|
||||
__METHOD__,
|
||||
[ 'FOR UPDATE' ]
|
||||
);
|
||||
$dbw->selectRowCount(
|
||||
'revision',
|
||||
1,
|
||||
'1',
|
||||
[ 'rev_id >= ' . (int)$id, 'rev_id <= ' . (int)$endId ],
|
||||
__METHOD__,
|
||||
[ 'LOCK IN SHARE MODE' ]
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ class MigrateActors extends LoggedUpdateMaintenance {
|
|||
|
||||
$anyBad = $dbw->selectField(
|
||||
'log_search',
|
||||
1,
|
||||
'1',
|
||||
[ 'ls_field' => 'target_author_actor', 'ls_value' => '' ],
|
||||
__METHOD__,
|
||||
[ 'LIMIT' => 1 ]
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class TrackBlobs {
|
|||
|
||||
// Scan for HistoryBlobStub objects in the text table (T22757)
|
||||
|
||||
$exists = $dbr->selectField( 'text', 1,
|
||||
$exists = $dbr->selectField( 'text', '1',
|
||||
'old_flags LIKE \'%object%\' AND old_flags NOT LIKE \'%external%\' ' .
|
||||
'AND LOWER(CONVERT(LEFT(old_text,22) USING latin1)) = \'o:15:"historyblobstub"\'',
|
||||
__METHOD__
|
||||
|
|
|
|||
Loading…
Reference in a new issue