aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2024-07-18 20:12:05 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2024-07-18 18:44:34 +0000
commitcfe48fc3ef37c1d31f668622c4190b2b2f20168e (patch)
tree4d8dd067fe7a373f1fbe97aca217a1e0cbbee316 /maintenance
parent98ebc56a12782668f2e2ab5bbc017342a6e54add (diff)
downloadmediawikicore-cfe48fc3ef37c1d31f668622c4190b2b2f20168e.tar.gz
mediawikicore-cfe48fc3ef37c1d31f668622c4190b2b2f20168e.zip
Use expression builder to avoid IDatabase::addQuotes
Bug: T361023 Change-Id: Ic28b548947894921134cbec0a7347e7e27e2aaf2
Diffstat (limited to 'maintenance')
-rw-r--r--maintenance/runBatchedQuery.php8
-rw-r--r--maintenance/updateRestrictions.php3
2 files changed, 5 insertions, 6 deletions
diff --git a/maintenance/runBatchedQuery.php b/maintenance/runBatchedQuery.php
index 0541d7295029..b52103e93cac 100644
--- a/maintenance/runBatchedQuery.php
+++ b/maintenance/runBatchedQuery.php
@@ -87,15 +87,15 @@ class RunBatchedQuery extends Maintenance {
if ( $res->numRows() ) {
$res->seek( $res->numRows() - 1 );
$row = $res->fetchObject();
- $end = $dbw->addQuotes( $row->$key );
- $selectConds = array_merge( $where, [ "$key > $end" ] );
- $updateConds = array_merge( $where, [ "$key <= $end" ] );
+ $end = $row->$key;
+ $selectConds = array_merge( $where, [ $dbw->expr( $key, '>', $end ) ] );
+ $updateConds = array_merge( $where, [ $dbw->expr( $key, '<=', $end ) ] );
} else {
$updateConds = $where;
$end = false;
}
if ( $prevEnd !== false ) {
- $updateConds = array_merge( [ "$key > $prevEnd" ], $updateConds );
+ $updateConds = array_merge( [ $dbw->expr( $key, '>', $prevEnd ) ], $updateConds );
}
$query = "UPDATE " . $dbw->tableName( $table ) .
diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php
index 4bd1122f02c7..b011539e9e34 100644
--- a/maintenance/updateRestrictions.php
+++ b/maintenance/updateRestrictions.php
@@ -58,7 +58,6 @@ class UpdateRestrictions extends Maintenance {
->select( 'MAX(page_id)' )
->from( 'page' )
->caller( __METHOD__ )->fetchField();
- $escapedEmptyBlobValue = $dbw->addQuotes( '' );
$batchMinPageId = 0;
@@ -71,7 +70,7 @@ class UpdateRestrictions extends Maintenance {
->select( [ 'page_id', 'page_restrictions' ] )
->from( 'page' )
->where( [
- "page_restrictions != $escapedEmptyBlobValue",
+ $dbw->expr( 'page_restrictions', '!=', '' ),
$dbw->expr( 'page_id', '>', $batchMinPageId ),
$dbw->expr( 'page_id', '<=', $batchMaxPageId ),
] )