chore(postgres): include nullables query in error

This commit is contained in:
Austin Bonander
2024-08-21 13:50:48 -07:00
parent 4fb2dcbe97
commit 56d0225378
3 changed files with 19 additions and 8 deletions

View File

@@ -466,7 +466,13 @@ WHERE rngtypid = $1
let mut nullables: Vec<Option<bool>> = nullable_query
.build_query_scalar()
.fetch_all(&mut *self)
.await?;
.await
.map_err(|e| {
err_protocol!(
"error from nullables query: {e}; query: {:?}",
nullable_query.sql()
)
})?;
// If the server is CockroachDB or Materialize, skip this step (#1248).
if !self.stream.parameter_statuses.contains_key("crdb_version")

View File

@@ -27,7 +27,7 @@ impl PgBufMutExt for Vec<u8> {
let size_result = write_result.and_then(|_| {
let size = self.len() - offset;
i32::try_from(size)
.map_err(|_| err_protocol!("message size out of range for Pg protocol: {size"))
.map_err(|_| err_protocol!("message size out of range for protocol: {size}"))
});
match size_result {