diff --git a/_mysql.c b/_mysql.c index df8bd1b..1806cc5 100644 --- a/_mysql.c +++ b/_mysql.c @@ -1372,7 +1372,8 @@ _mysql_field_to_python( field_type == FIELD_TYPE_LONG_BLOB || field_type == FIELD_TYPE_BLOB || field_type == FIELD_TYPE_VAR_STRING || - field_type == FIELD_TYPE_STRING) { + field_type == FIELD_TYPE_STRING || + field_type == FIELD_TYPE_BIT) { binary = 1; } #endif diff --git a/tests/test_MySQLdb_capabilities.py b/tests/test_MySQLdb_capabilities.py index 432fd84..ec4ecd2 100644 --- a/tests/test_MySQLdb_capabilities.py +++ b/tests/test_MySQLdb_capabilities.py @@ -92,7 +92,7 @@ class test_MySQLdb(capabilities.DatabaseTest): row = c.fetchone() self.assertEqual(row[0], b'\x03') self.assertEqual(row[1], b'\x03\xff') - self.assertEqual(row[2], 'b\xff'*8) + self.assertEqual(row[2], b'\xff'*8) finally: c.execute("drop table if exists test_BIT")