Skip to content

Commit

Permalink
psql-srv: Use passthrough when decoding unsupported text format params
Browse files Browse the repository at this point in the history
This ties together the last couple of commits that add support for
sending text passthrough parameters, and actually starts using it so
that we can proxy unsupported types for parameters in text mode.

Fixes: #266
Fixes: REA-3183
Release-Note-Core: Fix proxying of Postgres queries that use the
  Postgres text protocol to send query parameters when those parameters
  use types that aren't natively supported by ReadySet.
Change-Id: Ia9116b0cbd8e237963fce59c543b57f678c5871f
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5932
Tested-by: Buildkite CI
Reviewed-by: Dan Wilbanks <dan@readyset.io>
  • Loading branch information
nickelization committed Aug 31, 2023
1 parent 20afdcc commit 864e5a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion psql-srv/src/codec/decoder.rs
Expand Up @@ -470,7 +470,11 @@ fn get_text_value(src: &mut Bytes, t: &Type) -> Result<PsqlValue, Error> {
Type::BIT => get_bitvec_from_str(text_str).map(PsqlValue::Bit),
Type::VARBIT => get_bitvec_from_str(text_str).map(PsqlValue::VarBit),
ref t if t.name() == "citext" => Ok(PsqlValue::Text(text_str.into())),
_ => Err(Error::UnsupportedType(t.clone())),
_ => Ok(PsqlValue::PassThrough(readyset_data::PassThrough {
ty: t.clone(),
format: PassThroughFormat::Text,
data: text.as_bytes().to_vec().into_boxed_slice(),
})),
}
}

Expand Down

0 comments on commit 864e5a2

Please sign in to comment.