[Solar-svn] Revision 3299

pmjones at solarphp.com pmjones at solarphp.com
Thu Jul 31 17:35:18 CDT 2008


Solar_Sql_Adapter_MysqlReplicated: [FIX] In _prepare(), make sure config is available to the catch() block.


Modified: trunk/Solar/Sql/Adapter/MysqlReplicated.php
===================================================================
--- trunk/Solar/Sql/Adapter/MysqlReplicated.php	2008-07-31 22:28:38 UTC (rev 3298)
+++ trunk/Solar/Sql/Adapter/MysqlReplicated.php	2008-07-31 22:35:18 UTC (rev 3299)
@@ -360,14 +360,13 @@
         try {
             if ($is_select) {
                 // slave
+                $config = $this->_slaves[$this->_slave_key];
                 $this->connect();
-                $key = $this->_slave_key;
-                $config = $this->_slaves[$key];
                 $prep = $this->_pdo->prepare($stmt);
             } else {
                 // master
-                $this->connectMaster();
                 $config = $this->_config;
+                $this->connectMaster();
                 $prep = $this->_pdo_master->prepare($stmt);
             }
         } catch (PDOException $e) {




More information about the Solar-svn mailing list