Opened 9 years ago
Last modified 9 years ago
#25638 closed Bug
update using Concat with Value causes error-encoding in SQLite — at Initial Version
Reported by: | Bear | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Suppose we want to concat a string to the end of a Charfield.
If we use:
Model.objects.update(field=Concat('field', Value("end")))
it will commit successfully, but the field will inlcude error-encoding text in SQLite. If we select the field from db, db will say "OperationalError: Could not decode to UTF-8 column 'name' with text".
Instead,
Model.objects.update(field=Concat('field', Value("end"), None))
it will be OK.
Note:
See TracTickets
for help on using tickets.