﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26140	"BinaryField value must be declared ""binary"" in queries to avoid MySQL 5.7+ warning"	Tim Graham	nobody	"There are a couple warnings with running the Django test suite on MySQL 5.7:
{{{
test_json_serializer (serializers.test_data.SerializerDataTests) ... /media/sf_django/django/db/backends/mysql/base.py:112: Warning: Invalid utf8 character string: 'FD00'
  return self.cursor.execute(query, args)

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."	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed		giovanni@… guilhem.bichot@…	Ready for checkin	1	0	0	0	0	0
