From 990e9268e3f59ebebce2b933654672e591844e13 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 17 Sep 2019 19:22:51 -0700 Subject: [PATCH] objectcache: fix DatabaseSqlite::initSqliteDatabase() call location This should be called in the non-LB cause (e.g. custom DBs). Follow-up mishandled merge conflict in 3298a9db9021. Bug: T233117 Change-Id: I71a5c28db05a3c294e5c244037be2ee0209d61ad --- includes/objectcache/SqlBagOStuff.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index d713396b57..4a3445e935 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -194,6 +194,10 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $conn = Database::factory( $type, $info ); $conn->clearFlag( DBO_TRX ); // auto-commit mode $this->conns[$shardIndex] = $conn; + // Automatically create the objectcache table for sqlite as needed + if ( $conn->getType() === 'sqlite' ) { + $this->initSqliteDatabase( $conn ); + } } $conn = $this->conns[$shardIndex]; } else { @@ -206,10 +210,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $attribs = $lb->getServerAttributes( $lb->getWriterIndex() ); $flags = $attribs[Database::ATTR_DB_LEVEL_LOCKING] ? 0 : $lb::CONN_TRX_AUTOCOMMIT; $conn = $lb->getMaintenanceConnectionRef( $index, [], false, $flags ); - // Automatically create the objectcache table for sqlite as needed - if ( $conn->getType() === 'sqlite' ) { - $this->initSqliteDatabase( $conn ); - } } $this->logger->debug( sprintf( "Connection %s will be used for SqlBagOStuff", $conn ) ); -- 2.20.1