Test the intersection of $tablesUsed with each set of tables
separately and only update it afterwards. Without this fix, overlaps
between the table groups would cause additional groups to be pulled in
unnecessarily.
Change-Id: I1b2a6eb47e061dee8a27fb4779809b4684c05104
];
$coreDBDataTables = array_merge( $userTables, $pageTables );
];
$coreDBDataTables = array_merge( $userTables, $pageTables );
- // If any of the user or page tables were marked as used, we should clear all of them.
+ // some groups of tables are connected such that if any is used, all should be cleared
+ $extraTables = [];
if ( array_intersect( $tablesUsed, $userTables ) ) {
if ( array_intersect( $tablesUsed, $userTables ) ) {
- $tablesUsed = array_unique( array_merge( $tablesUsed, $userTables ) );
+ $extraTables[] = $userTables;
+
TestUserRegistry::clear();
// Reset $wgUser, which is probably 127.0.0.1, as its loaded data is probably not valid
TestUserRegistry::clear();
// Reset $wgUser, which is probably 127.0.0.1, as its loaded data is probably not valid
$wgUser->clearInstanceCache( $wgUser->mFrom );
}
if ( array_intersect( $tablesUsed, $pageTables ) ) {
$wgUser->clearInstanceCache( $wgUser->mFrom );
}
if ( array_intersect( $tablesUsed, $pageTables ) ) {
- $tablesUsed = array_unique( array_merge( $tablesUsed, $pageTables ) );
+ $extraTables[] = $pageTables;
+ }
+ if ( $extraTables !== [] ) {
+ $tablesUsed = array_unique( array_merge( $tablesUsed, ...$extraTables ) );
}
// Postgres uses mwuser/pagecontent
}
// Postgres uses mwuser/pagecontent