Skip to content

Commit d7f9ee4

Browse files
chore(deps): bump pgwire from 0.35.0 to 0.36.0 (#241)
* chore(deps): bump pgwire from 0.35.0 to 0.36.0 Bumps [pgwire](https://github.com/sunng87/pgwire) from 0.35.0 to 0.36.0. - [Release notes](https://github.com/sunng87/pgwire/releases) - [Changelog](https://github.com/sunng87/pgwire/blob/master/CHANGELOG.md) - [Commits](sunng87/pgwire@v0.35.0...v0.36.0) --- updated-dependencies: - dependency-name: pgwire dependency-version: 0.36.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: update pgwire and api adoption * test: fix test by giving encoding format --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ning Sun <[email protected]> Co-authored-by: Ning Sun <[email protected]>
1 parent 796e746 commit d7f9ee4

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bytes = "1.11.0"
1818
chrono = { version = "0.4", features = ["std"] }
1919
datafusion = { version = "50", default-features = false }
2020
futures = "0.3"
21-
pgwire = { version = "0.35", default-features = false }
21+
pgwire = { version = "0.36.1", default-features = false }
2222
postgres-types = "0.2"
2323
rust_decimal = { version = "1.39", features = ["db-postgres"] }
2424
tokio = { version = "1", default-features = false }

arrow-pg/src/datatypes/df.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ where
6464
S: Clone,
6565
{
6666
fn get_pg_type(
67-
pg_type_hint: Option<&Type>,
67+
pg_type_hint: Option<Type>,
6868
inferenced_type: Option<&DataType>,
6969
) -> PgWireResult<Type> {
7070
if let Some(ty) = pg_type_hint {
@@ -80,7 +80,14 @@ where
8080
let mut deserialized_params = Vec::with_capacity(param_len);
8181
for i in 0..param_len {
8282
let inferenced_type = inferenced_types.get(i).and_then(|v| v.to_owned());
83-
let pg_type = get_pg_type(portal.statement.parameter_types.get(i), inferenced_type)?;
83+
let pg_type = get_pg_type(
84+
portal
85+
.statement
86+
.parameter_types
87+
.get(i)
88+
.and_then(|f| f.clone()),
89+
inferenced_type,
90+
)?;
8491
match pg_type {
8592
// enumerate all supported parameter types and deserialize the
8693
// type to ScalarValue
@@ -156,6 +163,7 @@ where
156163
}
157164
Type::TIME => {
158165
let value = portal.parameter::<NaiveTime>(i, &pg_type)?;
166+
dbg!(&value);
159167

160168
let ns = value.map(|t| {
161169
t.num_seconds_from_midnight() as i64 * 1_000_000_000 + t.nanosecond() as i64
@@ -329,22 +337,22 @@ mod tests {
329337
use datafusion::{common::ParamValues, scalar::ScalarValue};
330338
use pgwire::{
331339
api::{portal::Portal, stmt::StoredStatement},
332-
messages::extendedquery::Bind,
340+
messages::{data::FORMAT_CODE_BINARY, extendedquery::Bind},
333341
};
334342
use postgres_types::Type;
335343

336344
use crate::datatypes::df::deserialize_parameters;
337345

338346
#[test]
339347
fn test_deserialise_time_params() {
340-
let postgres_types = vec![Type::TIME];
348+
let postgres_types = vec![Some(Type::TIME)];
341349

342350
let us: i64 = 1_000_000; // 1 second
343351

344352
let bind = Bind::new(
345353
None,
346354
None,
347-
vec![],
355+
vec![FORMAT_CODE_BINARY],
348356
vec![Some(Bytes::from(i64::to_be_bytes(us).to_vec()))],
349357
vec![],
350358
);

datafusion-postgres/src/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ impl QueryParser for Parser {
651651
&self,
652652
client: &C,
653653
sql: &str,
654-
_types: &[Type],
654+
_types: &[Option<Type>],
655655
) -> PgWireResult<Self::Statement>
656656
where
657657
C: ClientInfo + Unpin + Send + Sync,

0 commit comments

Comments
 (0)