After spending multiple days on the issue I have found that the issue
comes from the fix that is created here:
https://code.djangoproject.com/ticket/31573
Somehow with (this version of?) MariaDB when you add the order before the
update, everything will end up with the same order, instead of just adding
one to the current order.
In code:
if qs_to_increase orders are [2, 3]
{{{
qs_to_increase = qs_to_increase.order_by('-order').update(
order=F('order') + 1)
}}}
Ends up with qs_to_increse order [4,4]
{{{
qs_to_increase = qs_to_increase.update(
order=F('order') + 1)
}}}
works and gives (correctly) [3,4]
Although I think not many people will be affected (the extra .order_by was
only necessary for MySQL), it is strange that the update to MariaDB
10.5.13 results in a data error. Also, related MySQL versions (8.0?) might
also be affected.
--
Ticket URL: <https://code.djangoproject.com/ticket/34179>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => worksforme
Comment:
Hi, thanks for this report, however everything works for me with MariaDB
10.5.13 (I checked tests added in
779e615e362108862f1681f965ee9e4f1d0ae6d2).
--
Ticket URL: <https://code.djangoproject.com/ticket/34179#comment:1>