[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Use %d to inject integer into SQL query

2017-05-31 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/353762 )

Change subject: Use %d to inject integer into SQL query
..


Use %d to inject integer into SQL query

The fact alone that an SQL query is constructed with sprintf() is
scary. This patch does not fix this, but it makes one detail less
scary.

Change-Id: Ic37fd259e591bd232818d049bae242927a864c68
---
M includes/ExternalDataRepo.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ExternalDataRepo.php b/includes/ExternalDataRepo.php
index bcc1eb1..29bf2ba 100644
--- a/includes/ExternalDataRepo.php
+++ b/includes/ExternalDataRepo.php
@@ -131,7 +131,7 @@
wfGetLBFactory()->waitForReplication();
$table = $db->tableName( self::TABLE_NAME );
$condition = 'dump_id = ' . $db->addQuotes( 
$dumpId );
-   $db->query( sprintf( 'DELETE FROM %s WHERE %s 
LIMIT %s', $table, $condition, $batchSize ) );
+   $db->query( sprintf( 'DELETE FROM %s WHERE %s 
LIMIT %d', $table, $condition, $batchSize ) );
} while ( $db->affectedRows() > 0 );
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/353762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic37fd259e591bd232818d049bae242927a864c68
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Use %d to inject integer into SQL query

2017-05-14 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353762 )

Change subject: Use %d to inject integer into SQL query
..

Use %d to inject integer into SQL query

The fact alone that an SQL query is constructed with sprintf() is
scary. This patch does not fix this, but it makes one detail less
scary.

Change-Id: Ic37fd259e591bd232818d049bae242927a864c68
---
M includes/ExternalDataRepo.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
 refs/changes/62/353762/1

diff --git a/includes/ExternalDataRepo.php b/includes/ExternalDataRepo.php
index bcc1eb1..29bf2ba 100644
--- a/includes/ExternalDataRepo.php
+++ b/includes/ExternalDataRepo.php
@@ -131,7 +131,7 @@
wfGetLBFactory()->waitForReplication();
$table = $db->tableName( self::TABLE_NAME );
$condition = 'dump_id = ' . $db->addQuotes( 
$dumpId );
-   $db->query( sprintf( 'DELETE FROM %s WHERE %s 
LIMIT %s', $table, $condition, $batchSize ) );
+   $db->query( sprintf( 'DELETE FROM %s WHERE %s 
LIMIT %d', $table, $condition, $batchSize ) );
} while ( $db->affectedRows() > 0 );
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/353762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic37fd259e591bd232818d049bae242927a864c68
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits