Changes between Initial Version and Version 1 of Ticket #26539, comment 5


Ignore:
Timestamp:
Aug 29, 2016, 10:01:21 AM (8 years ago)
Author:
PREMANAND

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26539, comment 5

    initial v1  
    33SQLLite and Mysql both passes the test. The queries generated are different(sqllite has SUBSELECT) but the result of the subselect is same as MYSQL.
    44
    5 Here are the 2 queries thats generated. In MYSQL the select statement is generated first and then the results are applied to the update but in sqllite is select statement is applied directly as a subselect.
     5Here are the 2 queries thats generated. In MYSQL the select statement is generated first and then the results are applied to the update but in sqllite the select statement is applied directly as a subselect. Not sure what is expected in this ticket?
    66
    77MYSQL results:-
    88
     9
     10{{{
    911>>> Foo.objects.annotate(bname=F('related_bar__name')).update(bar_name=F('bar_name'))
    1012SELECT `polls_foo`.`id`
     
    1517WHERE `polls_foo`.`id` IN (6,7)
    1618
     19}}}
     20
    1721SQLLite:-
    1822
    1923
     24
     25{{{
    2026>>> Foo.objects.annotate(bname=F('related_bar__name'))
    2127SELECT "polls_foo"."id",
     
    3541     INNER JOIN "polls_bar" U1 ON (U0."related_bar_id" = U1."id")) [0.29ms]
    3642#                            7) [0.22ms]
     43}}}
Back to Top