0
0
mirror of https://github.com/django/django.git synced 2024-11-29 22:56:46 +01:00

Refs #29851 -- Fixed test_subquery_row_range_rank() crash on MariaDB 10.2+.

Thanks Tom Forbes for the report.
This commit is contained in:
Mariusz Felisiak 2019-01-03 20:18:45 +01:00 committed by GitHub
parent 97844a3213
commit e49ab72637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -595,7 +595,7 @@ class WindowFunctionTests(TestCase):
order_by=[F('hire_date').asc()],
frame=RowRange(start=-1, end=1),
),
).order_by('-avg_salary', '-hire_date').values('hire_date')[:1],
).order_by('-avg_salary', 'hire_date').values('hire_date')[:1],
),
).order_by('department', 'name')
self.assertQuerysetEqual(qs, [
@ -603,14 +603,14 @@ class WindowFunctionTests(TestCase):
('Jenson', 'Accounting', datetime.date(2005, 11, 1)),
('Jones', 'Accounting', datetime.date(2005, 11, 1)),
('Williams', 'Accounting', datetime.date(2005, 11, 1)),
('Moore', 'IT', datetime.date(2013, 8, 1)),
('Wilkinson', 'IT', datetime.date(2013, 8, 1)),
('Johnson', 'Management', datetime.date(2005, 7, 1)),
('Miller', 'Management', datetime.date(2005, 7, 1)),
('Johnson', 'Marketing', datetime.date(2012, 3, 1)),
('Smith', 'Marketing', datetime.date(2012, 3, 1)),
('Brown', 'Sales', datetime.date(2009, 9, 1)),
('Smith', 'Sales', datetime.date(2009, 9, 1)),
('Moore', 'IT', datetime.date(2011, 3, 1)),
('Wilkinson', 'IT', datetime.date(2011, 3, 1)),
('Johnson', 'Management', datetime.date(2005, 6, 1)),
('Miller', 'Management', datetime.date(2005, 6, 1)),
('Johnson', 'Marketing', datetime.date(2009, 10, 1)),
('Smith', 'Marketing', datetime.date(2009, 10, 1)),
('Brown', 'Sales', datetime.date(2007, 6, 1)),
('Smith', 'Sales', datetime.date(2007, 6, 1)),
], transform=lambda row: (row.name, row.department, row.highest_avg_salary_date))
def test_row_range_rank(self):