#36612: KeyTextTransform uses ->> on CASTed TextField to JSONField in MySQL,
causing a syntax error
-------------------------------------+-------------------------------------
Reporter: Jacob Tavener | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):
In [changeset:"ffac97bf63ea803a6196d2097b4186e0865d9091" ffac97b]:
{{{#!CommitTicketReference repository=""
revision="ffac97bf63ea803a6196d2097b4186e0865d9091"
[6.0.x] Fixed #36612 -- Fixed a KeyTextTransform crash on MySQL against
annotations.
MySQL only supports the ->> when used directly against columns, this can
be
inferred by the presence of lhs.output_field.model as model bounds fields
are
directly tied to columns.
Purposely don't systematically switch to using
JSON_QUOTE(JSON_EXTRACT(...))
as there might be functional indices out there that rely on the SQL
remaining
stable between versions.
Thanks Jacob Tavener for the report.
Backport of af84cfba5970fda8306860b650937701c7c03c6f from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36612#comment:7>
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 view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070199703bea3f-0b5be1cf-32f5-413d-a6b5-5bbb94718f40-000000%40eu-central-1.amazonses.com.