From 472081aa810896b11b827836c81cb5bfd7fe88dd Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Sun, 26 Mar 2023 20:05:52 +0800 Subject: [PATCH 1/2] feat: adopt pgwire 0.12 and simplify encoding apis --- Cargo.lock | 477 ++++++++++++++++------------ src/servers/Cargo.toml | 2 +- src/servers/src/postgres/handler.rs | 182 ++++------- 3 files changed, 329 insertions(+), 332 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd3e6268f307..e3dc7aecd648 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,9 +123,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "anymap" @@ -178,9 +178,9 @@ checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -391,7 +391,7 @@ version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64951898473bfb8e22293e83a44f02874d2257514d49cd95f9aa4afcff183fbc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "serde", ] @@ -483,22 +483,22 @@ dependencies = [ [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix 0.37.3", "slab", "socket2", "waker-fn", - "windows-sys 0.42.0", ] [[package]] @@ -594,13 +594,13 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.7" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fb79c228270dcf2426e74864cabc94babb5dbab01a4314e702d2f16540e1591" +checksum = "13d8068b6ccb8b34db9de397c7043f91db8b4c66414952c6db944f238c4d3db3" dependencies = [ "async-trait", "axum-core", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "http", @@ -620,7 +620,6 @@ dependencies = [ "sync_wrapper", "tokio", "tower", - "tower-http", "tower-layer", "tower-service", ] @@ -644,9 +643,9 @@ dependencies = [ [[package]] name = "axum-macros" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404e816a138c27c29f7428ae9b1816ab880ba6923fa76a9f15296af79444a8dc" +checksum = "39bcef27b56d5cad8912d735d5ed1286f073f7bcb88cc31b38a15b514fcf8600" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -757,7 +756,7 @@ name = "benchmarks" version = "0.1.1" dependencies = [ "arrow", - "clap 4.1.8", + "clap 4.1.11", "client", "indicatif", "itertools", @@ -791,7 +790,7 @@ version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -825,6 +824,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "bitvec" version = "1.0.1" @@ -871,9 +876,9 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40f9ca3698b2e4cb7c15571db0abc5551dca417a21ae8140460b50309bb2cc62" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive", "hashbrown 0.13.2", @@ -881,9 +886,9 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598b3eacc6db9c3ee57b22707ad8f6a8d2f6d442bfe24ffeb8cbb70ca59e6a35" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", @@ -894,9 +899,9 @@ dependencies = [ [[package]] name = "borsh-derive-internal" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186b734fa1c9f6743e90c95d7233c9faab6360d1a96d4ffa19d9cfd1e9350f8a" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ "proc-macro2", "quote", @@ -905,9 +910,9 @@ dependencies = [ [[package]] name = "borsh-schema-derive-internal" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b7ff1008316626f485991b960ade129253d4034014616b94f309a15366cc49" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ "proc-macro2", "quote", @@ -1041,9 +1046,9 @@ checksum = "cf034765b7d19a011c6d619e880582bf95e8186b580e6fab56589872dd87dcf5" [[package]] name = "camino" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6031a462f977dd38968b6f23378356512feeace69cef817e1a4475108093cec3" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" dependencies = [ "serde", ] @@ -1065,7 +1070,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.17", "serde", "serde_json", ] @@ -1172,16 +1177,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", "num-integer", "num-traits", "serde", - "time 0.1.45", + "time 0.1.43", "wasm-bindgen", "winapi", ] @@ -1254,7 +1259,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap 0.11.0", "unicode-width", @@ -1268,7 +1273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive 3.2.18", "clap_lex 0.2.4", "indexmap", @@ -1280,13 +1285,13 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.8" +version = "4.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" dependencies = [ - "bitflags", - "clap_derive 4.1.8", - "clap_lex 0.3.2", + "bitflags 2.0.2", + "clap_derive 4.1.9", + "clap_lex 0.3.3", "is-terminal", "once_cell", "strsim 0.10.0", @@ -1308,9 +1313,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.1.8" +version = "4.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" +checksum = "fddf67631444a3a3e3e5ac51c36a5e01335302de677bd78759eaa90ab1f46644" dependencies = [ "heck 0.4.1", "proc-macro-error", @@ -1330,9 +1335,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] @@ -1363,7 +1368,7 @@ dependencies = [ "rand", "snafu", "substrait 0.1.1", - "substrait 0.4.1", + "substrait 0.4.2", "tokio", "tonic", "tracing", @@ -1797,9 +1802,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "core-foundation" @@ -1819,9 +1824,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" dependencies = [ "libc", ] @@ -2072,9 +2077,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ "darling_core", "darling_macro", @@ -2082,9 +2087,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", @@ -2096,9 +2101,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", @@ -2357,7 +2362,7 @@ dependencies = [ "enum_dispatch", "num", "num-traits", - "ordered-float 3.4.0", + "ordered-float 3.6.0", "paste", "serde", "serde_json", @@ -2551,9 +2556,9 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "ena" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e5d13ca2353ab7d0230988629def93914a8c4015f621f9b13ed2955614731d" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" dependencies = [ "log", ] @@ -2628,6 +2633,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2718,7 +2734,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ef1a30ae415c3a691a4f41afddc2dbcd6d70baf338368d85ebc1e8ed92cedb9" dependencies = [ "cfg-if 1.0.0", - "rustix", + "rustix 0.36.11", "windows-sys 0.45.0", ] @@ -2752,7 +2768,7 @@ version = "23.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77f5399c2c9c50ae9418e522842ad362f61ee48b346ac106807bd355a8a7c619" dependencies = [ - "bitflags", + "bitflags 1.3.2", "rustc_version 0.4.0", ] @@ -2926,9 +2942,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -2941,9 +2957,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -2957,9 +2973,9 @@ checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -2968,9 +2984,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-lite" @@ -2989,9 +3005,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", @@ -3000,21 +3016,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -3297,9 +3313,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -3346,16 +3362,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.46.0", ] [[package]] @@ -3392,9 +3408,9 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -3451,10 +3467,11 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ + "hermit-abi 0.3.1", "libc", "windows-sys 0.45.0", ] @@ -3489,13 +3506,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", - "rustix", + "rustix 0.36.11", "windows-sys 0.45.0", ] @@ -3534,11 +3551,11 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f4f04699947111ec1733e71778d763555737579e44b85844cae8e1940a1828" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.13.1", + "base64 0.21.0", "pem", "ring", "serde", @@ -3557,15 +3574,15 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.8" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" +checksum = "f34313ec00c2eb5c3c87ca6732ea02dcf3af99c3ff7a8fb622ffb99c9d860a87" dependencies = [ "ascii-canvas", - "atty", "bit-set", "diff", "ena", + "is-terminal", "itertools", "lalrpop-util", "petgraph", @@ -3580,9 +3597,9 @@ dependencies = [ [[package]] name = "lalrpop-util" -version = "0.19.8" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" +checksum = "e5c1f7869c94d214466c5fd432dfed12c379fd87786768d36455892d46b18edd" dependencies = [ "regex", ] @@ -3723,6 +3740,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" + [[package]] name = "lock_api" version = "0.4.9" @@ -4107,9 +4130,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -4266,7 +4289,7 @@ dependencies = [ "base64 0.13.1", "bigdecimal", "bindgen", - "bitflags", + "bitflags 1.3.2", "bitvec", "byteorder", "bytes", @@ -4345,7 +4368,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if 1.0.0", "libc", @@ -4358,7 +4381,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "libc", "memoffset 0.6.5", @@ -4371,7 +4394,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "libc", "memoffset 0.6.5", @@ -4621,7 +4644,7 @@ dependencies = [ "parking_lot", "percent-encoding", "pin-project", - "quick-xml", + "quick-xml 0.27.1", "reqsign", "reqwest", "serde", @@ -4736,9 +4759,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84eb1409416d254e4a9c8fa56cc24701755025b458f0fcd8e59e1f5f40c23bf" +checksum = "13a384337e997e6860ffbaa83708b2ef329fd8c54cb67a5f64d421e0f943254f" dependencies = [ "num-traits", "serde", @@ -4756,9 +4779,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "overload" @@ -4985,16 +5008,18 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e340551bf363d84f7f25be77eedf85d1fd40f7894de252647486049a781f9c4e" +checksum = "7384deed2eb0a2372259f454f1071561b3fc9ec6742fe3a8a2d2a72e8b28d9ff" dependencies = [ "async-trait", "base64 0.21.0", "bytes", + "chrono", "derive-new", "futures", "getset", + "hex", "log", "md5", "postgres-types", @@ -5207,7 +5232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "concurrent-queue", "libc", @@ -5277,9 +5302,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebcd279d20a4a0a2404a33056388e950504d891c855c7975b9a8fef75f3bf04" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", "syn", @@ -5498,7 +5523,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2df9942df2981178a930a72d442de47e2f0df18ad68e50a30f816f1848215ad0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "protobuf", "protobuf-codegen", "regex", @@ -5539,7 +5564,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" dependencies = [ - "bitflags", + "bitflags 1.3.2", "memchr", "unicase", ] @@ -5552,9 +5577,9 @@ checksum = "3b7e158a385023d209d6d5f2585c4b468f6dcb3dd5aca9b75c4f1678c05bb375" [[package]] name = "pyo3" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a3d8e8a46ab2738109347433cb7b96dffda2e4a218b03ef27090238886b147" +checksum = "cfb848f80438f926a9ebddf0a539ed6065434fd7aae03a89312a9821f81b8501" dependencies = [ "cfg-if 1.0.0", "indoc", @@ -5569,9 +5594,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75439f995d07ddfad42b192dfcf3bc66a7ecfd8b4a1f5f6f046aa5c2c5d7677d" +checksum = "98a42e7f42e917ce6664c832d5eee481ad514c98250c49e0b03b20593e2c7ed0" dependencies = [ "once_cell", "target-lexicon", @@ -5579,9 +5604,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839526a5c07a17ff44823679b68add4a58004de00512a95b6c1c98a6dcac0ee5" +checksum = "a0707f0ab26826fe4ccd59b69106e9df5e12d097457c7b8f9c0fd1d2743eec4d" dependencies = [ "libc", "pyo3-build-config", @@ -5589,9 +5614,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd44cf207476c6a9760c4653559be4f206efafb924d3e4cbf2721475fc0d6cc5" +checksum = "978d18e61465ecd389e1f235ff5a467146dc4e3c3968b90d274fe73a5dd4a438" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -5601,9 +5626,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1f43d8e30460f36350d18631ccf85ded64c059829208fe680904c65bcd0a4c" +checksum = "8e0e1128f85ce3fca66e435e08aa2089a2689c1c48ce97803e13f63124058462" dependencies = [ "proc-macro2", "quote", @@ -5621,7 +5646,7 @@ dependencies = [ "mach", "once_cell", "raw-cpuid", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -5686,6 +5711,16 @@ dependencies = [ "serde", ] +[[package]] +name = "quick-xml" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c1a97b1bc42b1d550bfb48d4262153fe400a12bab1511821736f7eac76d7e2" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" version = "1.0.23" @@ -5790,7 +5825,7 @@ version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -5827,7 +5862,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -5843,9 +5878,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -5863,9 +5898,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regress" @@ -5887,9 +5922,9 @@ dependencies = [ [[package]] name = "reqsign" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4d5fefeaaa1e64f4aabb79da4ea68bf6d0e7935ad927728280d2a8e95735fc" +checksum = "a7db6d8d2cd7fa61403d14de670f98d7cedac38143681c124943d7bb69258b3a" dependencies = [ "anyhow", "backon 0.4.0", @@ -5904,7 +5939,7 @@ dependencies = [ "log", "once_cell", "percent-encoding", - "quick-xml", + "quick-xml 0.28.1", "rand", "rsa", "rust-ini", @@ -5918,9 +5953,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" dependencies = [ "base64 0.21.0", "bytes", @@ -6040,7 +6075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "serde", ] @@ -6077,9 +6112,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.28.1" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13cf35f7140155d02ba4ec3294373d513a3c7baa8364c162b030e33c61520a8" +checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" dependencies = [ "arrayvec", "borsh", @@ -6095,9 +6130,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustc-hash" @@ -6120,7 +6155,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.17", ] [[package]] @@ -6138,15 +6173,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ - "bitflags", - "errno", + "bitflags 1.3.2", + "errno 0.2.8", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +dependencies = [ + "bitflags 1.3.2", + "errno 0.3.0", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.0", "windows-sys 0.45.0", ] @@ -6199,7 +6248,7 @@ version = "0.1.2" source = "git+https://github.com/discord9/RustPython?rev=2e126345#2e12634569d01674724490193eb9638f056e51ca" dependencies = [ "ahash 0.7.6", - "bitflags", + "bitflags 1.3.2", "indexmap", "itertools", "log", @@ -6250,7 +6299,7 @@ version = "0.1.2" source = "git+https://github.com/discord9/RustPython?rev=2e126345#2e12634569d01674724490193eb9638f056e51ca" dependencies = [ "bincode", - "bitflags", + "bitflags 1.3.2", "bstr", "itertools", "lz4_flex", @@ -6406,7 +6455,7 @@ dependencies = [ "ahash 0.7.6", "ascii", "atty", - "bitflags", + "bitflags 1.3.2", "bstr", "caseless", "cfg-if 1.0.0", @@ -6468,7 +6517,7 @@ dependencies = [ "which", "widestring", "winapi", - "windows", + "windows 0.39.0", "winreg", ] @@ -6484,7 +6533,7 @@ version = "10.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e83c32c3f3c33b08496e0d1df9ea8c64d39adb8eb36a1ebb1440c690697aef" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "clipboard-win", "dirs-next", @@ -6711,7 +6760,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -6739,9 +6788,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] @@ -6763,9 +6812,9 @@ checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc" [[package]] name = "serde" -version = "1.0.154" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] @@ -6782,9 +6831,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -6815,9 +6864,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0969fff533976baadd92e08b1d102c5a3d8a8049eadfd69d4d1e3c5b2ed189" +checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" dependencies = [ "serde", ] @@ -7205,13 +7254,14 @@ dependencies = [ [[package]] name = "sqlness" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7b1588220ac77b9b450b56505566626e3cf215077e44fddf7d1bba6ca5dbd7b" +checksum = "3f7a08af9e6ba9c662aae5f586b62fe8b23ef87f5a4c7a0c627af05cc6646667" dependencies = [ "async-trait", "derive_builder 0.11.2", "prettydiff", + "regex", "serde", "thiserror", "toml", @@ -7262,7 +7312,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a490c5c46c35dba9a6f5e7ee8e4d67e775eb2d2da0f115750b8d10e1c1ac2d28" dependencies = [ - "bitflags", + "bitflags 1.3.2", "num_enum", "optional", ] @@ -7494,16 +7544,16 @@ dependencies = [ "prost", "session", "snafu", - "substrait 0.4.1", + "substrait 0.4.2", "table", "tokio", ] [[package]] name = "substrait" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3108bf99c703e39728847cce9becff451f8a94cbc72fb5918b4e7f0543d7b06a" +checksum = "3e977fc98d1e03cf99220bb6bb96f8838ffa5c1306a8c83c1b25aa20817eb6d0" dependencies = [ "heck 0.4.1", "prost", @@ -7555,7 +7605,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -7655,7 +7705,7 @@ dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall", - "rustix", + "rustix 0.36.11", "windows-sys 0.42.0", ] @@ -7852,12 +7902,11 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -8075,9 +8124,9 @@ checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" [[package]] name = "toml_edit" -version = "0.19.4" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", "toml_datetime", @@ -8187,7 +8236,7 @@ checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ "async-compression", "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -8573,9 +8622,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-casing" @@ -8669,9 +8718,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" @@ -8761,12 +8810,11 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -8782,9 +8830,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasi" @@ -8971,6 +9019,15 @@ dependencies = [ "windows_x86_64_msvc 0.39.0", ] +[[package]] +name = "windows" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -8978,12 +9035,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -8997,24 +9054,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" @@ -9024,9 +9081,9 @@ checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" @@ -9036,9 +9093,9 @@ checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" @@ -9048,9 +9105,9 @@ checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" @@ -9060,15 +9117,15 @@ checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" @@ -9078,15 +9135,15 @@ checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee7b2c67f962bf5042bfd8b6a916178df33a26eec343ae064cb8e069f638fa6f" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 254e347209f1..11c2309fd2dc 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -44,7 +44,7 @@ once_cell = "1.16" openmetrics-parser = "0.4" opensrv-mysql = { git = "https://github.com/sunng87/opensrv", branch = "fix/buffer-overread" } parking_lot = "0.12" -pgwire = "0.10" +pgwire = "0.12" pin-project = "1.0" postgres-types = { version = "0.2", features = ["with-chrono-0_4"] } promql-parser = "0.1.0" diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index 2ce2a81937d1..14635c21322c 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -14,21 +14,21 @@ use std::ops::Deref; use std::sync::Arc; -use std::time::Duration; use async_trait::async_trait; use chrono::LocalResult; use common_query::Output; use common_recordbatch::error::Result as RecordBatchResult; use common_recordbatch::RecordBatch; -use common_time::timestamp::TimeUnit; use datatypes::prelude::{ConcreteDataType, Value}; use datatypes::schema::{Schema, SchemaRef}; use futures::{future, stream, Stream, StreamExt}; use pgwire::api::portal::Portal; -use pgwire::api::query::{ExtendedQueryHandler, SimpleQueryHandler}; -use pgwire::api::results::{query_response, DataRowEncoder, FieldFormat, FieldInfo, Response, Tag}; -use pgwire::api::stmt::{QueryParser, StoredStatement}; +use pgwire::api::query::{ExtendedQueryHandler, SimpleQueryHandler, StatementOrPortal}; +use pgwire::api::results::{ + DataRowEncoder, DescribeResponse, FieldFormat, FieldInfo, QueryResponse, Response, Tag, +}; +use pgwire::api::stmt::QueryParser; use pgwire::api::store::MemPortalStore; use pgwire::api::{ClientInfo, Type}; use pgwire::error::{ErrorInfo, PgWireError, PgWireResult}; @@ -41,7 +41,7 @@ use crate::error::{self, Error, Result}; #[async_trait] impl SimpleQueryHandler for PostgresServerHandler { - async fn do_query(&self, _client: &C, query: &str) -> PgWireResult> + async fn do_query<'a, C>(&self, _client: &C, query: &'a str) -> PgWireResult>> where C: ClientInfo + Unpin + Send + Sync, { @@ -61,10 +61,10 @@ impl SimpleQueryHandler for PostgresServerHandler { } } -fn output_to_query_response( +fn output_to_query_response<'a>( output: Result, field_format: FieldFormat, -) -> PgWireResult { +) -> PgWireResult> { match output { Ok(Output::AffectedRows(rows)) => Ok(Response::Execution(Tag::new_for_execution( "OK", @@ -86,11 +86,11 @@ fn output_to_query_response( } } -fn recordbatches_to_query_response( +fn recordbatches_to_query_response<'a, S>( recordbatches_stream: S, schema: SchemaRef, field_format: FieldFormat, -) -> PgWireResult +) -> PgWireResult> where S: Stream> + Send + Unpin + 'static, { @@ -98,8 +98,6 @@ where schema_to_pg(schema.as_ref(), field_format) .map_err(|e| PgWireError::ApiError(Box::new(e)))?, ); - let ncols = pg_schema.len(); - let pg_schema_ref = pg_schema.clone(); let data_row_stream = recordbatches_stream .map(|record_batch_result| match record_batch_result { @@ -113,30 +111,24 @@ where }) .flatten() // flatten into stream> .map(move |row| { - row.and_then(|row| match field_format { - FieldFormat::Text => { - let mut encoder = DataRowEncoder::new(ncols); - for value in row.into_iter() { - encode_text_value(&value, &mut encoder)?; - } - encoder.finish() - } - FieldFormat::Binary => { - let mut encoder = DataRowEncoder::new(ncols); - for (idx, value) in row.into_iter().enumerate() { - encode_binary_value(&value, pg_schema_ref[idx].datatype(), &mut encoder)?; - } - encoder.finish() + row.and_then(|row| { + let mut encoder = DataRowEncoder::new(pg_schema_ref.clone()); + for value in row.iter() { + encode_value(value, &mut encoder)?; } + encoder.finish() }) }); match field_format { - FieldFormat::Text => Ok(Response::Query(query_response( - Some(pg_schema.deref().clone()), + FieldFormat::Text => Ok(Response::Query(QueryResponse::new( + pg_schema, + data_row_stream, + ))), + FieldFormat::Binary => Ok(Response::Query(QueryResponse::new( + pg_schema, data_row_stream, ))), - FieldFormat::Binary => Ok(Response::Query(query_response(None, data_row_stream))), } } @@ -156,25 +148,25 @@ fn schema_to_pg(origin: &Schema, field_format: FieldFormat) -> Result>>() } -fn encode_text_value(value: &Value, builder: &mut DataRowEncoder) -> PgWireResult<()> { +fn encode_value(value: &Value, builder: &mut DataRowEncoder) -> PgWireResult<()> { match value { - Value::Null => builder.encode_text_format_field(None::<&i8>), - Value::Boolean(v) => builder.encode_text_format_field(Some(v)), - Value::UInt8(v) => builder.encode_text_format_field(Some(v)), - Value::UInt16(v) => builder.encode_text_format_field(Some(v)), - Value::UInt32(v) => builder.encode_text_format_field(Some(v)), - Value::UInt64(v) => builder.encode_text_format_field(Some(v)), - Value::Int8(v) => builder.encode_text_format_field(Some(v)), - Value::Int16(v) => builder.encode_text_format_field(Some(v)), - Value::Int32(v) => builder.encode_text_format_field(Some(v)), - Value::Int64(v) => builder.encode_text_format_field(Some(v)), - Value::Float32(v) => builder.encode_text_format_field(Some(&v.0)), - Value::Float64(v) => builder.encode_text_format_field(Some(&v.0)), - Value::String(v) => builder.encode_text_format_field(Some(&v.as_utf8())), - Value::Binary(v) => builder.encode_text_format_field(Some(&hex::encode(v.deref()))), + Value::Null => builder.encode_field(&None::<&i8>), + Value::Boolean(v) => builder.encode_field(v), + Value::UInt8(v) => builder.encode_field(&(*v as i8)), + Value::UInt16(v) => builder.encode_field(&(*v as i16)), + Value::UInt32(v) => builder.encode_field(v), + Value::UInt64(v) => builder.encode_field(&(*v as i64)), + Value::Int8(v) => builder.encode_field(v), + Value::Int16(v) => builder.encode_field(v), + Value::Int32(v) => builder.encode_field(v), + Value::Int64(v) => builder.encode_field(v), + Value::Float32(v) => builder.encode_field(&v.0), + Value::Float64(v) => builder.encode_field(&v.0), + Value::String(v) => builder.encode_field(&v.as_utf8()), + Value::Binary(v) => builder.encode_field(&v.deref()), Value::Date(v) => { if let Some(date) = v.to_chrono_date() { - builder.encode_text_format_field(Some(&date.format("%Y-%m-%d").to_string())) + builder.encode_field(&date) } else { Err(PgWireError::ApiError(Box::new(Error::Internal { err_msg: format!("Failed to convert date to postgres type {v:?}",), @@ -183,9 +175,7 @@ fn encode_text_value(value: &Value, builder: &mut DataRowEncoder) -> PgWireResul } Value::DateTime(v) => { if let Some(datetime) = v.to_chrono_datetime() { - builder.encode_text_format_field(Some( - &datetime.format("%Y-%m-%d %H:%M:%S%.6f").to_string(), - )) + builder.encode_field(&datetime) } else { Err(PgWireError::ApiError(Box::new(Error::Internal { err_msg: format!("Failed to convert date to postgres type {v:?}",), @@ -194,9 +184,7 @@ fn encode_text_value(value: &Value, builder: &mut DataRowEncoder) -> PgWireResul } Value::Timestamp(v) => { if let LocalResult::Single(datetime) = v.to_chrono_datetime() { - builder.encode_text_format_field(Some( - &datetime.format("%Y-%m-%d %H:%M:%S%.6f").to_string(), - )) + builder.encode_field(&datetime) } else { Err(PgWireError::ApiError(Box::new(Error::Internal { err_msg: format!("Failed to convert date to postgres type {v:?}",), @@ -212,64 +200,6 @@ fn encode_text_value(value: &Value, builder: &mut DataRowEncoder) -> PgWireResul } } -fn encode_binary_value( - value: &Value, - datatype: &Type, - builder: &mut DataRowEncoder, -) -> PgWireResult<()> { - match value { - Value::Null => builder.encode_binary_format_field(&None::<&i8>, datatype), - Value::Boolean(v) => builder.encode_binary_format_field(v, datatype), - Value::UInt8(v) => builder.encode_binary_format_field(&(*v as i8), datatype), - Value::UInt16(v) => builder.encode_binary_format_field(&(*v as i16), datatype), - Value::UInt32(v) => builder.encode_binary_format_field(&(*v as i32), datatype), - Value::UInt64(v) => builder.encode_binary_format_field(&(*v as i64), datatype), - Value::Int8(v) => builder.encode_binary_format_field(v, datatype), - Value::Int16(v) => builder.encode_binary_format_field(v, datatype), - Value::Int32(v) => builder.encode_binary_format_field(v, datatype), - Value::Int64(v) => builder.encode_binary_format_field(v, datatype), - Value::Float32(v) => builder.encode_binary_format_field(&v.0, datatype), - Value::Float64(v) => builder.encode_binary_format_field(&v.0, datatype), - Value::String(v) => builder.encode_binary_format_field(&v.as_utf8(), datatype), - Value::Binary(v) => builder.encode_binary_format_field(&v.deref(), datatype), - Value::Date(v) => { - if let Some(date) = v.to_chrono_date() { - builder.encode_binary_format_field(&date, datatype) - } else { - Err(PgWireError::ApiError(Box::new(Error::Internal { - err_msg: format!("Failed to convert date to postgres type {v:?}",), - }))) - } - } - Value::DateTime(v) => { - if let Some(datetime) = v.to_chrono_datetime() { - builder.encode_binary_format_field(&datetime, datatype) - } else { - Err(PgWireError::ApiError(Box::new(Error::Internal { - err_msg: format!("Failed to convert datetime to postgres type {v:?}",), - }))) - } - } - Value::Timestamp(v) => { - // convert timestamp to SystemTime - if let Some(ts) = v.convert_to(TimeUnit::Microsecond) { - let sys_time = std::time::UNIX_EPOCH + Duration::from_micros(ts.value() as u64); - builder.encode_binary_format_field(&sys_time, datatype) - } else { - Err(PgWireError::ApiError(Box::new(Error::Internal { - err_msg: format!("Failed to convert timestamp to postgres type {v:?}",), - }))) - } - } - Value::List(_) => Err(PgWireError::ApiError(Box::new(Error::Internal { - err_msg: format!( - "cannot write value {:?} in postgres protocol: unimplemented", - &value - ), - }))), - } -} - fn type_gt_to_pg(origin: &ConcreteDataType) -> Result { match origin { &ConcreteDataType::Null(_) => Ok(Type::UNKNOWN), @@ -403,12 +333,12 @@ impl ExtendedQueryHandler for PostgresServerHandler { self.query_parser.clone() } - async fn do_query( + async fn do_query<'a, C>( &self, _client: &mut C, - portal: &Portal, + portal: &'a Portal, _max_rows: usize, - ) -> PgWireResult + ) -> PgWireResult> where C: ClientInfo + Unpin + Send + Sync, { @@ -432,12 +362,21 @@ impl ExtendedQueryHandler for PostgresServerHandler { async fn do_describe( &self, _client: &mut C, - statement: &StoredStatement, - ) -> PgWireResult> + target: StatementOrPortal<'_, Self::Statement>, + ) -> PgWireResult where C: ClientInfo + Unpin + Send + Sync, { - let (stmt, _) = statement.statement(); + let (param_types, stmt) = match target { + StatementOrPortal::Statement(stmt) => { + let param_types = Some(stmt.parameter_types().clone()); + (param_types, stmt.statement()) + } + StatementOrPortal::Portal(portal) => (None, portal.statement().statement()), + }; + // get Statement part of the tuple + let (stmt, _) = stmt; + if let Some(schema) = self .query_handler .do_describe(stmt.clone(), self.query_ctx.clone()) @@ -445,9 +384,10 @@ impl ExtendedQueryHandler for PostgresServerHandler { .map_err(|e| PgWireError::ApiError(Box::new(e)))? { schema_to_pg(&schema, FieldFormat::Binary) + .map(|fields| DescribeResponse::new(param_types, fields)) .map_err(|e| PgWireError::ApiError(Box::new(e))) } else { - Ok(vec![]) + Ok(DescribeResponse::new(param_types, vec![])) } } } @@ -655,15 +595,15 @@ mod test { Value::DateTime(1000001i64.into()), Value::Timestamp(1000001i64.into()), ]; - let mut builder = DataRowEncoder::new(schema.len()); - for i in values { - assert!(encode_text_value(&i, &mut builder).is_ok()); + let mut builder = DataRowEncoder::new(Arc::new(schema)); + for i in values.iter() { + assert!(encode_value(i, &mut builder).is_ok()); } - let err = encode_text_value( + let err = encode_value( &Value::List(ListValue::new( Some(Box::default()), - ConcreteDataType::int8_datatype(), + ConcreteDataType::int16_datatype(), )), &mut builder, ) From b49914071651e0754e25c2718b2ddd7834eade40 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 27 Mar 2023 11:24:59 +0800 Subject: [PATCH 2/2] refactor: remove duplicated format match clause --- src/servers/src/postgres/handler.rs | 49 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index 14635c21322c..1768c310dbd7 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -23,10 +23,10 @@ use common_recordbatch::RecordBatch; use datatypes::prelude::{ConcreteDataType, Value}; use datatypes::schema::{Schema, SchemaRef}; use futures::{future, stream, Stream, StreamExt}; -use pgwire::api::portal::Portal; +use pgwire::api::portal::{Format, Portal}; use pgwire::api::query::{ExtendedQueryHandler, SimpleQueryHandler, StatementOrPortal}; use pgwire::api::results::{ - DataRowEncoder, DescribeResponse, FieldFormat, FieldInfo, QueryResponse, Response, Tag, + DataRowEncoder, DescribeResponse, FieldInfo, QueryResponse, Response, Tag, }; use pgwire::api::stmt::QueryParser; use pgwire::api::store::MemPortalStore; @@ -53,7 +53,7 @@ impl SimpleQueryHandler for PostgresServerHandler { let mut results = Vec::with_capacity(outputs.len()); for output in outputs { - let resp = output_to_query_response(output, FieldFormat::Text)?; + let resp = output_to_query_response(output, &Format::UnifiedText)?; results.push(resp); } @@ -63,7 +63,7 @@ impl SimpleQueryHandler for PostgresServerHandler { fn output_to_query_response<'a>( output: Result, - field_format: FieldFormat, + field_format: &Format, ) -> PgWireResult> { match output { Ok(Output::AffectedRows(rows)) => Ok(Response::Execution(Tag::new_for_execution( @@ -89,7 +89,7 @@ fn output_to_query_response<'a>( fn recordbatches_to_query_response<'a, S>( recordbatches_stream: S, schema: SchemaRef, - field_format: FieldFormat, + field_format: &Format, ) -> PgWireResult> where S: Stream> + Send + Unpin + 'static, @@ -120,29 +120,24 @@ where }) }); - match field_format { - FieldFormat::Text => Ok(Response::Query(QueryResponse::new( - pg_schema, - data_row_stream, - ))), - FieldFormat::Binary => Ok(Response::Query(QueryResponse::new( - pg_schema, - data_row_stream, - ))), - } + Ok(Response::Query(QueryResponse::new( + pg_schema, + data_row_stream, + ))) } -fn schema_to_pg(origin: &Schema, field_format: FieldFormat) -> Result> { +fn schema_to_pg(origin: &Schema, field_formats: &Format) -> Result> { origin .column_schemas() .iter() - .map(|col| { + .enumerate() + .map(|(idx, col)| { Ok(FieldInfo::new( col.name.clone(), None, None, type_gt_to_pg(&col.data_type)?, - field_format, + field_formats.format_for(idx), )) }) .collect::>>() @@ -356,7 +351,7 @@ impl ExtendedQueryHandler for PostgresServerHandler { .await .remove(0); - output_to_query_response(output, FieldFormat::Binary) + output_to_query_response(output, portal.result_column_format()) } async fn do_describe( @@ -367,12 +362,16 @@ impl ExtendedQueryHandler for PostgresServerHandler { where C: ClientInfo + Unpin + Send + Sync, { - let (param_types, stmt) = match target { + let (param_types, stmt, format) = match target { StatementOrPortal::Statement(stmt) => { let param_types = Some(stmt.parameter_types().clone()); - (param_types, stmt.statement()) + (param_types, stmt.statement(), &Format::UnifiedBinary) } - StatementOrPortal::Portal(portal) => (None, portal.statement().statement()), + StatementOrPortal::Portal(portal) => ( + None, + portal.statement().statement(), + portal.result_column_format(), + ), }; // get Statement part of the tuple let (stmt, _) = stmt; @@ -383,7 +382,7 @@ impl ExtendedQueryHandler for PostgresServerHandler { .await .map_err(|e| PgWireError::ApiError(Box::new(e)))? { - schema_to_pg(&schema, FieldFormat::Binary) + schema_to_pg(&schema, format) .map(|fields| DescribeResponse::new(param_types, fields)) .map_err(|e| PgWireError::ApiError(Box::new(e))) } else { @@ -396,7 +395,7 @@ impl ExtendedQueryHandler for PostgresServerHandler { mod test { use datatypes::schema::{ColumnSchema, Schema}; use datatypes::value::ListValue; - use pgwire::api::results::FieldInfo; + use pgwire::api::results::{FieldFormat, FieldInfo}; use pgwire::api::Type; use super::*; @@ -474,7 +473,7 @@ mod test { FieldInfo::new("dates".into(), None, None, Type::DATE, FieldFormat::Text), ]; let schema = Schema::new(column_schemas); - let fs = schema_to_pg(&schema, FieldFormat::Text).unwrap(); + let fs = schema_to_pg(&schema, &Format::UnifiedText).unwrap(); assert_eq!(fs, pg_field_info); }