Changes between Initial Version and Version 1 of Ticket #26898


Ignore:
Timestamp:
Jul 14, 2016, 12:08:06 PM (8 years ago)
Author:
Aur Saraf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26898 – Description

    initial v1  
    11Minimal repro: https://github.com/sonoflilit/django-count-bug
    22
    3 ```python
     3{{{
    44def test_bug(self):
    55    a = A.objects.create()
     
    1212    # 2?! It's clearly 1!
    1313    self.assertEquals(1, a.c_count)
    14 ```
     14}}}
    1515
    16 ```sql
     16{{{
    1717SELECT "bug_a"."id",
    1818       Count("bug_b"."id") AS "b_count",
     
    2424                    ON ( "bug_a"."id" = "bug_c"."a_id" )
    2525GROUP  BY "bug_a"."id"
    26 ```
     26}}}
    2727
    2828I think it should be:
    2929
    30 ```sql
     30{{{
    3131SELECT "bug_a"."id",
    3232       Count(distinct "bug_b"."id") AS "b_count",
     
    3838                    ON ( "bug_a"."id" = "bug_c"."a_id" )
    3939GROUP  BY "bug_a"."id"
    40 ```
     40}}}
    4141
    4242Reproduces on `sqlite3` as well as heroku-hosted `postgresql`.
Back to Top