Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-637

Many-to-many: Using Association Class (refclass) property in query adds leftJoin


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Query, Relations
    • Labels:
    • Environment:
      PHP 5.3.2 (cli) (built: Mar 4 2010 22:12:20)
      mysql 5.1.45


      When trying to use a refclass property - i.e. normalization table column - in a query, an unnecessary join is added to the query created, which is then used to "access" the property.

      This issue has already been discussed back in May 2008 but still seems to persist.
      Please see the google group discussion http://groups.google.com/group/doctrine-user/browse_thread/thread/c655832a450ccd1a/9cb6eca6ae1c3dee for example + comments.

      Unfortunately it is hardly possible to write a test case for this, as working SQL is generated, but the query is just not right (test case basically would have to assert the query string, wich does not make much sense).
      Another way to test if it does "what it should", could be to assert contents of $q->getTableAliasMap() - but does not seem ideal either.

      John Wage commented on this issue
      "Can you create a ticket for this with a failing test case? I believe this
      should be possible and we should investigate a fix for it.
      Thanks, Jon "


        There are no comments yet on this issue.


          • Assignee:
            guilhermeblanco Guilherme Blanco
            grass Pablo Grass
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: