Doctrine 1
  1. Doctrine 1
  2. DC-437

Connection::query() can use wrong connection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None

      Description

      As I understand, Doctrine_Connection::query() method is intended to execute DQL queries using precisely this connection.
      But here is the code:

      894     public function query($query, array $params = array(), $hydrationMode = null)
      895     {
      896         $parser = Doctrine_Query::create();                                                                                
      897         $res = $parser->query($query, $params, $hydrationMode);
      898         $parser->free();
      899 
      900         return $res;
      901     }
      

      Doctrine_Query::create() statement will create a query that is using a default connection, not the current one.

      1. DC-437.patch
        0.5 kB
        Eugene Janusov
      2. DC437TestCase.php
        4 kB
        Eugene Janusov

        Activity

        Hide
        Eugene Janusov added a comment -

        Attached proposed patch.

        Show
        Eugene Janusov added a comment - Attached proposed patch.
        Hide
        Eugene Janusov added a comment - - edited

        Attached test case.

        Show
        Eugene Janusov added a comment - - edited Attached test case.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: