diff --git a/Cargo.lock b/Cargo.lock index ab5043939a94..418e68a88ab0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -226,7 +226,7 @@ dependencies = [ "paste", "prost 0.12.6", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "tonic-build", ] @@ -459,7 +459,7 @@ dependencies = [ "arrow-schema", "chrono", "half 2.4.1", - "indexmap 2.5.0", + "indexmap 2.6.0", "lexical-core", "num", "serde", @@ -534,7 +534,7 @@ dependencies = [ "memchr", "num", "regex", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -607,11 +607,11 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "7e614738943d3f68c628ae3dbce7c3daffb196665f82f8c8ea6b65de73c79429" dependencies = [ - "brotli 6.0.0", + "brotli 7.0.0", "bzip2", "flate2", "futures-core", @@ -654,14 +654,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -670,13 +670,13 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -687,13 +687,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -778,7 +778,7 @@ dependencies = [ "digest", "notify", "sha1", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "tokio", ] @@ -791,7 +791,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -802,9 +802,9 @@ checksum = "7460f7dd8e100147b82a63afca1a20eb6c231ee36b90ba7272e14951cb58af59" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "autotools" @@ -890,7 +890,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -976,6 +976,17 @@ dependencies = [ "smallvec", ] +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "bigdecimal" version = "0.4.5" @@ -998,6 +1009,25 @@ dependencies = [ "serde", ] +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", +] + [[package]] name = "bindgen" version = "0.69.4" @@ -1017,7 +1047,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.79", "which", ] @@ -1036,7 +1066,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1160,7 +1190,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "syn_derive", ] @@ -1177,9 +1207,9 @@ dependencies = [ [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1224,7 +1254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", - "regex-automata 0.4.7", + "regex-automata 0.4.8", "serde", ] @@ -1237,6 +1267,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "bufstream" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" + [[package]] name = "build-data" version = "0.2.1" @@ -1346,7 +1382,7 @@ dependencies = [ "common-macro", "common-meta", "moka", - "snafu 0.8.4", + "snafu 0.8.5", "substrait 0.9.3", ] @@ -1416,7 +1452,7 @@ dependencies = [ "rustc-hash 2.0.0", "serde_json", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "store-api", "table", @@ -1435,9 +1471,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" dependencies = [ "jobserver", "libc", @@ -1504,7 +1540,7 @@ version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6026d8cd82ada8bbcfe337805dd1eb6afdc9e80fa4d57e977b3a36315e0c5525" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "lazy_static", "num-traits", "regex", @@ -1654,9 +1690,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -1664,9 +1700,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -1683,7 +1719,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1731,7 +1767,7 @@ dependencies = [ "query", "rand", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "substrait 0.37.3", "substrait 0.9.3", "tokio", @@ -1771,7 +1807,7 @@ dependencies = [ "cache", "catalog", "chrono", - "clap 4.5.18", + "clap 4.5.19", "client", "common-base", "common-catalog", @@ -1818,7 +1854,7 @@ dependencies = [ "servers", "session", "similar-asserts", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "substrait 0.9.3", "table", @@ -1877,7 +1913,7 @@ dependencies = [ "futures", "paste", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "toml 0.8.19", "zeroize", ] @@ -1889,7 +1925,7 @@ dependencies = [ "chrono", "common-error", "common-macro", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", ] @@ -1909,7 +1945,7 @@ dependencies = [ "num_cpus", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "sysinfo", "temp-env", "tempfile", @@ -1945,7 +1981,7 @@ dependencies = [ "rand", "regex", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "strum 0.25.0", "tokio", "tokio-util", @@ -1957,20 +1993,20 @@ dependencies = [ name = "common-decimal" version = "0.9.3" dependencies = [ - "bigdecimal", + "bigdecimal 0.4.5", "common-error", "common-macro", "rust_decimal", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", ] [[package]] name = "common-error" version = "0.9.3" dependencies = [ - "snafu 0.8.4", + "snafu 0.8.5", "strum 0.25.0", "tonic 0.11.0", ] @@ -1986,7 +2022,7 @@ dependencies = [ "common-macro", "common-query", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", ] @@ -2021,7 +2057,7 @@ dependencies = [ "serde", "serde_json", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "statrs", "store-api", @@ -2066,7 +2102,7 @@ dependencies = [ "lazy_static", "prost 0.12.6", "rand", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "tonic 0.11.0", "tower", @@ -2086,7 +2122,7 @@ dependencies = [ "datatypes", "paste", "prost 0.12.6", - "snafu 0.8.4", + "snafu 0.8.5", "table", ] @@ -2099,9 +2135,9 @@ dependencies = [ "datatypes", "proc-macro2", "quote", - "snafu 0.8.4", + "snafu 0.8.5", "static_assertions", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2110,7 +2146,7 @@ version = "0.9.3" dependencies = [ "common-error", "common-macro", - "snafu 0.8.4", + "snafu 0.8.5", "tempfile", "tikv-jemalloc-ctl", "tikv-jemalloc-sys", @@ -2163,7 +2199,7 @@ dependencies = [ "serde_json", "serde_with", "session", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "strum 0.25.0", "table", @@ -2200,7 +2236,7 @@ dependencies = [ "serde", "serde_json", "smallvec", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "uuid", ] @@ -2231,7 +2267,7 @@ dependencies = [ "datatypes", "futures-util", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlparser_derive 0.1.1", "statrs", @@ -2254,7 +2290,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", ] @@ -2272,7 +2308,7 @@ dependencies = [ "paste", "prometheus", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "tokio-metrics", "tokio-metrics-collector", @@ -2333,7 +2369,7 @@ dependencies = [ "rand", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", ] [[package]] @@ -2361,11 +2397,11 @@ dependencies = [ "rskafka", "rustls 0.23.13", "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_with", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "toml 0.8.19", ] @@ -2624,7 +2660,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.5.18", + "clap 4.5.19", "criterion-plot", "is-terminal", "itertools 0.10.5", @@ -2809,7 +2845,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2831,7 +2867,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2863,7 +2899,7 @@ dependencies = [ "arrow-array", "arrow-ipc", "arrow-schema", - "async-compression 0.4.12", + "async-compression 0.4.13", "async-trait", "bytes", "bzip2", @@ -2886,7 +2922,7 @@ dependencies = [ "glob", "half 2.4.1", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "num_cpus", @@ -3045,10 +3081,10 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -3073,7 +3109,7 @@ dependencies = [ "half 2.4.1", "hashbrown 0.14.5", "hex", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "paste", @@ -3115,7 +3151,7 @@ dependencies = [ "futures", "half 2.4.1", "hashbrown 0.14.5", - "indexmap 2.5.0", + "indexmap 2.6.0", "itertools 0.12.1", "log", "once_cell", @@ -3206,7 +3242,7 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "substrait 0.9.3", "table", @@ -3239,7 +3275,7 @@ dependencies = [ "paste", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", ] [[package]] @@ -3322,7 +3358,7 @@ checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3333,7 +3369,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3396,7 +3432,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3426,7 +3462,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" dependencies = [ "derive_builder_core 0.20.1", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3446,10 +3482,21 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "unicode-xid", ] +[[package]] +name = "derive_utils" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65f152f4b8559c4da5d574bafc7af85454d706b4c5fe8b530d508cacbb6807ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "diff" version = "0.1.13" @@ -3604,7 +3651,7 @@ dependencies = [ "serde", "thiserror", "time", - "winnow 0.6.18", + "winnow 0.6.20", ] [[package]] @@ -3658,7 +3705,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3670,7 +3717,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3834,7 +3881,7 @@ dependencies = [ "object-store", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "table", "tokio", @@ -3888,9 +3935,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "libz-sys", @@ -3968,7 +4015,7 @@ dependencies = [ "servers", "session", "smallvec", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "strum 0.25.0", "substrait 0.9.3", @@ -3992,6 +4039,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -4067,7 +4129,7 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", @@ -4109,7 +4171,7 @@ checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3" dependencies = [ "frunk_proc_macro_helpers", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4121,7 +4183,7 @@ dependencies = [ "frunk_core", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4133,7 +4195,7 @@ dependencies = [ "frunk_core", "frunk_proc_macro_helpers", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4263,7 +4325,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4437,7 +4499,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -4499,6 +4561,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hashlink" version = "0.8.4" @@ -4734,9 +4802,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -4817,7 +4885,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4832,7 +4900,7 @@ dependencies = [ "rust-sitter", "rust-sitter-tool", "slotmap", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4841,7 +4909,7 @@ version = "0.6.2" source = "git+https://github.com/GreptimeTeam/hydroflow.git?branch=main#b072ee026f97f8537165e1fb247101e0ab2fb320" dependencies = [ "auto_impl", - "clap 4.5.18", + "clap 4.5.19", "data-encoding", "itertools 0.10.5", "prettyplease", @@ -4851,7 +4919,7 @@ dependencies = [ "serde", "serde_json", "slotmap", - "syn 2.0.77", + "syn 2.0.79", "webbrowser", ] @@ -4865,7 +4933,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4977,9 +5045,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -4990,7 +5058,6 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", "tower-service", "tracing", ] @@ -5081,9 +5148,9 @@ dependencies = [ "prost 0.12.6", "rand", "regex", - "regex-automata 0.4.7", + "regex-automata 0.4.8", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "tantivy", "tantivy-jieba", "tempfile", @@ -5105,12 +5172,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -5127,7 +5194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash 0.8.11", - "indexmap 2.5.0", + "indexmap 2.6.0", "is-terminal", "itoa", "log", @@ -5209,6 +5276,15 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" +[[package]] +name = "io-enum" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b53d712d99a73eec59ee5e4fe6057f8052142d38eeafbbffcb06b36d738a6e" +dependencies = [ + "derive_utils", +] + [[package]] name = "ipnet" version = "2.10.0" @@ -5217,9 +5293,9 @@ checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "iri-string" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c25163201be6ded9e686703e85532f8f852ea1f92ba625cb3c51f7fe6d07a4a" +checksum = "44bd7eced44cfe2cebc674adb2a7124a754a4b5269288d22e9f39f8fada3562d" dependencies = [ "memchr", "serde", @@ -5399,7 +5475,7 @@ dependencies = [ "fast-float", "itoa", "nom", - "ordered-float 4.2.2", + "ordered-float 4.3.0", "rand", "ryu", "serde_json", @@ -5439,7 +5515,7 @@ checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" dependencies = [ "base64 0.21.7", "js-sys", - "pem", + "pem 3.0.4", "ring 0.17.8", "serde", "serde_json", @@ -5474,7 +5550,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", ] [[package]] @@ -5533,9 +5609,9 @@ dependencies = [ "jsonpath-rust", "k8s-openapi", "kube-core", - "pem", + "pem 3.0.4", "rustls 0.23.13", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "secrecy", "serde", "serde_json", @@ -5575,7 +5651,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5667,7 +5743,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5691,6 +5767,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2cdeb66e45e9f36bfad5bbdb4d2384e70936afbee843c6f6543f0c551ebb25" +[[package]] +name = "lexical" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6" +dependencies = [ + "lexical-core", +] + [[package]] name = "lexical-core" version = "0.8.5" @@ -5757,9 +5842,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libfuzzer-sys" @@ -5818,7 +5903,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", ] [[package]] @@ -5906,7 +5991,7 @@ dependencies = [ "rskafka", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "tokio", "uuid", @@ -5925,7 +6010,7 @@ dependencies = [ "num-traits", "quote", "regex", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "serde", "vergen", ] @@ -5940,7 +6025,7 @@ dependencies = [ "cactus", "cfgrammar", "filetime", - "indexmap 2.5.0", + "indexmap 2.6.0", "lazy_static", "lrtable", "num-traits", @@ -5966,6 +6051,15 @@ dependencies = [ "vob", ] +[[package]] +name = "lru" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +dependencies = [ + "hashbrown 0.12.3", +] + [[package]] name = "lru" version = "0.12.4" @@ -5977,18 +6071,18 @@ dependencies = [ [[package]] name = "lz4" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a231296ca742e418c43660cb68e082486ff2538e8db432bc818580f3965025ed" +checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" dependencies = [ "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.11.0" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb44a01837a858d47e5a630d2ccf304c8efcc4b83b8f9f75b7a9ee4fcc6e57d" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -6200,7 +6294,7 @@ dependencies = [ "meta-srv", "rand", "serde", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "tokio-stream", "tonic 0.11.0", @@ -6216,7 +6310,7 @@ dependencies = [ "api", "async-trait", "chrono", - "clap 4.5.18", + "clap 4.5.19", "client", "common-base", "common-catalog", @@ -6254,7 +6348,7 @@ dependencies = [ "serde_json", "servers", "session", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "table", "tokio", @@ -6311,7 +6405,7 @@ dependencies = [ "object-store", "prometheus", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "tokio", ] @@ -6449,7 +6543,7 @@ dependencies = [ "serde_with", "session", "smallvec", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "strum 0.25.0", "table", @@ -6556,6 +6650,32 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" +[[package]] +name = "mysql" +version = "23.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f11339ca5c251941805d51362a07823605a80586ced92914ab7de84fba813f" +dependencies = [ + "bufstream", + "bytes", + "crossbeam", + "flate2", + "io-enum", + "libc", + "lru 0.8.1", + "mysql_common 0.29.2", + "named_pipe", + "native-tls", + "once_cell", + "pem 1.1.1", + "percent-encoding", + "serde", + "serde_json", + "socket2 0.4.10", + "twox-hash", + "url", +] + [[package]] name = "mysql-common-derive" version = "0.30.2" @@ -6569,7 +6689,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "termcolor", "thiserror", ] @@ -6587,7 +6707,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "termcolor", "thiserror", ] @@ -6606,11 +6726,11 @@ dependencies = [ "futures-util", "keyed_priority_queue", "lazy_static", - "lru", + "lru 0.12.4", "mio 0.8.11", "mysql_common 0.31.0", "once_cell", - "pem", + "pem 3.0.4", "percent-encoding", "pin-project", "rand", @@ -6629,6 +6749,43 @@ dependencies = [ "webpki-roots 0.25.4", ] +[[package]] +name = "mysql_common" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9006c95034ccf7b903d955f210469119f6c3477fc9c9e7a7845ce38a3e665c2a" +dependencies = [ + "base64 0.13.1", + "bigdecimal 0.3.1", + "bindgen 0.59.2", + "bitflags 1.3.2", + "bitvec", + "byteorder", + "bytes", + "cc", + "cmake", + "crc32fast", + "flate2", + "frunk", + "lazy_static", + "lexical", + "num-bigint", + "num-traits", + "rand", + "regex", + "rust_decimal", + "saturating", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "subprocess", + "thiserror", + "time", + "uuid", +] + [[package]] name = "mysql_common" version = "0.31.0" @@ -6636,7 +6793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06f19e4cfa0ab5a76b627cec2d81331c49b034988eaf302c3bafeada684eadef" dependencies = [ "base64 0.21.7", - "bigdecimal", + "bigdecimal 0.4.5", "bindgen 0.70.1", "bitflags 2.6.0", "bitvec", @@ -6675,7 +6832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478b0ff3f7d67b79da2b96f56f334431aef65e15ba4b29dd74a4236e29582bdc" dependencies = [ "base64 0.21.7", - "bigdecimal", + "bigdecimal 0.4.5", "bindgen 0.70.1", "bitflags 2.6.0", "bitvec", @@ -6737,6 +6894,32 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "named_pipe" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9c443cce91fc3e12f017290db75dde490d685cdaaf508d7159d7cf41f0eb2b" +dependencies = [ + "winapi", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -6916,7 +7099,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -7078,9 +7261,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "oneshot" @@ -7153,12 +7339,50 @@ dependencies = [ "tokio-rustls 0.26.0", ] +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "opentelemetry" version = "0.21.0" @@ -7167,7 +7391,7 @@ checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ "futures-core", "futures-sink", - "indexmap 2.5.0", + "indexmap 2.6.0", "js-sys", "once_cell", "pin-project-lite", @@ -7258,7 +7482,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry 0.21.0", - "ordered-float 4.2.2", + "ordered-float 4.3.0", "percent-encoding", "rand", "thiserror", @@ -7280,7 +7504,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry 0.22.0", - "ordered-float 4.2.2", + "ordered-float 4.3.0", "percent-encoding", "rand", "thiserror", @@ -7329,7 +7553,7 @@ dependencies = [ "regex", "serde_json", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", @@ -7392,9 +7616,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" dependencies = [ "num-traits", ] @@ -7531,7 +7755,7 @@ dependencies = [ "cfg-if", "libc", "petgraph", - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", "smallvec", "thread-id", "windows-targets 0.52.6", @@ -7597,7 +7821,7 @@ dependencies = [ "itertools 0.10.5", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "store-api", @@ -7669,6 +7893,21 @@ dependencies = [ "hmac", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "pem" version = "3.0.4" @@ -7740,7 +7979,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -7761,7 +8000,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.5.0", + "indexmap 2.6.0", ] [[package]] @@ -7852,7 +8091,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -7915,7 +8154,7 @@ dependencies = [ "serde", "serde_json", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "table", "tokio", @@ -7996,9 +8235,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" @@ -8037,7 +8276,7 @@ dependencies = [ "datanode", "frontend", "meta-srv", - "snafu 0.8.4", + "snafu 0.8.5", ] [[package]] @@ -8053,9 +8292,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d30538d42559de6b034bc76fd6dd4c38961b1ee5c6c56e3808c50128fdbc22ce" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "postgres-protocol" @@ -8195,7 +8434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -8214,7 +8453,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.21", + "toml_edit 0.22.22", ] [[package]] @@ -8324,7 +8563,7 @@ dependencies = [ "prost 0.12.6", "query", "session", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", ] @@ -8388,7 +8627,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.77", + "syn 2.0.79", "tempfile", ] @@ -8434,7 +8673,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -8447,7 +8686,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -8541,7 +8780,7 @@ dependencies = [ name = "puffin" version = "0.9.3" dependencies = [ - "async-compression 0.4.12", + "async-compression 0.4.13", "async-trait", "async-walkdir", "auto_impl", @@ -8560,7 +8799,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "snafu 0.8.4", + "snafu 0.8.5", "tokio", "tokio-util", "uuid", @@ -8628,7 +8867,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -8641,7 +8880,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -8717,7 +8956,7 @@ dependencies = [ "rand", "regex", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "statrs", @@ -8909,9 +9148,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.1.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ "bitflags 2.6.0", ] @@ -8959,9 +9198,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -8994,19 +9233,19 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -9020,13 +9259,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -9043,9 +9282,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "regress" @@ -9105,9 +9344,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64 0.22.1", "bytes", @@ -9129,8 +9368,8 @@ dependencies = [ "pin-project-lite", "quinn", "rustls 0.23.13", - "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", @@ -9372,7 +9611,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.77", + "syn 2.0.79", "unicode-ident", ] @@ -9384,7 +9623,7 @@ checksum = "b3a8fb4672e840a587a66fc577a5491375df51ddb88f2a2c2a792598c326fe14" dependencies = [ "quote", "rand", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -9407,7 +9646,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.77", + "syn 2.0.79", "walkdir", ] @@ -9617,7 +9856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -9630,7 +9869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -9647,19 +9886,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -10134,7 +10372,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10192,7 +10430,7 @@ dependencies = [ "serde", "servers", "session", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "table", "tokio", @@ -10235,7 +10473,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10313,7 +10551,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10324,7 +10562,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10333,7 +10571,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -10358,14 +10596,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -10379,7 +10617,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10396,15 +10634,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -10414,14 +10652,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10430,7 +10668,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -10516,14 +10754,14 @@ dependencies = [ "reqwest", "rust-embed", "rustls 0.23.13", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schemars", "script", "serde", "serde_json", "session", - "snafu 0.8.4", + "snafu 0.8.5", "snap", "sql", "strum 0.25.0", @@ -10560,7 +10798,7 @@ dependencies = [ "common-time", "derive_builder 0.12.0", "meter-core", - "snafu 0.8.4", + "snafu 0.8.5", "sql", ] @@ -10766,11 +11004,11 @@ dependencies = [ [[package]] name = "snafu" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d" +checksum = "223891c85e2a29c3fe8fb900c1fae5e69c2e42415e3177752e8718475efa5019" dependencies = [ - "snafu-derive 0.8.4", + "snafu-derive 0.8.5", ] [[package]] @@ -10787,14 +11025,14 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5" +checksum = "03c3c6b7927ffe7ecaa769ee0e3994da3b8cafc8f444578982c83ecb161af917" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10894,7 +11132,7 @@ dependencies = [ "lazy_static", "regex", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlparser_derive 0.1.1", "table", @@ -10933,18 +11171,21 @@ name = "sqlness-runner" version = "0.9.3" dependencies = [ "async-trait", - "clap 4.5.18", + "clap 4.5.19", "client", "common-error", "common-query", "common-recordbatch", "common-time", + "datatypes", + "mysql", "serde", "serde_json", "sqlness", "tempfile", "tinytemplate", "tokio", + "tokio-postgres", ] [[package]] @@ -10988,7 +11229,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -10998,7 +11239,7 @@ source = "git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09 dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -11167,7 +11408,7 @@ dependencies = [ "futures", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "strum 0.25.0", "tokio", ] @@ -11288,7 +11529,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -11301,7 +11542,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -11330,7 +11571,7 @@ dependencies = [ "datatypes", "promql", "prost 0.12.6", - "snafu 0.8.4", + "snafu 0.8.5", "substrait 0.37.3", "tokio", ] @@ -11354,7 +11595,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "syn 2.0.77", + "syn 2.0.79", "typify", "walkdir", ] @@ -11375,7 +11616,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "syn 2.0.77", + "syn 2.0.79", "typify", "walkdir", ] @@ -11388,9 +11629,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "symbolic-common" -version = "12.11.1" +version = "12.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdf97c441f18a4f92425b896a4ec7a27e03631a0b1047ec4e34e9916a9a167e" +checksum = "366f1b4c6baf6cfefc234bbd4899535fca0b06c74443039a73f6dfb2fad88d77" dependencies = [ "debugid", "memmap2 0.9.5", @@ -11400,9 +11641,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.11.1" +version = "12.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8ece6b129e97e53d1fbb3f61d33a6a9e5369b11d01228c068094d6d134eaea" +checksum = "aba05ba5b9962ea5617baf556293720a8b2d0a282aa14ee4bf10e22efc7da8c8" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -11422,9 +11663,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -11459,7 +11700,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -11545,7 +11786,7 @@ dependencies = [ "paste", "serde", "serde_json", - "snafu 0.8.4", + "snafu 0.8.5", "store-api", "tokio", "tokio-util", @@ -11579,7 +11820,7 @@ dependencies = [ "itertools 0.12.1", "levenshtein_automata", "log", - "lru", + "lru 0.12.4", "lz4_flex 0.11.3", "measure_time", "memmap2 0.9.5", @@ -11654,7 +11895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d60769b80ad7953d8a7b2c70cdfe722bbcdcac6bccc8ac934c40c034d866fc18" dependencies = [ "byteorder", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", "utf8-ranges", ] @@ -11733,9 +11974,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -11811,7 +12052,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlparser 0.45.0 (git+https://github.com/GreptimeTeam/sqlparser-rs.git?rev=54a267ac89c09b11c0c88934690530807185d3e7)", "sqlx", @@ -11834,7 +12075,7 @@ dependencies = [ "cache", "catalog", "chrono", - "clap 4.5.18", + "clap 4.5.19", "client", "cmd", "common-base", @@ -11881,7 +12122,7 @@ dependencies = [ "servers", "session", "similar-asserts", - "snafu 0.8.4", + "snafu 0.8.5", "sql", "sqlx", "store-api", @@ -11937,7 +12178,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -12124,7 +12365,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -12291,7 +12532,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.21", + "toml_edit 0.22.22", ] [[package]] @@ -12309,22 +12550,22 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow 0.6.20", ] [[package]] @@ -12375,7 +12616,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.12.6", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -12397,7 +12638,7 @@ dependencies = [ "proc-macro2", "prost-build 0.12.6", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -12440,7 +12681,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "async-compression 0.4.12", + "async-compression 0.4.13", "base64 0.21.7", "bitflags 2.6.0", "bytes", @@ -12527,7 +12768,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -12784,7 +13025,7 @@ checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -12812,7 +13053,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.77", + "syn 2.0.79", "thiserror", "unicode-ident", ] @@ -12830,7 +13071,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.77", + "syn 2.0.79", "typify-impl", ] @@ -12871,9 +13112,9 @@ checksum = "fe4fa6e588762366f1eb4991ce59ad1b93651d0b769dfb4e4d1c5c4b943d1159" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uname" @@ -13011,9 +13252,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-casing" @@ -13038,9 +13279,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unicode-segmentation" @@ -13154,7 +13395,7 @@ checksum = "ee1cd046f83ea2c4e920d6ee9f7c3537ef928d75dce5d84a87c2c5d6b3999a3a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -13270,7 +13511,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -13304,7 +13545,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13317,9 +13558,9 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", @@ -13427,7 +13668,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", "wasite", "web-sys", ] @@ -13796,9 +14037,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -13832,7 +14073,7 @@ dependencies = [ "chrono", "der 0.7.9", "hex", - "pem", + "pem 3.0.4", "ring 0.17.8", "signature", "spki 0.7.3", @@ -13888,7 +14129,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -13908,7 +14149,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] diff --git a/src/log-store/src/kafka/client_manager.rs b/src/log-store/src/kafka/client_manager.rs index 6337683c9392..589d5a900efb 100644 --- a/src/log-store/src/kafka/client_manager.rs +++ b/src/log-store/src/kafka/client_manager.rs @@ -132,7 +132,7 @@ impl ClientManager { } async fn try_create_client(&self, provider: &Arc) -> Result { - // Sets to Retry to retry connecting if the kafka cluter replies with an UnknownTopic error. + // Sets to Retry to retry connecting if the kafka cluster replies with an UnknownTopic error. // That's because the topic is believed to exist as the metasrv is expected to create required topics upon start. // The reconnecting won't stop until succeed or a different error returns. let client = self diff --git a/src/script/src/python/rspython/builtins/test.rs b/src/script/src/python/rspython/builtins/test.rs index 3908ab9eef54..541f28c66aef 100644 --- a/src/script/src/python/rspython/builtins/test.rs +++ b/src/script/src/python/rspython/builtins/test.rs @@ -145,7 +145,7 @@ enum PyValue { } impl PyValue { - /// compare if results is just as expect, not using PartialEq because it is not transtive .e.g. [1,2,3] == len(3) == [4,5,6] + /// compare if results is just as expect, not using PartialEq because it is not transitive .e.g. [1,2,3] == len(3) == [4,5,6] fn just_as_expect(&self, other: &Self) -> bool { match (self, other) { (PyValue::FloatVec(a), PyValue::FloatVec(b)) => a diff --git a/tests/cases/standalone/common/mysql.result b/tests/cases/standalone/common/mysql.result new file mode 100644 index 000000000000..980990fa7a89 --- /dev/null +++ b/tests/cases/standalone/common/mysql.result @@ -0,0 +1,29 @@ +-- SQLNESS PROTOCOL MYSQL +SELECt @@tx_isolation; + ++-----------------+ +| @@tx_isolation; | ++-----------------+ +| 0 | ++-----------------+ + +-- SQLNESS PROTOCOL MYSQL +SELECT @@version_comment; + ++--------------------+ +| @@version_comment; | ++--------------------+ +| 0 | ++--------------------+ + +-- SQLNESS PROTOCOL MYSQL +SHOW DATABASES; + ++--------------------+ +| Database | ++--------------------+ +| greptime_private | +| information_schema | +| public | ++--------------------+ + diff --git a/tests/cases/standalone/common/mysql.sql b/tests/cases/standalone/common/mysql.sql new file mode 100644 index 000000000000..31b2db23f9ec --- /dev/null +++ b/tests/cases/standalone/common/mysql.sql @@ -0,0 +1,8 @@ +-- SQLNESS PROTOCOL MYSQL +SELECt @@tx_isolation; + +-- SQLNESS PROTOCOL MYSQL +SELECT @@version_comment; + +-- SQLNESS PROTOCOL MYSQL +SHOW DATABASES; diff --git a/tests/cases/standalone/common/system/pg_catalog.result b/tests/cases/standalone/common/system/pg_catalog.result index d30355352fab..4e3e217b2e9b 100644 --- a/tests/cases/standalone/common/system/pg_catalog.result +++ b/tests/cases/standalone/common/system/pg_catalog.result @@ -3,11 +3,49 @@ create database pg_catalog; Error: 1004(InvalidArguments), Schema pg_catalog already exists -select * from pg_catalog.pg_type order by oid; +-- make sure all the pg_catalog tables are only visible to postgres +select * from pg_catalog.pg_class; + +Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class + +select * from pg_catalog.pg_namespace; + +Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_namespace + +select * from pg_catalog.pg_type; Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_type +-- SQLNESS PROTOCOL POSTGRES +select * from pg_catalog.pg_type order by oid; + ++-----+-----------+--------+ +| oid | typname | typlen | ++-----+-----------+--------+ +| 1 | String | -1 | +| 2 | Binary | -1 | +| 3 | Int8 | 1 | +| 4 | Int16 | 2 | +| 5 | Int32 | 4 | +| 6 | Int64 | 8 | +| 7 | UInt8 | 1 | +| 8 | UInt16 | 2 | +| 9 | UInt32 | 4 | +| 10 | UInt64 | 8 | +| 11 | Float32 | 4 | +| 12 | Float64 | 8 | +| 13 | Decimal | 16 | +| 14 | Date | 4 | +| 15 | DateTime | 8 | +| 16 | Timestamp | 8 | +| 17 | Time | 8 | +| 18 | Duration | 8 | +| 19 | Interval | 16 | +| 20 | List | -1 | ++-----+-----------+--------+ + -- \d +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -21,9 +59,14 @@ WHERE c.relkind IN ('r','p','v','m','S','f','') AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++--------+---------+-------+-------+ +| Schema | Name | Type | Owner | ++--------+---------+-------+-------+ +| public | numbers | table | | ++--------+---------+-------+-------+ -- \dt +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -37,22 +80,36 @@ WHERE c.relkind IN ('r','p','') AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++--------+---------+-------+-------+ +| Schema | Name | Type | Owner | ++--------+---------+-------+-------+ +| public | numbers | table | | ++--------+---------+-------+-------+ -- make sure oid of namespace keep stable +-- SQLNESS PROTOCOL POSTGRES SELECT * FROM pg_namespace ORDER BY oid; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.public.pg_namespace ++------------+--------------------+ +| oid | nspname | ++------------+--------------------+ +| 667359454 | pg_catalog | +| 3174397350 | information_schema | +| 3338153620 | greptime_private | +| 3927743705 | public | ++------------+--------------------+ -create -database my_db; +-- SQLNESS PROTOCOL POSTGRES +create database my_db; Affected Rows: 1 +-- SQLNESS PROTOCOL POSTGRES use my_db; -Affected Rows: 0 + +-- SQLNESS PROTOCOL POSTGRES create table foo ( ts TIMESTAMP TIME INDEX @@ -61,6 +118,7 @@ create table foo Affected Rows: 0 -- show tables in `my_db` +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace = ( @@ -69,9 +127,14 @@ where relnamespace = ( where nspname = 'my_db' ); -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++---------+ +| relname | ++---------+ +| foo | ++---------+ -- \dt +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -85,9 +148,15 @@ WHERE c.relkind IN ('r','p','') AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1,2; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++--------+---------+-------+-------+ +| Schema | Name | Type | Owner | ++--------+---------+-------+-------+ +| my_db | foo | table | | +| public | numbers | table | | ++--------+---------+-------+-------+ -- show tables in `my_db`, `public` +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace in ( @@ -97,8 +166,14 @@ where relnamespace in ( ) order by relname; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++---------+ +| relname | ++---------+ +| foo | +| numbers | ++---------+ +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace in ( @@ -107,8 +182,13 @@ where relnamespace in ( where nspname like 'my%' ); -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++---------+ +| relname | ++---------+ +| foo | ++---------+ +-- SQLNESS PROTOCOL POSTGRES select relnamespace, relname, relkind from pg_catalog.pg_class where relnamespace in ( @@ -120,34 +200,58 @@ where relnamespace in ( ) order by relnamespace, relname; -Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.pg_catalog.pg_class ++--------------+---------+---------+ +| relnamespace | relname | relkind | ++--------------+---------+---------+ +| 434869349 | foo | r | ++--------------+---------+---------+ +-- SQLNESS PROTOCOL POSTGRES use public; -Affected Rows: 0 + +-- SQLNESS PROTOCOL POSTGRES drop schema my_db; Affected Rows: 0 +-- SQLNESS PROTOCOL POSTGRES use pg_catalog; -Affected Rows: 0 + -- pg_class +-- SQLNESS PROTOCOL POSTGRES desc table pg_class; -Error: 4001(TableNotFound), Table not found: pg_class - ++--------------+--------+-----+------+---------+---------------+ +| Column | Type | Key | Null | Default | Semantic Type | ++--------------+--------+-----+------+---------+---------------+ +| oid | UInt32 | | NO | | FIELD | +| relname | String | | NO | | FIELD | +| relnamespace | UInt32 | | NO | | FIELD | +| relkind | String | | NO | | FIELD | +| relowner | UInt32 | | NO | | FIELD | ++--------------+--------+-----+------+---------+---------------+ + +-- SQLNESS PROTOCOL POSTGRES desc table pg_namespace; -Error: 4001(TableNotFound), Table not found: pg_namespace ++---------+--------+-----+------+---------+---------------+ +| Column | Type | Key | Null | Default | Semantic Type | ++---------+--------+-----+------+---------+---------------+ +| oid | UInt32 | | NO | | FIELD | +| nspname | String | | NO | | FIELD | ++---------+--------+-----+------+---------+---------------+ +-- SQLNESS PROTOCOL POSTGRES drop table my_db.foo; -Error: 4001(TableNotFound), Table not found: greptime.my_db.foo +Failed to execute query, encountered: Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: None, code: SqlState(E42P01), message: "Table not found: greptime.my_db.foo", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: None, line: None, routine: None }) } +-- SQLNESS PROTOCOL POSTGRES use public; -Affected Rows: 0 + diff --git a/tests/cases/standalone/common/system/pg_catalog.sql b/tests/cases/standalone/common/system/pg_catalog.sql index 50fb7b97456e..712302254d45 100644 --- a/tests/cases/standalone/common/system/pg_catalog.sql +++ b/tests/cases/standalone/common/system/pg_catalog.sql @@ -1,9 +1,16 @@ -- should not able to create pg_catalog create database pg_catalog; +-- make sure all the pg_catalog tables are only visible to postgres +select * from pg_catalog.pg_class; +select * from pg_catalog.pg_namespace; +select * from pg_catalog.pg_type; + +-- SQLNESS PROTOCOL POSTGRES select * from pg_catalog.pg_type order by oid; -- \d +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -18,7 +25,7 @@ WHERE c.relkind IN ('r','p','v','m','S','f','') ORDER BY 1,2; -- \dt - +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -33,19 +40,23 @@ WHERE c.relkind IN ('r','p','') ORDER BY 1,2; -- make sure oid of namespace keep stable +-- SQLNESS PROTOCOL POSTGRES SELECT * FROM pg_namespace ORDER BY oid; -create -database my_db; +-- SQLNESS PROTOCOL POSTGRES +create database my_db; +-- SQLNESS PROTOCOL POSTGRES use my_db; +-- SQLNESS PROTOCOL POSTGRES create table foo ( ts TIMESTAMP TIME INDEX ); -- show tables in `my_db` +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace = ( @@ -55,6 +66,7 @@ where relnamespace = ( ); -- \dt +-- SQLNESS PROTOCOL POSTGRES SELECT n.nspname as "Schema", c.relname as "Name", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' WHEN 'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 't' THEN 'TOAST table' WHEN 'f' THEN 'foreign table' WHEN 'p' THEN 'partitioned table' WHEN 'I' THEN 'partitioned index' END as "Type", @@ -69,6 +81,7 @@ WHERE c.relkind IN ('r','p','') ORDER BY 1,2; -- show tables in `my_db`, `public` +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace in ( @@ -78,6 +91,7 @@ where relnamespace in ( ) order by relname; +-- SQLNESS PROTOCOL POSTGRES select relname from pg_catalog.pg_class where relnamespace in ( @@ -86,6 +100,7 @@ where relnamespace in ( where nspname like 'my%' ); +-- SQLNESS PROTOCOL POSTGRES select relnamespace, relname, relkind from pg_catalog.pg_class where relnamespace in ( @@ -97,17 +112,24 @@ where relnamespace in ( ) order by relnamespace, relname; +-- SQLNESS PROTOCOL POSTGRES use public; +-- SQLNESS PROTOCOL POSTGRES drop schema my_db; +-- SQLNESS PROTOCOL POSTGRES use pg_catalog; -- pg_class +-- SQLNESS PROTOCOL POSTGRES desc table pg_class; +-- SQLNESS PROTOCOL POSTGRES desc table pg_namespace; +-- SQLNESS PROTOCOL POSTGRES drop table my_db.foo; +-- SQLNESS PROTOCOL POSTGRES use public; diff --git a/tests/conf/standalone-test.toml.template b/tests/conf/standalone-test.toml.template index 2e30ac35c266..f96a815762fb 100644 --- a/tests/conf/standalone-test.toml.template +++ b/tests/conf/standalone-test.toml.template @@ -24,6 +24,19 @@ data_home = '{data_home}' addr = '127.0.0.1:4001' runtime_size = 8 +[mysql] +enable = true +addr = "127.0.0.1:4002" +runtime_size = 2 + +[mysql.tls] +mode = "disable" + +[postgres] +enable = true +addr = "127.0.0.1:4003" +runtime_size = 2 + [procedure] max_retry_times = 3 retry_delay = "500ms" diff --git a/tests/runner/Cargo.toml b/tests/runner/Cargo.toml index 1bac0c593337..641f07c2c6c3 100644 --- a/tests/runner/Cargo.toml +++ b/tests/runner/Cargo.toml @@ -15,8 +15,11 @@ common-error.workspace = true common-query.workspace = true common-recordbatch.workspace = true common-time.workspace = true +datatypes = { workspace = true } +mysql = { version = "23.0.1" } serde.workspace = true serde_json.workspace = true +tokio-postgres = { workspace = true } # sqlness 0.6.0 have a bug causing `cargo sqlness` to fail(see https://github.com/CeresDB/sqlness/issues/68) which is fixed in 0.6.1 sqlness = "0.6.1" tempfile.workspace = true diff --git a/tests/runner/src/env.rs b/tests/runner/src/env.rs index 9d71489f8cf4..0dc0e3a9e839 100644 --- a/tests/runner/src/env.rs +++ b/tests/runner/src/env.rs @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::borrow::Cow; use std::fmt::Display; use std::fs::OpenOptions; use std::io; use std::io::Write; +use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::process::{Child, Command}; use std::sync::atomic::{AtomicU32, Ordering}; @@ -30,15 +32,25 @@ use client::{ use common_error::ext::ErrorExt; use common_query::{Output, OutputData}; use common_recordbatch::RecordBatches; +use datatypes::data_type::ConcreteDataType; +use datatypes::scalars::ScalarVectorBuilder; +use datatypes::schema::{ColumnSchema, Schema}; +use datatypes::vectors::{StringVectorBuilder, VectorRef}; +use mysql::prelude::Queryable; +use mysql::{Conn as MySqlClient, Row as MySqlRow}; use serde::Serialize; use sqlness::{Database, EnvController, QueryContext}; use tinytemplate::TinyTemplate; use tokio::sync::Mutex as TokioMutex; +use tokio_postgres::{Client as PgClient, SimpleQueryMessage as PgRow}; -use crate::util; +use crate::protocol_interceptor::{MYSQL, PROTOCOL_KEY}; +use crate::{util, ServerAddr}; const METASRV_ADDR: &str = "127.0.0.1:3002"; -const SERVER_ADDR: &str = "127.0.0.1:4001"; +const GRPC_SERVER_ADDR: &str = "127.0.0.1:4001"; +const MYSQL_SERVER_ADDR: &str = "127.0.0.1:4002"; +const POSTGRES_SERVER_ADDR: &str = "127.0.0.1:4003"; const DEFAULT_LOG_LEVEL: &str = "--log-level=debug,hyper=warn,tower=warn,datafusion=warn,reqwest=warn,sqlparser=warn,h2=info,opendal=info"; #[derive(Clone)] @@ -55,7 +67,7 @@ pub enum WalConfig { #[derive(Clone)] pub struct Env { sqlness_home: PathBuf, - server_addr: Option, + server_addrs: ServerAddr, wal: WalConfig, /// The path to the directory that contains the pre-built GreptimeDB binary. @@ -86,21 +98,21 @@ impl EnvController for Env { impl Env { pub fn new( data_home: PathBuf, - server_addr: Option, + server_addrs: ServerAddr, wal: WalConfig, bins_dir: Option, ) -> Self { Self { sqlness_home: data_home, - server_addr, + server_addrs, wal, bins_dir: Arc::new(Mutex::new(bins_dir)), } } async fn start_standalone(&self) -> GreptimeDB { - if let Some(server_addr) = self.server_addr.clone() { - self.connect_db(&server_addr) + if self.server_addrs.server_addr.is_some() { + self.connect_db(&self.server_addrs).await } else { self.build_db(); self.setup_wal(); @@ -109,25 +121,18 @@ impl Env { let server_process = self.start_server("standalone", &db_ctx, true).await; - let client = Client::with_urls(vec![SERVER_ADDR]); - let db = DB::new(DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, client); - - GreptimeDB { - server_processes: Some(Arc::new(Mutex::new(vec![server_process]))), - metasrv_process: None, - frontend_process: None, - flownode_process: None, - client: TokioMutex::new(db), - ctx: db_ctx, - is_standalone: true, - env: self.clone(), - } + let mut greptimedb = self.connect_db(&Default::default()).await; + greptimedb.server_processes = Some(Arc::new(Mutex::new(vec![server_process]))); + greptimedb.is_standalone = true; + greptimedb.ctx = db_ctx; + + greptimedb } } async fn start_distributed(&self) -> GreptimeDB { - if let Some(server_addr) = self.server_addr.clone() { - self.connect_db(&server_addr) + if self.server_addrs.server_addr.is_some() { + self.connect_db(&self.server_addrs).await } else { self.build_db(); self.setup_wal(); @@ -145,29 +150,92 @@ impl Env { let flownode = self.start_server("flownode", &db_ctx, true).await; - let client = Client::with_urls(vec![SERVER_ADDR]); - let db = DB::new(DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, client); - - GreptimeDB { - server_processes: Some(Arc::new(Mutex::new(vec![ - datanode_1, datanode_2, datanode_3, - ]))), - metasrv_process: Some(meta_server), - frontend_process: Some(frontend), - flownode_process: Some(flownode), - client: TokioMutex::new(db), - ctx: db_ctx, - is_standalone: false, - env: self.clone(), + let mut greptimedb = self.connect_db(&Default::default()).await; + + greptimedb.metasrv_process = Some(meta_server); + greptimedb.server_processes = Some(Arc::new(Mutex::new(vec![ + datanode_1, datanode_2, datanode_3, + ]))); + greptimedb.frontend_process = Some(frontend); + greptimedb.flownode_process = Some(flownode); + greptimedb.is_standalone = false; + greptimedb.ctx = db_ctx; + + greptimedb + } + } + + async fn create_pg_client(&self, pg_server_addr: &str) -> PgClient { + let sockaddr: SocketAddr = pg_server_addr.parse().expect( + "Failed to parse the Postgres server address. Please check if the address is in the format of `ip:port`.", + ); + let mut config = tokio_postgres::config::Config::new(); + config.host(sockaddr.ip().to_string()); + config.port(sockaddr.port()); + config.dbname(DEFAULT_SCHEMA_NAME); + + // retry to connect to Postgres server until success + const MAX_RETRY: usize = 3; + let mut backoff = Duration::from_millis(500); + for _ in 0..MAX_RETRY { + if let Ok((pg_client, conn)) = config.connect(tokio_postgres::NoTls).await { + tokio::spawn(conn); + return pg_client; } + tokio::time::sleep(backoff).await; + backoff *= 2; } + panic!("Failed to connect to Postgres server. Please check if the server is running."); } - fn connect_db(&self, server_addr: &str) -> GreptimeDB { - let client = Client::with_urls(vec![server_addr.to_owned()]); - let db = DB::new(DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, client); + async fn create_mysql_client(&self, mysql_server_addr: &str) -> MySqlClient { + let sockaddr: SocketAddr = mysql_server_addr.parse().expect( + "Failed to parse the MySQL server address. Please check if the address is in the format of `ip:port`.", + ); + let ops = mysql::OptsBuilder::new() + .ip_or_hostname(Some(sockaddr.ip().to_string())) + .tcp_port(sockaddr.port()) + .db_name(Some(DEFAULT_SCHEMA_NAME)); + // retry to connect to MySQL server until success + const MAX_RETRY: usize = 3; + let mut backoff = Duration::from_millis(500); + + for _ in 0..MAX_RETRY { + // exponential backoff + if let Ok(client) = mysql::Conn::new(ops.clone()) { + return client; + } + tokio::time::sleep(backoff).await; + backoff *= 2; + } + + panic!("Failed to connect to MySQL server. Please check if the server is running.") + } + + async fn connect_db(&self, server_addr: &ServerAddr) -> GreptimeDB { + let grpc_server_addr = server_addr + .server_addr + .clone() + .unwrap_or(GRPC_SERVER_ADDR.to_owned()); + let pg_server_addr = server_addr + .pg_server_addr + .clone() + .unwrap_or(POSTGRES_SERVER_ADDR.to_owned()); + let mysql_server_addr = server_addr + .mysql_server_addr + .clone() + .unwrap_or(MYSQL_SERVER_ADDR.to_owned()); + + let grpc_client = Client::with_urls(vec![grpc_server_addr.clone()]); + let db = DB::new(DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, grpc_client); + let pg_client = self.create_pg_client(&pg_server_addr).await; + + let mysql_client = self.create_mysql_client(&mysql_server_addr).await; + GreptimeDB { - client: TokioMutex::new(db), + grpc_client: TokioMutex::new(db), + pg_client: TokioMutex::new(pg_client), + mysql_client: TokioMutex::new(mysql_client), server_processes: None, metasrv_process: None, frontend_process: None, @@ -217,9 +285,15 @@ impl Env { .open(stdout_file_name) .unwrap(); - let (args, check_ip_addr) = match subcommand { - "datanode" => self.datanode_start_args(db_ctx), - "flownode" => self.flownode_start_args(db_ctx, &self.sqlness_home), + let (args, check_ip_addrs) = match subcommand { + "datanode" => { + let (args, addr) = self.datanode_start_args(db_ctx); + (args, vec![addr]) + } + "flownode" => { + let (args, addr) = self.flownode_start_args(db_ctx, &self.sqlness_home); + (args, vec![addr]) + } "standalone" => { let args = vec![ DEFAULT_LOG_LEVEL.to_string(), @@ -233,7 +307,7 @@ impl Env { self.generate_config_file(subcommand, db_ctx), "--http-addr=127.0.0.1:5002".to_string(), ]; - (args, SERVER_ADDR.to_string()) + (args, vec![GRPC_SERVER_ADDR.to_string()]) } "frontend" => { let args = vec![ @@ -247,7 +321,7 @@ impl Env { self.sqlness_home.display() ), ]; - (args, SERVER_ADDR.to_string()) + (args, vec![GRPC_SERVER_ADDR.to_string()]) } "metasrv" => { let args = vec![ @@ -266,16 +340,18 @@ impl Env { "-c".to_string(), self.generate_config_file(subcommand, db_ctx), ]; - (args, METASRV_ADDR.to_string()) + (args, vec![METASRV_ADDR.to_string()]) } _ => panic!("Unexpected subcommand: {subcommand}"), }; - if util::check_port(check_ip_addr.parse().unwrap(), Duration::from_secs(1)).await { - panic!( - "Port {check_ip_addr} is already in use, please check and retry.", - check_ip_addr = check_ip_addr - ); + for check_ip_addr in &check_ip_addrs { + if util::check_port(check_ip_addr.parse().unwrap(), Duration::from_secs(1)).await { + panic!( + "Port {check_ip_addr} is already in use, please check and retry.", + check_ip_addr = check_ip_addr + ); + } } #[cfg(not(windows))] @@ -297,9 +373,11 @@ impl Env { panic!("Failed to start the DB with subcommand {subcommand},Error: {error}") }); - if !util::check_port(check_ip_addr.parse().unwrap(), Duration::from_secs(10)).await { - Env::stop_server(&mut process); - panic!("{subcommand} doesn't up in 10 seconds, quit.") + for check_ip_addr in &check_ip_addrs { + if !util::check_port(check_ip_addr.parse().unwrap(), Duration::from_secs(10)).await { + Env::stop_server(&mut process); + panic!("{subcommand} doesn't up in 10 seconds, quit.") + } } process @@ -379,6 +457,9 @@ impl Env { }; if let Some(server_process) = db.server_processes.clone() { + *db.pg_client.lock().await = self.create_pg_client(&self.pg_server_addr()).await; + *db.mysql_client.lock().await = + self.create_mysql_client(&self.mysql_server_addr()).await; let mut server_processes = server_process.lock().unwrap(); *server_processes = new_server_processes; } @@ -433,6 +514,20 @@ impl Env { conf_file } + fn pg_server_addr(&self) -> String { + self.server_addrs + .pg_server_addr + .clone() + .unwrap_or(POSTGRES_SERVER_ADDR.to_owned()) + } + + fn mysql_server_addr(&self) -> String { + self.server_addrs + .mysql_server_addr + .clone() + .unwrap_or(MYSQL_SERVER_ADDR.to_owned()) + } + /// Build the DB with `cargo build --bin greptime` fn build_db(&self) { if self.bins_dir.lock().unwrap().is_some() { @@ -467,20 +562,51 @@ pub struct GreptimeDB { metasrv_process: Option, frontend_process: Option, flownode_process: Option, - client: TokioMutex, + grpc_client: TokioMutex, + pg_client: TokioMutex, + mysql_client: TokioMutex, ctx: GreptimeDBContext, is_standalone: bool, env: Env, } -#[async_trait] -impl Database for GreptimeDB { - async fn query(&self, ctx: QueryContext, query: String) -> Box { - if ctx.context.contains_key("restart") && self.env.server_addr.is_none() { - self.env.restart_server(self).await; +impl GreptimeDB { + async fn postgres_query(&self, _ctx: QueryContext, query: String) -> Box { + let client = self.pg_client.lock().await; + match client.simple_query(&query).await { + Ok(rows) => Box::new(PostgresqlFormatter { rows }), + Err(e) => Box::new(format!("Failed to execute query, encountered: {:?}", e)), } + } - let mut client = self.client.lock().await; + async fn mysql_query(&self, _ctx: QueryContext, query: String) -> Box { + let mut conn = self.mysql_client.lock().await; + let result = conn.query_iter(query); + Box::new(match result { + Ok(result) => { + let mut rows = vec![]; + let affected_rows = result.affected_rows(); + for row in result { + match row { + Ok(r) => rows.push(r), + Err(e) => { + return Box::new(format!("Failed to parse query result, err: {:?}", e)) + } + } + } + + if rows.is_empty() { + format!("affected_rows: {}", affected_rows) + } else { + format!("{}", MysqlFormatter { rows }) + } + } + Err(e) => format!("Failed to execute query, err: {:?}", e), + }) + } + + async fn grpc_query(&self, _ctx: QueryContext, query: String) -> Box { + let mut client = self.grpc_client.lock().await; let query_str = query.trim().to_lowercase(); @@ -542,6 +668,25 @@ impl Database for GreptimeDB { } } +#[async_trait] +impl Database for GreptimeDB { + async fn query(&self, ctx: QueryContext, query: String) -> Box { + if ctx.context.contains_key("restart") && self.env.server_addrs.server_addr.is_none() { + self.env.restart_server(self).await; + } + if let Some(protocol) = ctx.context.get(PROTOCOL_KEY) { + // protocol is bound to be either "mysql" or "postgres" + if protocol == MYSQL { + self.mysql_query(ctx, query).await + } else { + self.postgres_query(ctx, query).await + } + } else { + self.grpc_query(ctx, query).await + } + } +} + impl GreptimeDB { fn stop(&mut self) { if let Some(server_processes) = self.server_processes.clone() { @@ -575,7 +720,7 @@ impl GreptimeDB { impl Drop for GreptimeDB { fn drop(&mut self) { - if self.env.server_addr.is_none() { + if self.env.server_addrs.server_addr.is_none() { self.stop(); } } @@ -657,3 +802,117 @@ impl Display for ResultDisplayer { } } } + +struct PostgresqlFormatter { + pub rows: Vec, +} + +impl Display for PostgresqlFormatter { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if self.rows.is_empty() { + return f.write_fmt(format_args!("(Empty response)")); + } + + // create schema + let schema = match &self.rows[0] { + PgRow::CommandComplete(affected_rows) => { + write!( + f, + "{}", + ResultDisplayer { + result: Ok(Output::new_with_affected_rows(*affected_rows as usize)), + } + )?; + return Ok(()); + } + PgRow::RowDescription(desc) => Arc::new(Schema::new( + desc.iter() + .map(|column| { + ColumnSchema::new(column.name(), ConcreteDataType::string_datatype(), false) + }) + .collect(), + )), + _ => unreachable!(), + }; + if schema.num_columns() == 0 { + return Ok(()); + } + + // convert to string vectors + let mut columns: Vec = (0..schema.num_columns()) + .map(|_| StringVectorBuilder::with_capacity(schema.num_columns())) + .collect(); + for row in self.rows.iter().skip(1) { + if let PgRow::Row(row) = row { + for (i, column) in columns.iter_mut().enumerate().take(schema.num_columns()) { + column.push(row.get(i)); + } + } + } + let columns: Vec = columns + .into_iter() + .map(|mut col| Arc::new(col.finish()) as VectorRef) + .collect(); + + // construct recordbatch + let recordbatches = RecordBatches::try_from_columns(schema, columns) + .expect("Failed to construct recordbatches from columns. Please check the schema."); + let result_displayer = ResultDisplayer { + result: Ok(Output::new_with_record_batches(recordbatches)), + }; + write!(f, "{}", result_displayer)?; + + Ok(()) + } +} + +struct MysqlFormatter { + pub rows: Vec, +} + +impl Display for MysqlFormatter { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + if self.rows.is_empty() { + return f.write_fmt(format_args!("(Empty response)")); + } + // create schema + let head_column = &self.rows[0]; + let head_binding = head_column.columns(); + let names = head_binding + .iter() + .map(|column| column.name_str()) + .collect::>>(); + let schema = Arc::new(Schema::new( + names + .iter() + .map(|name| { + ColumnSchema::new(name.to_string(), ConcreteDataType::string_datatype(), false) + }) + .collect(), + )); + + // convert to string vectors + let mut columns: Vec = (0..schema.num_columns()) + .map(|_| StringVectorBuilder::with_capacity(schema.num_columns())) + .collect(); + for row in self.rows.iter() { + for (i, name) in names.iter().enumerate() { + columns[i].push(row.get::(name).as_deref()); + } + } + let columns: Vec = columns + .into_iter() + .map(|mut col| Arc::new(col.finish()) as VectorRef) + .collect(); + + // construct recordbatch + let recordbatches = RecordBatches::try_from_columns(schema, columns) + .expect("Failed to construct recordbatches from columns. Please check the schema."); + let result_displayer = ResultDisplayer { + result: Ok(Output::new_with_record_batches(recordbatches)), + }; + write!(f, "{}", result_displayer)?; + + Ok(()) + } +} diff --git a/tests/runner/src/main.rs b/tests/runner/src/main.rs index 44746768029d..eca72f280e2a 100644 --- a/tests/runner/src/main.rs +++ b/tests/runner/src/main.rs @@ -15,12 +15,15 @@ #![allow(clippy::print_stdout)] use std::path::PathBuf; +use std::sync::Arc; use clap::{Parser, ValueEnum}; use env::{Env, WalConfig}; +use sqlness::interceptor::Registry; use sqlness::{ConfigBuilder, Runner}; mod env; +mod protocol_interceptor; mod util; #[derive(ValueEnum, Debug, Clone)] @@ -30,6 +33,23 @@ enum Wal { Kafka, } +// add a group to ensure that all server addresses are set together +#[derive(clap::Args, Debug, Clone, Default)] +#[group(multiple = true, requires_all=["server_addr", "pg_server_addr", "mysql_server_addr"])] +struct ServerAddr { + /// Address of the grpc server. + #[clap(short, long)] + server_addr: Option, + + /// Address of the postgres server. Must be set if server_addr is set. + #[clap(short, long, requires = "server_addr")] + pg_server_addr: Option, + + /// Address of the mysql server. Must be set if server_addr is set. + #[clap(short, long, requires = "server_addr")] + mysql_server_addr: Option, +} + #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] /// SQL Harness for GrepTimeDB @@ -50,9 +70,9 @@ struct Args { #[clap(short, long, default_value = ".*")] test_filter: String, - /// Address of the server. - #[clap(short, long)] - server_addr: Option, + /// Addresses of the server. + #[command(flatten)] + server_addr: ServerAddr, /// The type of Wal. #[clap(short, long, default_value = "raft_engine")] @@ -84,12 +104,19 @@ async fn main() { .unwrap(); let sqlness_home = temp_dir.into_path(); + let mut interceptor_registry: Registry = Default::default(); + interceptor_registry.register( + protocol_interceptor::PREFIX, + Arc::new(protocol_interceptor::ProtocolInterceptorFactory), + ); + let config = ConfigBuilder::default() .case_dir(util::get_case_dir(args.case_dir)) .fail_fast(args.fail_fast) .test_filter(args.test_filter) .follow_links(true) .env_config_file(args.env_config_file) + .interceptor_registry(interceptor_registry) .build() .unwrap(); @@ -107,7 +134,12 @@ async fn main() { let runner = Runner::new( config, - Env::new(sqlness_home.clone(), args.server_addr, wal, args.bins_dir), + Env::new( + sqlness_home.clone(), + args.server_addr.clone(), + wal, + args.bins_dir, + ), ); runner.run().await.unwrap(); diff --git a/tests/runner/src/protocol_interceptor.rs b/tests/runner/src/protocol_interceptor.rs new file mode 100644 index 000000000000..0f8a01e235c4 --- /dev/null +++ b/tests/runner/src/protocol_interceptor.rs @@ -0,0 +1,48 @@ +// Copyright 2023 Greptime Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use sqlness::interceptor::{Interceptor, InterceptorFactory, InterceptorRef}; +use sqlness::SqlnessError; + +pub const PROTOCOL_KEY: &str = "protocol"; +pub const POSTGRES: &str = "postgres"; +pub const MYSQL: &str = "mysql"; +pub const PREFIX: &str = "PROTOCOL"; + +pub struct ProtocolInterceptor { + protocol: String, +} + +impl Interceptor for ProtocolInterceptor { + fn before_execute(&self, _: &mut Vec, context: &mut sqlness::QueryContext) { + context + .context + .insert(PROTOCOL_KEY.to_string(), self.protocol.clone()); + } +} + +pub struct ProtocolInterceptorFactory; + +impl InterceptorFactory for ProtocolInterceptorFactory { + fn try_new(&self, ctx: &str) -> Result { + let protocol = ctx.to_lowercase(); + match protocol.as_str() { + POSTGRES | MYSQL => Ok(Box::new(ProtocolInterceptor { protocol })), + _ => Err(SqlnessError::InvalidContext { + prefix: PREFIX.to_string(), + msg: format!("Unsupported protocol: {}", ctx), + }), + } + } +}