mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-02-14 20:07:31 +00:00
[MySQL] Rename ty.flag to ty.is_unsigned
This commit is contained in:
parent
3a645a1824
commit
e161787952
@ -52,7 +52,7 @@ impl Encode for ComStmtExecute<'_> {
|
||||
buf.put_u8(ty.r#type.0);
|
||||
|
||||
// parameter flag : byte<1>
|
||||
buf.put_u8(ty.flag);
|
||||
buf.put_u8(if ty.is_unsigned { 0x80 } else { 0 });
|
||||
}
|
||||
|
||||
// byte<n> binary parameter value
|
||||
|
||||
@ -14,16 +14,22 @@ mod chrono;
|
||||
#[derive(Default, Debug)]
|
||||
pub struct MySqlTypeMetadata {
|
||||
pub(crate) r#type: Type,
|
||||
pub(crate) flag: u8, // 0 or 0x80 for unsigned
|
||||
pub(crate) is_unsigned: bool,
|
||||
}
|
||||
|
||||
impl MySqlTypeMetadata {
|
||||
pub(crate) fn new(r#type: Type) -> Self {
|
||||
Self { r#type, flag: 0 }
|
||||
Self {
|
||||
r#type,
|
||||
is_unsigned: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unsigned(r#type: Type) -> Self {
|
||||
Self { r#type, flag: 0x80 }
|
||||
Self {
|
||||
r#type,
|
||||
is_unsigned: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user