Doctrine 1
  1. Doctrine 1
  2. DC-261

Query overrwtires explicitly passed connection with bound one

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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()?

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Eugene Janusov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: