mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-14 18:12:35 +08:00
Treat BIT as binary type.
This commit is contained in:
3
_mysql.c
3
_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
|
||||
|
@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user