test_set_and_retrieve (model_fields.tests.BinaryFieldTests) ...
/media/sf_django/django/db/backends/mysql/base.py:112: Warning: Invalid
utf8 character string: 'FE'
}}}
I think these are both fixed by changing our queries from something like
{{{
cursor.execute("""
INSERT INTO `field` (binary)
VALUES (%s)
""", data)
}}}
to:
{{{
cursor.execute("""
INSERT INTO `field` (binary)
VALUES (_binary %s)
""", data)
}}}
The "_binary" tells MySQL that the following string is to be interpreted
as binary, not to be interpreted/validated as utf8.
http://dev.mysql.com/doc/refman/5.7/en/charset-literal.html
There's some background in #26139.
--
Ticket URL: <https://code.djangoproject.com/ticket/26140>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:1>
* cc: giovanni@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:2>
* cc: guilhem.bichot@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:3>
Comment (by claudep):
[https://github.com/django/django/pull/6140 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"204e00c0c57c34528157a739389b6935e4af2f36" 204e00c0]:
{{{
#!CommitTicketReference repository=""
revision="204e00c0c57c34528157a739389b6935e4af2f36"
Fixed #26140 -- Suppressed MySQL warning when inserting binary content
Thanks Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26140#comment:7>