feat: pgwire 0.33 update (#7048)

This commit is contained in:
Ning Sun
2025-10-03 16:06:05 +08:00
committed by GitHub
parent b7045e57a5
commit f7202bc176
4 changed files with 75 additions and 53 deletions

108
Cargo.lock generated
View File

@@ -694,7 +694,7 @@ checksum = "37672978ae0febce7516ae0a85b53e6185159a9a28787391eb63fc44ec36037d"
dependencies = [
"async-fs",
"futures-lite",
"thiserror 2.0.12",
"thiserror 2.0.17",
]
[[package]]
@@ -1411,7 +1411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d8af896b707212cd0e99c112a78c9497dd32994192a463ed2f7419d29bd8c6"
dependencies = [
"serde",
"thiserror 2.0.12",
"thiserror 2.0.17",
"toml 0.8.23",
]
@@ -1975,7 +1975,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
dependencies = [
"serde",
"termcolor",
"unicode-width 0.1.14",
"unicode-width 0.2.1",
]
[[package]]
@@ -4360,7 +4360,7 @@ dependencies = [
"chrono",
"rust_decimal",
"serde",
"thiserror 2.0.12",
"thiserror 2.0.17",
"time",
"winnow 0.6.26",
]
@@ -5914,7 +5914,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
"windows-core 0.57.0",
"windows-core 0.61.2",
]
[[package]]
@@ -6517,7 +6517,7 @@ dependencies = [
"pest_derive",
"regex",
"serde_json",
"thiserror 2.0.12",
"thiserror 2.0.17",
]
[[package]]
@@ -6919,7 +6919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [
"cfg-if",
"windows-targets 0.48.5",
"windows-targets 0.52.6",
]
[[package]]
@@ -7007,7 +7007,7 @@ checksum = "656b3b27f8893f7bbf9485148ff9a65f019e3f33bd5cdc87c83cab16b3fd9ec8"
dependencies = [
"libc",
"neli",
"thiserror 2.0.12",
"thiserror 2.0.17",
"windows-sys 0.59.0",
]
@@ -7807,7 +7807,7 @@ dependencies = [
"quote",
"syn 2.0.104",
"termcolor",
"thiserror 2.0.12",
"thiserror 2.0.17",
]
[[package]]
@@ -7834,7 +7834,7 @@ dependencies = [
"serde",
"serde_json",
"socket2 0.5.10",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tokio-rustls",
"tokio-util",
@@ -8363,7 +8363,7 @@ dependencies = [
"itertools 0.14.0",
"parking_lot 0.12.4",
"percent-encoding",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tracing",
"url",
@@ -8533,7 +8533,7 @@ dependencies = [
"futures-sink",
"js-sys",
"pin-project-lite",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
]
@@ -8563,7 +8563,7 @@ dependencies = [
"opentelemetry_sdk",
"prost 0.13.5",
"reqwest",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tonic 0.13.1",
"tracing",
@@ -8603,7 +8603,7 @@ dependencies = [
"percent-encoding",
"rand 0.9.1",
"serde_json",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tokio-stream",
]
@@ -9114,7 +9114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323"
dependencies = [
"memchr",
"thiserror 2.0.12",
"thiserror 2.0.17",
"ucd-trie",
]
@@ -9185,11 +9185,12 @@ dependencies = [
[[package]]
name = "pgwire"
version = "0.32.1"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddf403a6ee31cf7f2217b2bd8447cb13dbb6c268d7e81501bc78a4d3daafd294"
checksum = "f58d371668e6151da16be31308989058156c01257277ea8af0f97524e87cfa31"
dependencies = [
"async-trait",
"base64 0.22.1",
"bytes",
"chrono",
"derive-new",
@@ -9202,10 +9203,12 @@ dependencies = [
"ring",
"rust_decimal",
"rustls-pki-types",
"thiserror 2.0.12",
"stringprep",
"thiserror 2.0.17",
"tokio",
"tokio-rustls",
"tokio-util",
"x509-certificate 0.25.0",
]
[[package]]
@@ -9851,7 +9854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4"
dependencies = [
"bytes",
"heck 0.4.1",
"heck 0.5.0",
"itertools 0.12.1",
"log",
"multimap",
@@ -9871,8 +9874,8 @@ version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf"
dependencies = [
"heck 0.4.1",
"itertools 0.10.5",
"heck 0.5.0",
"itertools 0.14.0",
"log",
"multimap",
"once_cell",
@@ -9918,7 +9921,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d"
dependencies = [
"anyhow",
"itertools 0.10.5",
"itertools 0.14.0",
"proc-macro2",
"quote",
"syn 2.0.104",
@@ -10207,7 +10210,7 @@ dependencies = [
"rustc-hash 2.1.1",
"rustls",
"socket2 0.5.10",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tracing",
"web-time",
@@ -10228,7 +10231,7 @@ dependencies = [
"rustls",
"rustls-pki-types",
"slab",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tinyvec",
"tracing",
"web-time",
@@ -10822,7 +10825,7 @@ dependencies = [
"rsasl",
"rustls",
"snap",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tokio-rustls",
"tracing",
@@ -11293,7 +11296,7 @@ dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
"thiserror 2.0.12",
"thiserror 2.0.17",
]
[[package]]
@@ -11825,7 +11828,7 @@ checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb"
dependencies = [
"num-bigint",
"num-traits",
"thiserror 2.0.12",
"thiserror 2.0.17",
"time",
]
@@ -11905,7 +11908,7 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1961e2ef424c1424204d3a5d6975f934f56b6d50ff5732382d84ebf460e147f7"
dependencies = [
"heck 0.4.1",
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.104",
@@ -12167,7 +12170,7 @@ dependencies = [
"serde_json",
"sha2",
"smallvec",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tokio-stream",
"tracing",
@@ -12251,7 +12254,7 @@ dependencies = [
"smallvec",
"sqlx-core",
"stringprep",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"whoami",
]
@@ -12289,7 +12292,7 @@ dependencies = [
"smallvec",
"sqlx-core",
"stringprep",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"whoami",
]
@@ -12314,7 +12317,7 @@ dependencies = [
"serde",
"serde_urlencoded",
"sqlx-core",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tracing",
"url",
]
@@ -12787,7 +12790,7 @@ dependencies = [
"tantivy-stacker",
"tantivy-tokenizer-api",
"tempfile",
"thiserror 2.0.12",
"thiserror 2.0.17",
"time",
"uuid",
"winapi",
@@ -13115,11 +13118,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.12"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl 2.0.12",
"thiserror-impl 2.0.17",
]
[[package]]
@@ -13135,9 +13138,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.12"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
dependencies = [
"proc-macro2",
"quote",
@@ -13386,7 +13389,7 @@ dependencies = [
"tokio",
"tokio-postgres",
"tokio-rustls",
"x509-certificate",
"x509-certificate 0.23.1",
]
[[package]]
@@ -13906,7 +13909,7 @@ dependencies = [
"serde",
"serde_json",
"syn 2.0.104",
"thiserror 2.0.12",
"thiserror 2.0.17",
"unicode-ident",
]
@@ -14001,7 +14004,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c01d12e3a56a4432a8b436f293c25f4808bdf9e9f9f98f9260bba1f1bc5a1f26"
dependencies = [
"thiserror 2.0.12",
"thiserror 2.0.17",
]
[[package]]
@@ -14299,7 +14302,7 @@ dependencies = [
"strip-ansi-escapes",
"syslog_loose",
"termcolor",
"thiserror 2.0.12",
"thiserror 2.0.17",
"tokio",
"tracing",
"ua-parser",
@@ -14541,7 +14544,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
"windows-sys 0.48.0",
"windows-sys 0.59.0",
]
[[package]]
@@ -14954,6 +14957,25 @@ dependencies = [
"zeroize",
]
[[package]]
name = "x509-certificate"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca9eb9a0c822c67129d5b8fcc2806c6bc4f50496b420825069a440669bcfbf7f"
dependencies = [
"bcder",
"bytes",
"chrono",
"der",
"hex",
"pem",
"ring",
"signature",
"spki",
"thiserror 2.0.17",
"zeroize",
]
[[package]]
name = "xattr"
version = "1.5.1"

View File

@@ -90,7 +90,7 @@ opentelemetry-proto.workspace = true
operator.workspace = true
otel-arrow-rust.workspace = true
parking_lot.workspace = true
pgwire = { version = "0.32.1", default-features = false, features = ["server-api-ring"] }
pgwire = { version = "0.33", default-features = false, features = ["server-api-ring"] }
pin-project = "1.0"
pipeline.workspace = true
postgres-types = { version = "0.2", features = ["with-chrono-0_4", "with-serde_json-1"] }

View File

@@ -72,7 +72,7 @@ fn set_transaction_warning(query_ctx: QueryContextRef) {
}
/// Process unsupported SQL and return fixed result as a compatibility solution
pub(crate) fn process<'a>(query: &str, query_ctx: QueryContextRef) -> Option<Vec<Response<'a>>> {
pub(crate) fn process(query: &str, query_ctx: QueryContextRef) -> Option<Vec<Response>> {
// Transaction directives:
if START_TRANSACTION_PATTERN.is_match(query) {
set_transaction_warning(query_ctx);
@@ -133,7 +133,7 @@ mod test {
}
}
fn get_data<'a>(q: &str, query_context: QueryContextRef) -> QueryResponse<'a> {
fn get_data(q: &str, query_context: QueryContextRef) -> QueryResponse {
if let Response::Query(resp) = process(q, query_context.clone())
.unwrap_or_else(|| panic!("fail to match {}", q))
.remove(0)

View File

@@ -51,7 +51,7 @@ use crate::query_handler::sql::ServerSqlQueryHandlerRef;
#[async_trait]
impl SimpleQueryHandler for PostgresServerHandlerInner {
#[tracing::instrument(skip_all, fields(protocol = "postgres"))]
async fn do_query<'a, C>(&self, client: &mut C, query: &str) -> PgWireResult<Vec<Response<'a>>>
async fn do_query<C>(&self, client: &mut C, query: &str) -> PgWireResult<Vec<Response>>
where
C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync,
C::Error: Debug,
@@ -120,11 +120,11 @@ where
Ok(())
}
pub(crate) fn output_to_query_response<'a>(
pub(crate) fn output_to_query_response(
query_ctx: QueryContextRef,
output: Result<Output>,
field_format: &Format,
) -> PgWireResult<Response<'a>> {
) -> PgWireResult<Response> {
match output {
Ok(o) => match o.data {
OutputData::AffectedRows(rows) => {
@@ -148,12 +148,12 @@ pub(crate) fn output_to_query_response<'a>(
}
}
fn recordbatches_to_query_response<'a, S>(
fn recordbatches_to_query_response<S>(
query_ctx: QueryContextRef,
recordbatches_stream: S,
schema: SchemaRef,
field_format: &Format,
) -> PgWireResult<Response<'a>>
) -> PgWireResult<Response>
where
S: Stream<Item = RecordBatchResult<RecordBatch>> + Send + Unpin + 'static,
{
@@ -281,12 +281,12 @@ impl ExtendedQueryHandler for PostgresServerHandlerInner {
self.query_parser.clone()
}
async fn do_query<'a, C>(
async fn do_query<C>(
&self,
client: &mut C,
portal: &Portal<Self::Statement>,
_max_rows: usize,
) -> PgWireResult<Response<'a>>
) -> PgWireResult<Response>
where
C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync,
C::Error: Debug,