#28439: When() [on MySQL] does not work with models using UUID as primary key
-------------------------------------+-------------------------------------
Reporter: Dominik Kozaczko | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: when, | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Dominik Kozaczko:
Old description:
> I have a strange issue with `When()` and models using UUID as their pk.
>
> I prepared example project here: https://github.com/dekoza/djanbug
>
> The `example.views.myview` includes code ported from the app I'm
> currently developing - I have several models using UUIDs as their PK and
> I need to do some annotations an aggregations with some specific cases
> handled with `Case()/When()` combo.
>
> Even though the db is empty on the example, the view crashes that `'1' is
> not a valid UUID.` and the only '1' is the one in `When()`
>
> I've also encountered issues with `Count('*', distinct=True)` but right
> now I'm trying to reproduce it on the example and will post another
> ticket when I'm done.
New description:
I have a strange issue with `When()` and models using UUID as their pk.
The DB is MySQL 5.6.23 but I've encountered it also on the newest 5.7
version (which is a pain but it's a different story).
I prepared example project here: https://github.com/dekoza/djanbug
The `example.views.myview` includes code ported from the app I'm currently
developing - I have several models using UUIDs as their PK and I need to
do some annotations an aggregations with some specific cases handled with
`Case()/When()` combo.
Even though the db is empty on the example, the view crashes that `'1' is
not a valid UUID.` and the only '1' is the one in `When()`
I've also encountered issues with `Count('*', distinct=True)` but right
now I'm trying to reproduce it on the example and will post another ticket
when I'm done.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28439#comment:1>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.61f092fac38361a8a601bb72bb062e41%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.