Doctrine 1
  1. Doctrine 1
  2. DC-927

Query with left join and group clause returns only one row, even though there are multiple results

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Environment:
      Windows 7-64 bit
      Symfony 1.4.8

      Description

      under certain circumstances, Doctrine will only return one result out of a bunch of results, for example:

      $ symfony doctrine:dql "from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)"
      >> doctrine executing dql query
      DQL: from Tafel t, t.Reservering r where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, count(r.id) reserveringen group by date(t.tijd)
      found 2 results
      -
      date: '2010-11-14'
      tafels: '1'
      reserveringen: '1'

      Expected outcome:
      found 2 results
      -
      date: '2010-11-14'
      tafels: '1'
      reserveringen: '1'
      -
      date: '2010-11-16'
      tafels: '1'
      reserveringen: '0'

      The query works fine without the left join:
      $ symfony doctrine:dql "from Tafel t where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels group by date(t.tijd)"
      >> doctrine executing dql query
      DQL: from Tafel t where t.restaurant_id=4 select date(t.tijd), count(t.id) tafels, group by date(t.tijd)
      found 2 results
      -
      date: '2010-11-14'
      tafels: '1'
      -
      date: '2010-11-16'
      tafels: '1'

        Activity

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Bart van den Burg
          • Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: