fix(mysql): handle reading binary-encoded string data

This commit is contained in:
Ryan Leckey 2021-02-23 12:14:23 -08:00
parent 6622f45b3a
commit 16f961584d
No known key found for this signature in database
GPG Key ID: F8AA68C235AB08C9

View File

@ -69,13 +69,17 @@ impl<'de> Deserialize<'de, (MySqlRawValueFormat, &'de [MySqlColumn])> for Row {
| MySqlTypeId::INT
| MySqlTypeId::INT_UNSIGNED => 4,
MySqlTypeId::TEXT | MySqlTypeId::CHAR | MySqlTypeId::VARCHAR => {
buf.get_uint_lenenc()
}
id => {
// TODO: return a protocol error instead
unimplemented!("unsupported column type: {}", id.ty());
}
};
values.push(Some(buf.split_to(size)));
values.push(Some(buf.split_to(size as usize)));
}
}