Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2013-08-19 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
-+-
 Reporter:  Alex |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Anssi Kääriäinen ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"630b9df42f771e90d9beb1766d4e7aa2107bd82d"]:
 {{{
 #!CommitTicketReference repository=""
 revision="630b9df42f771e90d9beb1766d4e7aa2107bd82d"
 Fixed #12567 -- Incorrect SQL in model inheritance case

 An isnull lookup produced incorrect SQL. This was already fixed
 earlier, so only tests added.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.a272d99b43b0be78f38061df547cb14c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2011-04-15 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
-+-
   Reporter:  Alex   |Owner:  nobody
   Type:  Bug|   Status:  reopened
  Milestone: |Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  1  |  Needs tests:  0
-+-
Changes (by julien):

 * needs_better_patch:  0 => 1


Comment:

 The tests would need to be rewritten using unittests since this is now
 Django's preferred way.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2011-04-01 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
-+-
   Reporter:  Alex   |Owner:  nobody
   Type:  Bug|   Status:  reopened
  Milestone: |Component:  Database layer
Version:  SVN|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  0  |  Needs tests:  0
-+-
Changes (by mattmcc):

 * type:   => Bug
 * severity:   => Normal
 * milestone:  1.3 =>


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-09-29 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.3   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by vzima):

 * cc: vzima (added)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-03-10 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.3   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * milestone:  1.2 => 1.3

Comment:

 There's a lot of similarity here with #12153; I don't think it's the same
 problem, but it's in a very similar area.

 Either way, Not critical for 1.2

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-02-22 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by coleifer):

 Alex pointed out that switching the promote_alias_chain bit to promote all
 isnull lookups would have a bad effect on queries, as isnull=False is way
 fast on an inner join.  I poked around in trim_joins() and special-cased
 the break in the while loop, but ended up with some failing regressions
 tests generally when Q objects and pipes were used with querysets.

 I ended up by choosing to skip the trim_joins() step altogether if it was
 an isnull=False lookup with joins.  All tests are passing, including the
 one alex provided, and as you can see, the joins are being evaluated
 correctly:

 {{{
 In [10]: A.objects.exclude(b=None)
 Out[10]: []

 In [11]: connection.queries.pop()
 Out[11]:
 {'sql': u'SELECT "test_app_a"."id", "test_app_a"."a_field" FROM
 "test_app_a" WHERE NOT ("test_app_a"."id" IN (SELECT U0."id" FROM
 "test_app_a" U0 LEFT OUTER JOIN "test_app_b" U1 ON (U0."id" =
 U1."a_ptr_id") WHERE U1."a_ptr_id" IS NULL)) LIMIT 21',
  'time': '0.000'}

 In [12]: A.objects.filter(b__isnull=False)
 Out[12]: []

 In [13]: connection.queries.pop()
 Out[13]:
 {'sql': u'SELECT "test_app_a"."id", "test_app_a"."a_field" FROM
 "test_app_a" INNER JOIN "test_app_b" ON ("test_app_a"."id" =
 "test_app_b"."a_ptr_id") WHERE "test_app_b"."a_ptr_id" IS NOT NULL LIMIT
 21',
  'time': '0.000'}
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-02-22 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by coleifer):

  * has_patch:  0 => 1

Comment:

 So there is a bit in the query's add_filter() method that blocks join
 promotion if value != True.  value == False seems like a valid expression,
 as the above example illustrates, so I simply removed that clause.  I
 included Alex's test case in the diff.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-02-22 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by coleifer):

 For reference, this is the SQL generated by the two operations:
 {{{
 A.objects.filter(b__isnull=False)
 SELECT "test_app_a"."id", "test_app_a"."a_field"
 FROM "test_app_a"
 WHERE "test_app_a"."id" IS NOT NULL
 LIMIT 21

 A.objects.exclude(b=None)
 SELECT "test_app_a"."id", "test_app_a"."a_field"
 FROM "test_app_a"
 WHERE
 NOT (
 "test_app_a"."id" IN (
 SELECT U0."id" FROM "test_app_a" U0
 LEFT OUTER JOIN "test_app_b" U1
 ON (U0."id" = U1."a_ptr_id")
 WHERE U1."a_ptr_id" IS NULL
 )
 )
 LIMIT 21
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-01-11 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  reopened  | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by zgoda):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 Sorry, closed wrong ticket.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #12567: Incorrect SQL being generated in certain inheritance cases.

2010-01-10 Thread Django
#12567: Incorrect SQL being generated in certain inheritance cases.
---+
  Reporter:  Alex  | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * summary:  Invalid SQL being generated in certain inheritance cases. =>
  Incorrect SQL being generated in certain
  inheritance cases.

Comment:

 Changed the summary, it wasn't totally accurate.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.