mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 14:34:19 +00:00
Correct Postgres' Length Limit for Bind Parameters (#1141)
* Bump limit for postgres' bind parameters * Fix lingering fmt error
This commit is contained in:
parent
c83427f8fc
commit
469c4ac130
2 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ impl Encode<'_> for Parse<'_> {
|
|||
buf.put_str_nul(self.query);
|
||||
|
||||
// TODO: Return an error here instead
|
||||
assert!(self.param_types.len() <= (i16::MAX as usize));
|
||||
assert!(self.param_types.len() <= (u16::MAX as usize));
|
||||
|
||||
buf.extend(&(self.param_types.len() as i16).to_be_bytes());
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ use sqlx_test::{new, test_type};
|
|||
#[derive(Debug, PartialEq, sqlx::Type)]
|
||||
#[repr(u32)]
|
||||
enum Origin {
|
||||
Foo = 1,
|
||||
Bar = 2,
|
||||
Foo = 1,
|
||||
Bar = 2,
|
||||
}
|
||||
|
||||
test_type!(origin_enum<Origin>(Sqlite,
|
||||
|
|
Loading…
Reference in a new issue