Index: branches/5.2.x/core/kernel/db/db_load_balancer.php =================================================================== diff -u -N -r16662 -r16710 --- branches/5.2.x/core/kernel/db/db_load_balancer.php (.../db_load_balancer.php) (revision 16662) +++ branches/5.2.x/core/kernel/db/db_load_balancer.php (.../db_load_balancer.php) (revision 16710) @@ -1,6 +1,6 @@ dbType = $db_type; - $this->errorHandler = $error_handler; + $this->setErrorHandler($error_handler); $this->DBClusterTimeout *= 1e6; // convert to milliseconds } @@ -879,4 +877,21 @@ return $conn->getSlaveLag(); } + + /** + * Sets an error handler. + * + * @param callable $error_handler Error handler. + * + * @return void + */ + public function setErrorHandler(callable $error_handler) + { + $this->errorHandler = $error_handler; + + foreach ( $this->connections as $connection ) { + $connection->setErrorHandler($error_handler); + } + } + } Index: branches/5.2.x/core/kernel/db/i_db_connection.php =================================================================== diff -u -N -r16662 -r16710 --- branches/5.2.x/core/kernel/db/i_db_connection.php (.../i_db_connection.php) (revision 16662) +++ branches/5.2.x/core/kernel/db/i_db_connection.php (.../i_db_connection.php) (revision 16710) @@ -259,4 +259,14 @@ * @access public */ public function getSlaveLag(); + + /** + * Sets an error handler. + * + * @param callable $error_handler Error handler. + * + * @return void + */ + public function setErrorHandler(callable $error_handler); + } Index: branches/5.2.x/core/units/helpers/deployment_helper.php =================================================================== diff -u -N -r16703 -r16710 --- branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16703) +++ branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16710) @@ -1,6 +1,6 @@ loadAppliedRevisions(); - $this->Conn->errorHandler = Array (&$this, 'handleSqlError'); + $this->Conn->setErrorHandler(array(&$this, 'handleSqlError')); $this->out('Verifying Database Revisions ... '); Index: branches/5.2.x/core/kernel/db/db_connection.php =================================================================== diff -u -N -r16662 -r16710 --- branches/5.2.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 16662) +++ branches/5.2.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 16710) @@ -1,6 +1,6 @@ serverIndex = $server_index; if ( !$error_handler ) { - $this->errorHandler = Array(&$this, 'handleError'); + $this->setErrorHandler(array(&$this, 'handleError')); } else { - $this->errorHandler = $error_handler; + $this->setErrorHandler($error_handler); } $this->_captureStatistics = defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !(defined('ADMIN') && ADMIN); @@ -932,6 +931,18 @@ return is_numeric($row['Seconds_Behind_Master']) ? $row['Seconds_Behind_Master'] : false; } + /** + * Sets an error handler. + * + * @param callable $error_handler Error handler. + * + * @return void + */ + public function setErrorHandler(callable $error_handler) + { + $this->errorHandler = $error_handler; + } + }