Yaron Koren has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/405011 )
Change subject: Fix for 3a2c71e36276 - fix if DB prefix exists
......................................................................
Fix for 3a2c71e36276 - fix if DB prefix exists
Replaced "UPDATE" queries with calls to $dbw->update()
Change-Id: I3b19b6e50a8e6e923ad58318b2bdb2001db8d477
---
M specials/CargoSwitchTable.php
1 file changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo
refs/changes/11/405011/2
diff --git a/specials/CargoSwitchTable.php b/specials/CargoSwitchTable.php
index 01ff625..e05bea9 100644
--- a/specials/CargoSwitchTable.php
+++ b/specials/CargoSwitchTable.php
@@ -66,14 +66,13 @@
$dbw = wfGetDB( DB_MASTER );
$dbw->delete( 'cargo_tables', array( 'main_table' => $mainTable
) );
$dbw->delete( 'cargo_pages', array( 'table_name' => $mainTable
) );
- $dbw->query( 'UPDATE cargo_tables SET main_table = \'' .
$mainTable . '\' WHERE main_table = \'' . $mainTable . '__NEXT\'' );
+ $dbw->update( 'cargo_tables', array( 'main_table' => $mainTable
), array( 'main_table' => $mainTable . '__NEXT' ) );
$origFieldTableNames = array();
foreach ( $fieldTables as $fieldTable ) {
$origFieldTableNames[] = str_replace( '__NEXT', '',
$fieldTable );
}
- $dbw->query( 'UPDATE cargo_tables SET field_tables = \'' .
serialize( $origFieldTableNames ) . '\' WHERE main_table = \'' .
- $mainTable . '\'' );
- $dbw->query( 'UPDATE cargo_pages SET table_name = \'' .
$mainTable . '\' WHERE table_name = \'' . $mainTable . '__NEXT\'' );
+ $dbw->update( 'cargo_tables', array( 'field_tables' =>
serialize( $origFieldTableNames ) ), array( 'main_table' => $mainTable ) );
+ $dbw->update( 'cargo_pages', array( 'table_name' => $mainTable
), array( 'table_name' => $mainTable . '__NEXT' ) );
}
function execute( $subpage = false ) {
--
To view, visit https://gerrit.wikimedia.org/r/405011
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b19b6e50a8e6e923ad58318b2bdb2001db8d477
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits