Opened 7 years ago

Closed 7 years ago

#29209 closed Bug (fixed)

Cast with TextField crashes on MySQL

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: Database layer (models, ORM) Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

City.objects.values_list(Cast('id', models.TextField())).first()
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'longtext) AS `cast1` FROM `test_app_city` ORDER BY `test_app_city`.`id` ASC  LIM' at line 1"

Change History (6)

comment:1 by Sergey Fedoseev, 7 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Sergey Fedoseev, 7 years ago

Has patch: set

comment:3 by Claude Paroz, 7 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by Tim Graham, 7 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

The new test fails on Oracle.

comment:5 by Sergey Fedoseev, 7 years ago

Patch needs improvement: unset

comment:6 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In d696fcca:

Fixed #29209 -- Fixed Cast() with TextField on MySQL and Oracle.

Note: See TracTickets for help on using tickets.
Back to Top