Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1, 1.2.0-BETA2, 1.2.0-BETA3
-
Fix Version/s: 1.2.0-RC1
-
Component/s: Connection, Query
-
Labels:None
Description
Doctrine_Query::loadRoot() and Doctrine_Query::buildInheritanceJoinSql() have the following snippet of code:
// get the connection for the component $manager = Doctrine_Manager::getInstance(); if ($manager->hasConnectionForComponent($name)) { $this->_conn = $manager->getConnectionForComponent($name); }
Seems clear that here we would like to use the connection bound to the given component instead of default one. But if we explicitly pass a connection in (like Doctrine_Query::create($conn)), then this code will also overwrite it with bound connection, although passed connection should have higher priority than bound one.
I would like to prepare a patch, but I'm not absolutely sure, why we check for bound connection only inside loadRoot() and buildInheritanceJoinSql()?