From c0f498b00c263998a521d6c4f36f63aacf4f875e Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 9 Dec 2024 11:12:11 +0800 Subject: [PATCH] feat: update pgwire to 0.28 (#5113) * feat: update pgwire to 0.28 * test: update tests --- Cargo.lock | 270 ++++++++++++----------- src/servers/Cargo.toml | 2 +- src/servers/src/postgres.rs | 9 +- src/servers/src/postgres/auth_handler.rs | 4 +- src/servers/src/postgres/fixtures.rs | 14 +- src/servers/src/postgres/handler.rs | 11 +- src/servers/src/postgres/types/bytea.rs | 1 - 7 files changed, 174 insertions(+), 137 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16a234728983..920393daa030 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -637,7 +637,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -659,7 +659,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -676,7 +676,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -687,7 +687,7 @@ checksum = "20235b6899dd1cb74a9afac0abf5b4a20c0e500dd6537280f4096e1b9f14da20" dependencies = [ "async-fs", "futures-lite", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -774,7 +774,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -873,7 +873,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1012,7 +1012,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.90", "which", ] @@ -1031,7 +1031,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -1155,7 +1155,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "syn_derive", ] @@ -1694,7 +1694,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -2189,7 +2189,7 @@ dependencies = [ "quote", "snafu 0.8.5", "static_assertions", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -2927,7 +2927,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -2949,7 +2949,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3443,7 +3443,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3454,7 +3454,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3517,7 +3517,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3547,7 +3547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" dependencies = [ "derive_builder_core 0.20.1", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3567,7 +3567,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "unicode-xid", ] @@ -3579,7 +3579,7 @@ checksum = "65f152f4b8559c4da5d574bafc7af85454d706b4c5fe8b530d508cacbb6807ea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3734,7 +3734,7 @@ dependencies = [ "chrono", "rust_decimal", "serde", - "thiserror", + "thiserror 1.0.64", "time", "winnow 0.6.20", ] @@ -3800,7 +3800,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -3812,7 +3812,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4267,7 +4267,7 @@ checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4279,7 +4279,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4291,7 +4291,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -4421,7 +4421,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5028,7 +5028,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5043,7 +5043,7 @@ dependencies = [ "rust-sitter", "rust-sitter-tool", "slotmap", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5062,7 +5062,7 @@ dependencies = [ "serde", "serde_json", "slotmap", - "syn 2.0.79", + "syn 2.0.90", "webbrowser", ] @@ -5076,7 +5076,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5601,7 +5601,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.64", "walkdir", "windows-sys 0.45.0", ] @@ -5639,7 +5639,7 @@ dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5680,7 +5680,7 @@ dependencies = [ "pest_derive", "regex", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5693,7 +5693,7 @@ dependencies = [ "pest_derive", "regex", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5816,7 +5816,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tower", @@ -5838,7 +5838,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -5851,7 +5851,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -5876,7 +5876,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-util", "tracing", @@ -5943,7 +5943,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -6327,7 +6327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "792ba667add2798c6c3e988e630f4eb921b5cbc735044825b7111ef1582c8730" dependencies = [ "byteorder", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6432,7 +6432,7 @@ checksum = "376101dbd964fc502d5902216e180f92b3d003b5cc3d2e40e044eb5470fca677" dependencies = [ "bytes", "serde", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6807,7 +6807,7 @@ dependencies = [ "rustc_version", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.64", "triomphe", "uuid", ] @@ -6898,9 +6898,9 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "termcolor", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6916,9 +6916,9 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "termcolor", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -6948,7 +6948,7 @@ dependencies = [ "serde", "serde_json", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.24.1", "tokio-util", @@ -6991,7 +6991,7 @@ dependencies = [ "sha2", "smallvec", "subprocess", - "thiserror", + "thiserror 1.0.64", "time", "uuid", "zstd 0.12.4", @@ -7031,7 +7031,7 @@ dependencies = [ "sha2", "smallvec", "subprocess", - "thiserror", + "thiserror 1.0.64", "time", "uuid", "zstd 0.13.2", @@ -7090,7 +7090,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -7281,7 +7281,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -7539,7 +7539,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", "urlencoding", ] @@ -7554,7 +7554,7 @@ dependencies = [ "js-sys", "once_cell", "pin-project-lite", - "thiserror", + "thiserror 1.0.64", "urlencoding", ] @@ -7572,7 +7572,7 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry_sdk 0.21.2", "prost 0.11.9", - "thiserror", + "thiserror 1.0.64", "tokio", "tonic 0.9.2", ] @@ -7629,7 +7629,7 @@ dependencies = [ "ordered-float 4.3.0", "percent-encoding", "rand", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-stream", ] @@ -7652,7 +7652,7 @@ dependencies = [ "percent-encoding", "rand", "serde_json", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8088,7 +8088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.64", "ucd-trie", ] @@ -8112,7 +8112,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8138,9 +8138,9 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e63bc3945a17010ff93677589c656c5e8fb4183b00bc86360de8e187d2a86cb" +checksum = "c84e671791f3a354f265e55e400be8bb4b6262c1ec04fac4289e710ccf22ab43" dependencies = [ "async-trait", "bytes", @@ -8154,7 +8154,7 @@ dependencies = [ "rand", "ring 0.17.8", "rust_decimal", - "thiserror", + "thiserror 2.0.4", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -8224,7 +8224,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8497,7 +8497,7 @@ dependencies = [ "smallvec", "symbolic-demangle", "tempfile", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8572,7 +8572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8620,9 +8620,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -8664,7 +8664,7 @@ dependencies = [ "parking_lot 0.12.3", "procfs", "protobuf", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -8768,7 +8768,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.79", + "syn 2.0.90", "tempfile", ] @@ -8814,7 +8814,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -8827,7 +8827,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -9010,7 +9010,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -9023,7 +9023,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -9159,7 +9159,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.13", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.64", "tokio", "tracing", ] @@ -9176,7 +9176,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.13", "slab", - "thiserror", + "thiserror 1.0.64", "tinyvec", "tracing", ] @@ -9249,7 +9249,7 @@ dependencies = [ "serde", "serde_repr", "strum 0.25.0", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9302,7 +9302,7 @@ checksum = "6c1bb13e2dcfa2232ac6887157aad8d9b3fe4ca57f7c8d4938ff5ea9be742300" dependencies = [ "clocksource", "parking_lot 0.12.3", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9372,7 +9372,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9392,7 +9392,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -9579,7 +9579,7 @@ dependencies = [ "nix 0.25.1", "regex", "tempfile", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9723,7 +9723,7 @@ dependencies = [ "serde_json", "sha2", "stringprep", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -9743,7 +9743,7 @@ dependencies = [ "rsasl", "rustls 0.23.13", "snap", - "thiserror", + "thiserror 1.0.64", "tokio", "tokio-rustls 0.26.0", "tracing", @@ -9787,7 +9787,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.79", + "syn 2.0.90", "unicode-ident", ] @@ -9799,7 +9799,7 @@ checksum = "b3a8fb4672e840a587a66fc577a5491375df51ddb88f2a2c2a792598c326fe14" dependencies = [ "quote", "rand", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -9822,7 +9822,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.79", + "syn 2.0.90", "walkdir", ] @@ -10362,7 +10362,7 @@ dependencies = [ "static_assertions", "strum 0.24.1", "strum_macros 0.24.3", - "thiserror", + "thiserror 1.0.64", "thread_local", "timsort", "uname", @@ -10561,7 +10561,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10662,7 +10662,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10740,7 +10740,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10751,7 +10751,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10785,7 +10785,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10806,7 +10806,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -10848,7 +10848,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11147,7 +11147,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 1.0.64", "time", ] @@ -11240,7 +11240,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11383,7 +11383,7 @@ dependencies = [ "prettydiff", "regex", "serde_json", - "thiserror", + "thiserror 1.0.64", "toml 0.5.11", "walkdir", ] @@ -11451,7 +11451,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11461,7 +11461,7 @@ source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09 dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11525,7 +11525,7 @@ dependencies = [ "sqlformat", "sqlx-rt", "stringprep", - "thiserror", + "thiserror 1.0.64", "tokio-stream", "url", "webpki-roots 0.22.6", @@ -11753,7 +11753,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11766,7 +11766,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -11819,7 +11819,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "syn 2.0.79", + "syn 2.0.90", "typify", "walkdir", ] @@ -11840,7 +11840,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "syn 2.0.79", + "syn 2.0.90", "typify", "walkdir", ] @@ -11887,9 +11887,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -11924,7 +11924,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -12067,7 +12067,7 @@ dependencies = [ "tantivy-stacker", "tantivy-tokenizer-api", "tempfile", - "thiserror", + "thiserror 1.0.64", "time", "uuid", "winapi", @@ -12393,7 +12393,16 @@ version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.64", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", ] [[package]] @@ -12404,7 +12413,18 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -12591,7 +12611,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -12864,7 +12884,7 @@ dependencies = [ "proc-macro2", "prost-build 0.12.6", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -12981,7 +13001,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.64", "time", "tracing-subscriber", ] @@ -12994,7 +13014,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -13154,7 +13174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "042342584c5a7a0b833d9fc4e2bdab3f9868ddc6c4b339a1e01451c6720868bc" dependencies = [ "regex", - "thiserror", + "thiserror 1.0.64", "tree-sitter", ] @@ -13185,7 +13205,7 @@ checksum = "ccb3f1376219530a37a809751ecf65aa35fd8b9c1c4ab6d4faf5f6a9eeda2c05" dependencies = [ "memchr", "regex", - "thiserror", + "thiserror 1.0.64", "tree-sitter", ] @@ -13251,7 +13271,7 @@ checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -13279,8 +13299,8 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.79", - "thiserror", + "syn 2.0.90", + "thiserror 1.0.64", "unicode-ident", ] @@ -13297,7 +13317,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.79", + "syn 2.0.90", "typify-impl", ] @@ -13621,7 +13641,7 @@ checksum = "ee1cd046f83ea2c4e920d6ee9f7c3537ef928d75dce5d84a87c2c5d6b3999a3a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -13737,7 +13757,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -13771,7 +13791,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14288,7 +14308,7 @@ dependencies = [ "geo-types", "log", "num-traits", - "thiserror", + "thiserror 1.0.64", ] [[package]] @@ -14315,7 +14335,7 @@ dependencies = [ "ring 0.17.8", "signature", "spki 0.7.3", - "thiserror", + "thiserror 1.0.64", "zeroize", ] @@ -14367,7 +14387,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] @@ -14387,7 +14407,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.90", ] [[package]] diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 6365bbc8d041..c01560724931 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -77,7 +77,7 @@ openmetrics-parser = "0.4" opensrv-mysql = { git = "https://github.com/datafuselabs/opensrv", rev = "6bbc3b65e6b19212c4f7fc4f40c20daf6f452deb" } opentelemetry-proto.workspace = true parking_lot.workspace = true -pgwire = { version = "0.25.0", default-features = false, features = ["server-api-ring"] } +pgwire = { version = "0.28.0", 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"] } diff --git a/src/servers/src/postgres.rs b/src/servers/src/postgres.rs index 5e8de2294e18..5b844042950f 100644 --- a/src/servers/src/postgres.rs +++ b/src/servers/src/postgres.rs @@ -33,7 +33,7 @@ use ::auth::UserProviderRef; use derive_builder::Builder; use pgwire::api::auth::ServerParameterProvider; use pgwire::api::copy::NoopCopyHandler; -use pgwire::api::{ClientInfo, PgWireHandlerFactory}; +use pgwire::api::{ClientInfo, PgWireServerHandlers}; pub use server::PostgresServer; use session::context::Channel; use session::Session; @@ -90,11 +90,12 @@ pub(crate) struct MakePostgresServerHandler { pub(crate) struct PostgresServerHandler(Arc); -impl PgWireHandlerFactory for PostgresServerHandler { +impl PgWireServerHandlers for PostgresServerHandler { type StartupHandler = PostgresServerHandlerInner; type SimpleQueryHandler = PostgresServerHandlerInner; type ExtendedQueryHandler = PostgresServerHandlerInner; type CopyHandler = NoopCopyHandler; + type ErrorHandler = PostgresServerHandlerInner; fn simple_query_handler(&self) -> Arc { self.0.clone() @@ -111,6 +112,10 @@ impl PgWireHandlerFactory for PostgresServerHandler { fn copy_handler(&self) -> Arc { Arc::new(NoopCopyHandler) } + + fn error_handler(&self) -> Arc { + self.0.clone() + } } impl MakePostgresServerHandler { diff --git a/src/servers/src/postgres/auth_handler.rs b/src/servers/src/postgres/auth_handler.rs index 3f3360385840..12553c44cf10 100644 --- a/src/servers/src/postgres/auth_handler.rs +++ b/src/servers/src/postgres/auth_handler.rs @@ -177,7 +177,7 @@ impl StartupHandler for PostgresServerHandlerInner { client.metadata().get(super::METADATA_USER).cloned(), )); set_client_info(client, &self.session); - auth::finish_authentication(client, self.param_provider.as_ref()).await; + auth::finish_authentication(client, self.param_provider.as_ref()).await?; } } PgWireFrontendMessage::PasswordMessageFamily(pwd) => { @@ -194,7 +194,7 @@ impl StartupHandler for PostgresServerHandlerInner { if let Ok(Some(user_info)) = auth_result { self.session.set_user_info(user_info); set_client_info(client, &self.session); - auth::finish_authentication(client, self.param_provider.as_ref()).await; + auth::finish_authentication(client, self.param_provider.as_ref()).await?; } else { return send_error( client, diff --git a/src/servers/src/postgres/fixtures.rs b/src/servers/src/postgres/fixtures.rs index 2ca3ad02eaa7..3132a38d1b5d 100644 --- a/src/servers/src/postgres/fixtures.rs +++ b/src/servers/src/postgres/fixtures.rs @@ -78,14 +78,16 @@ pub(crate) fn process<'a>(query: &str, query_ctx: QueryContextRef) -> Option(&self, _client: &C, error: &mut PgWireError) + where + C: ClientInfo, + { + debug!("Postgres interface error {}", error) + } +} diff --git a/src/servers/src/postgres/types/bytea.rs b/src/servers/src/postgres/types/bytea.rs index 975d670f9c00..78a2a20bd8da 100644 --- a/src/servers/src/postgres/types/bytea.rs +++ b/src/servers/src/postgres/types/bytea.rs @@ -27,7 +27,6 @@ impl ToSqlText for HexOutputBytea<'_> { where Self: Sized, { - out.put_slice(b"\\x"); let _ = self.0.to_sql_text(ty, out); Ok(IsNull::No) }