mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
fix(macros): reintroduce and fix macro tests for MySQL
This commit is contained in:
@@ -275,9 +275,10 @@ impl<'c> Executor<'c> for &'c mut MySqlConnection {
|
||||
for _ in 0..(ok.columns as usize) {
|
||||
let def: ColumnDefinition = self.stream.recv().await?;
|
||||
let ty = MySqlTypeInfo::from_column(&def);
|
||||
let name = def.name()?;
|
||||
|
||||
columns.push(Column {
|
||||
name: def.name()?.to_owned(),
|
||||
name: if name.is_empty() { def.alias()? } else { name }.to_owned(),
|
||||
type_info: ty,
|
||||
not_null: Some(def.flags.contains(ColumnFlags::NOT_NULL)),
|
||||
})
|
||||
|
||||
@@ -78,6 +78,18 @@ impl PartialEq<MySqlTypeInfo> for MySqlTypeInfo {
|
||||
== other.flags.contains(ColumnFlags::UNSIGNED);
|
||||
}
|
||||
|
||||
// for string types, check that our charset matches
|
||||
ColumnType::VarChar
|
||||
| ColumnType::Blob
|
||||
| ColumnType::TinyBlob
|
||||
| ColumnType::MediumBlob
|
||||
| ColumnType::LongBlob
|
||||
| ColumnType::String
|
||||
| ColumnType::VarString
|
||||
| ColumnType::Enum => {
|
||||
return self.char_set == other.char_set;
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ impl<'r> Decode<'r, MySql> for &'r str {
|
||||
| ColumnType::String
|
||||
| ColumnType::VarString
|
||||
| ColumnType::Enum
|
||||
)
|
||||
) && ty.char_set == 224
|
||||
}
|
||||
|
||||
fn decode(value: MySqlValueRef<'r>) -> Result<Self, BoxDynError> {
|
||||
|
||||
Reference in New Issue
Block a user