From c8b679135cc9c2936d66bf475b50dde8cd1e8fce Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 19 Jan 2006 03:55:03 +0000 Subject: [PATCH] Try the master if a blob is not found in the slave --- includes/ExternalStoreDB.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index 92026db010..4b16ab799e 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -79,7 +79,7 @@ class ExternalStoreDB { $ret =& $this->fetchBlob( $cluster, $id, $itemID ); - if ( $itemID !== false ) { + if ( $itemID !== false && $ret !== false ) { return $ret->getItem( $itemID ); } return $ret; @@ -104,7 +104,12 @@ class ExternalStoreDB { $dbr =& $this->getSlave( $cluster ); $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ) ); - if( $itemID !== false ) { + if ( $ret === false ) { + // Try the master + $dbw =& $this->getMaster( $cluster ); + $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ) ); + } + if( $itemID !== false && $ret !== false ) { // Unserialise object; caller extracts item $ret = unserialize( $ret ); } -- 2.20.1