1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

[1.7.x] Fixed #23605 -- Fixed nested subquery regression

Added relabeled_clone() method to sql.Query to fix the problem. It
manifested itself in rare cases where at least double nested subquery's
filter condition might target non-existing alias.

Thanks to Trac alias ris for reporting the problem.

Backport of 5c481db295 from master
This commit is contained in:
Anssi Kääriäinen
2014-10-07 16:07:46 +03:00
committed by Tim Graham
parent 2e2607870d
commit 01f2cf2aec
5 changed files with 77 additions and 3 deletions

View File

@@ -675,3 +675,18 @@ class Student(models.Model):
class Classroom(models.Model):
school = models.ForeignKey(School)
students = models.ManyToManyField(Student, related_name='classroom')
class Ticket23605A(models.Model):
pass
class Ticket23605B(models.Model):
modela_fk = models.ForeignKey(Ticket23605A)
modelc_fk = models.ForeignKey("Ticket23605C")
field_b0 = models.IntegerField(null=True)
field_b1 = models.BooleanField(default=False)
class Ticket23605C(models.Model):
field_c0 = models.FloatField()