diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 4fada893ca30..f3799e8df037 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -1,4 +1,6 @@ on: + schedule: + - cron: "0 15 * * 1-5" merge_group: pull_request: types: [ opened, synchronize, reopened, ready_for_review ] @@ -51,12 +53,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # # Shares with `Clippy` job - # shared-key: "check-lint" - name: Run cargo check run: cargo check --locked --workspace --all-targets @@ -67,11 +63,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "check-toml" - name: Install taplo run: cargo +stable install taplo-cli --version ^0.9 --locked --force - name: Run taplo @@ -94,6 +85,8 @@ jobs: with: # Shares across multiple jobs shared-key: "build-binaries" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install cargo-gc-bin shell: bash run: cargo install cargo-gc-bin --force @@ -142,11 +135,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -200,11 +188,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -255,6 +238,8 @@ jobs: with: # Shares across multiple jobs shared-key: "build-greptime-ci" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install cargo-gc-bin shell: bash run: cargo install cargo-gc-bin --force @@ -317,11 +302,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -466,11 +446,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rust-lang/setup-rust-toolchain@v1 - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "fuzz-test-targets" - name: Set Rust Fuzz shell: bash run: | @@ -612,11 +587,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: rustfmt - # - name: Rust Cache - # uses: Swatinem/rust-cache@v2 - # with: - # # Shares across multiple jobs - # shared-key: "check-rust-fmt" - name: Check format run: make fmt-check @@ -638,6 +608,8 @@ jobs: # Shares across multiple jobs # Shares with `Check` job shared-key: "check-lint" + cache-all-crates: "true" + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run cargo clippy run: make clippy @@ -670,6 +642,7 @@ jobs: with: # Shares cross multiple jobs shared-key: "coverage-test" + cache-all-crates: "true" save-if: ${{ github.ref == 'refs/heads/main' }} # Disabled temporarily to see performance # - name: Docker Cache diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index bcdb31eaf644..b8a41a0a8e46 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -108,51 +108,6 @@ jobs: GT_S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} UNITTEST_LOG_DIR: "__unittest_logs" - ## this is designed for generating cache that usable for pull requests - test-on-linux: - name: Run tests on Linux - if: ${{ github.repository == 'GreptimeTeam/greptimedb' }} - runs-on: ubuntu-20.04-8-cores - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: rui314/setup-mold@v1 - - name: Install Rust toolchain - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - with: - # Shares cross multiple jobs - shared-key: "coverage-test" - - name: Install Cargo Nextest - uses: taiki-e/install-action@nextest - - name: Setup external services - working-directory: tests-integration/fixtures - run: docker compose up -d --wait - - name: Running tests - run: cargo nextest run -F dashboard -F pg_kvbackend - env: - CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=mold" - RUST_BACKTRACE: 1 - CARGO_INCREMENTAL: 0 - GT_S3_BUCKET: ${{ vars.AWS_CI_TEST_BUCKET }} - GT_S3_ACCESS_KEY_ID: ${{ secrets.AWS_CI_TEST_ACCESS_KEY_ID }} - GT_S3_ACCESS_KEY: ${{ secrets.AWS_CI_TEST_SECRET_ACCESS_KEY }} - GT_S3_REGION: ${{ vars.AWS_CI_TEST_BUCKET_REGION }} - GT_MINIO_BUCKET: greptime - GT_MINIO_ACCESS_KEY_ID: superpower_ci_user - GT_MINIO_ACCESS_KEY: superpower_password - GT_MINIO_REGION: us-west-2 - GT_MINIO_ENDPOINT_URL: http://127.0.0.1:9000 - GT_ETCD_ENDPOINTS: http://127.0.0.1:2379 - GT_POSTGRES_ENDPOINTS: postgres://greptimedb:admin@127.0.0.1:5432/postgres - GT_KAFKA_ENDPOINTS: 127.0.0.1:9092 - GT_KAFKA_SASL_ENDPOINTS: 127.0.0.1:9093 - UNITTEST_LOG_DIR: "__unittest_logs" - cleanbuild-linux-nix: name: Run clean build on Linux runs-on: ubuntu-latest-8-cores diff --git a/Cargo.lock b/Cargo.lock index 748d247626a5..1bdbf23ff96b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,7 +332,7 @@ dependencies = [ "arrow-data", "arrow-schema", "arrow-select", - "atoi 2.0.0", + "atoi", "base64 0.22.1", "chrono", "comfy-table", @@ -674,15 +674,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "atoi" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" -dependencies = [ - "num-traits", -] - [[package]] name = "atoi" version = "2.0.0" @@ -957,6 +948,9 @@ name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] [[package]] name = "bitpacking" @@ -2422,12 +2416,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - [[package]] name = "const-oid" version = "0.9.6" @@ -2686,16 +2674,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -3259,25 +3237,14 @@ dependencies = [ "num-traits", ] -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid 0.7.1", - "crypto-bigint", - "pem-rfc7468 0.3.1", -] - [[package]] name = "der" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "const-oid 0.9.6", - "pem-rfc7468 0.7.0", + "const-oid", + "pem-rfc7468", "zeroize", ] @@ -3474,7 +3441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", - "const-oid 0.9.6", + "const-oid", "crypto-common", "subtle", ] @@ -3488,15 +3455,6 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - [[package]] name = "dirs-next" version = "2.0.0" @@ -3529,6 +3487,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "dlv-list" version = "0.3.0" @@ -3609,6 +3578,9 @@ name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +dependencies = [ + "serde", +] [[package]] name = "encode_unicode" @@ -3707,6 +3679,17 @@ dependencies = [ "tower-service", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -3989,6 +3972,17 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + [[package]] name = "fnv" version = "1.0.7" @@ -4220,13 +4214,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot 0.12.3", ] [[package]] @@ -4521,9 +4515,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", @@ -4532,11 +4526,11 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.4" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.2", ] [[package]] @@ -4615,9 +4609,6 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -5096,6 +5087,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -5104,12 +5213,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -5190,7 +5310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -5523,7 +5643,7 @@ dependencies = [ "base64 0.21.7", "js-sys", "pem", - "ring 0.17.8", + "ring", "serde", "serde_json", "simple_asn1", @@ -5719,7 +5839,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.9.8", + "spin", ] [[package]] @@ -5858,6 +5978,16 @@ dependencies = [ "redox_syscall 0.5.7", ] +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" version = "1.1.20" @@ -5882,6 +6012,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "local-ip-address" version = "0.6.3" @@ -6534,7 +6670,7 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] @@ -7731,15 +7867,6 @@ dependencies = [ "serde", ] -[[package]] -name = "pem-rfc7468" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" -dependencies = [ - "base64ct", -] - [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -7832,7 +7959,7 @@ dependencies = [ "md5", "postgres-types", "rand", - "ring 0.17.8", + "ring", "rust_decimal", "thiserror 2.0.6", "tokio", @@ -7978,26 +8105,15 @@ dependencies = [ "futures-io", ] -[[package]] -name = "pkcs1" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" -dependencies = [ - "der 0.5.1", - "pkcs8 0.8.0", - "zeroize", -] - [[package]] name = "pkcs1" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der 0.7.9", - "pkcs8 0.10.2", - "spki 0.7.3", + "der", + "pkcs8", + "spki", ] [[package]] @@ -8008,22 +8124,11 @@ checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6" dependencies = [ "aes", "cbc", - "der 0.7.9", + "der", "pbkdf2", "scrypt", "sha2", - "spki 0.7.3", -] - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der 0.5.1", - "spki 0.5.4", - "zeroize", + "spki", ] [[package]] @@ -8032,10 +8137,10 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.9", + "der", "pkcs5", "rand_core", - "spki 0.7.3", + "spki", ] [[package]] @@ -8752,7 +8857,7 @@ checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand", - "ring 0.17.8", + "ring", "rustc-hash 2.0.0", "rustls 0.23.20", "slab", @@ -9079,7 +9184,7 @@ dependencies = [ "quick-xml 0.35.0", "rand", "reqwest", - "rsa 0.9.6", + "rsa", "rust-ini 0.21.1", "serde", "serde_json", @@ -9155,21 +9260,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -9180,8 +9270,8 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -9231,43 +9321,23 @@ dependencies = [ "serde", ] -[[package]] -name = "rsa" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" -dependencies = [ - "byteorder", - "digest", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1 0.3.3", - "pkcs8 0.8.0", - "rand_core", - "smallvec", - "subtle", - "zeroize", -] - [[package]] name = "rsa" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "const-oid 0.9.6", + "const-oid", "digest", "num-bigint-dig", "num-integer", "num-traits", - "pkcs1 0.7.5", - "pkcs8 0.10.2", + "pkcs1", + "pkcs8", "rand_core", "sha2", "signature", - "spki 0.7.3", + "spki", "subtle", "zeroize", ] @@ -9537,18 +9607,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.21.12" @@ -9556,7 +9614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -9568,7 +9626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -9582,7 +9640,7 @@ source = "git+https://github.com/GreptimeTeam/rustls?rev=34fd0c6#34fd0c6244af150 dependencies = [ "log", "once_cell", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -9645,8 +9703,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -9655,9 +9713,9 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -9845,8 +9903,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -10111,7 +10169,7 @@ dependencies = [ "derive_builder 0.12.0", "futures", "futures-util", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "headers 0.3.9", "hostname", "http 0.2.12", @@ -10469,26 +10527,13 @@ dependencies = [ "vob", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" dependencies = [ - "base64ct", - "der 0.5.1", + "lock_api", ] [[package]] @@ -10498,7 +10543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.9", + "der", ] [[package]] @@ -10537,16 +10582,6 @@ dependencies = [ "table", ] -[[package]] -name = "sqlformat" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" -dependencies = [ - "nom", - "unicode_categories", -] - [[package]] name = "sqlness" version = "0.6.1" @@ -10651,100 +10686,196 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.6.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" dependencies = [ - "ahash 0.7.8", - "atoi 1.0.0", - "base64 0.13.1", - "bitflags 1.3.2", - "byteorder", "bytes", "chrono", "crc", "crossbeam-queue", + "either", + "event-listener 5.3.1", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.15.2", + "hashlink", + "indexmap 2.6.0", + "log", + "memchr", + "once_cell", + "percent-encoding", + "rustls 0.23.20", + "rustls-pemfile 2.2.0", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror 2.0.6", + "tokio", + "tokio-stream", + "tracing", + "url", + "webpki-roots 0.26.6", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.90", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +dependencies = [ + "dotenvy", + "either", + "heck 0.5.0", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.90", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "bytes", + "chrono", + "crc", "digest", - "dirs 4.0.0", "dotenvy", "either", - "event-listener 2.5.3", "futures-channel", "futures-core", - "futures-intrusive", + "futures-io", "futures-util", "generic-array", - "hashlink", "hex", "hkdf", "hmac", - "indexmap 1.9.3", "itoa", - "libc", "log", "md-5", "memchr", - "num-bigint", "once_cell", - "paste", "percent-encoding", "rand", - "rsa 0.6.1", - "rustls 0.20.9", - "rustls-pemfile 1.0.4", + "rsa", "serde", - "serde_json", "sha1", "sha2", "smallvec", - "sqlformat", - "sqlx-rt", + "sqlx-core", "stringprep", - "thiserror 1.0.64", - "tokio-stream", - "url", - "webpki-roots 0.22.6", + "thiserror 2.0.6", + "tracing", "whoami", ] [[package]] -name = "sqlx-macros" -version = "0.6.3" +name = "sqlx-postgres" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "chrono", + "crc", "dotenvy", - "either", - "heck 0.4.1", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "proc-macro2", - "quote", + "rand", + "serde", + "serde_json", "sha2", + "smallvec", "sqlx-core", - "sqlx-rt", - "syn 1.0.109", - "url", + "stringprep", + "thiserror 2.0.6", + "tracing", + "whoami", ] [[package]] -name = "sqlx-rt" -version = "0.6.3" +name = "sqlx-sqlite" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" dependencies = [ - "once_cell", - "tokio", - "tokio-rustls 0.23.4", + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", ] [[package]] @@ -11056,6 +11187,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "sysinfo" version = "0.30.13" @@ -11616,6 +11758,16 @@ dependencies = [ "log", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -11738,7 +11890,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab" dependencies = [ - "ring 0.17.8", + "ring", "rustls 0.23.20", "tokio", "tokio-postgres", @@ -11746,17 +11898,6 @@ dependencies = [ "x509-certificate", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -12198,7 +12339,7 @@ dependencies = [ "atty", "clap 2.34.0", "difference", - "dirs 3.0.2", + "dirs", "glob", "html-escape", "indexmap 1.9.3", @@ -12230,7 +12371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5fec4cb27f052ead2246631b332dba0cb6af9a54ce012badee59c4b0ded5e03" dependencies = [ "anyhow", - "dirs 3.0.2", + "dirs", "serde", "serde_json", ] @@ -12254,7 +12395,7 @@ checksum = "d0b17eef4833c7c139abed66d562dfa23228e97e647597baf246fd56c21bbfaf" dependencies = [ "anyhow", "cc", - "dirs 3.0.2", + "dirs", "libloading 0.7.4", "once_cell", "regex", @@ -12478,24 +12619,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -12504,9 +12633,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -12519,6 +12648,12 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-ranges" version = "1.0.5" @@ -12531,6 +12666,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -12756,17 +12897,8 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", + "ring", + "untrusted", ] [[package]] @@ -13141,6 +13273,18 @@ dependencies = [ "thiserror 1.0.64", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -13159,12 +13303,12 @@ dependencies = [ "bcder", "bytes", "chrono", - "der 0.7.9", + "der", "hex", "pem", - "ring 0.17.8", + "ring", "signature", - "spki 0.7.3", + "spki", "thiserror 1.0.64", "zeroize", ] @@ -13204,6 +13348,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -13225,6 +13393,27 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -13245,6 +13434,28 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/tests-fuzz/Cargo.toml b/tests-fuzz/Cargo.toml index 3b7b41e7a5db..eab760c60d2c 100644 --- a/tests-fuzz/Cargo.toml +++ b/tests-fuzz/Cargo.toml @@ -53,7 +53,7 @@ serde_yaml = "0.9" snafu = { workspace = true } sql = { workspace = true } sqlparser.workspace = true -sqlx = { version = "0.6", features = [ +sqlx = { version = "0.8", features = [ "runtime-tokio-rustls", "mysql", "postgres", diff --git a/tests-fuzz/src/utils.rs b/tests-fuzz/src/utils.rs index 8e5daef4eb1d..f52d75f4da25 100644 --- a/tests-fuzz/src/utils.rs +++ b/tests-fuzz/src/utils.rs @@ -59,8 +59,11 @@ pub async fn init_greptime_connections_via_env() -> Connections { /// Connects to GreptimeDB. pub async fn init_greptime_connections(mysql: Option) -> Connections { let mysql = if let Some(addr) = mysql { - let mut opts: MySqlConnectOptions = format!("mysql://{addr}/public").parse().unwrap(); - opts.log_statements(LevelFilter::Off); + let opts = format!("mysql://{addr}/public") + .parse::() + .unwrap() + .log_statements(LevelFilter::Off); + Some(MySqlPoolOptions::new().connect_with(opts).await.unwrap()) } else { None diff --git a/tests-fuzz/src/utils/cluster_info.rs b/tests-fuzz/src/utils/cluster_info.rs index fa4bbbc5404f..9f43711ca4df 100644 --- a/tests-fuzz/src/utils/cluster_info.rs +++ b/tests-fuzz/src/utils/cluster_info.rs @@ -17,8 +17,7 @@ use std::time::Duration; use common_telemetry::info; use humantime::parse_duration; use snafu::ResultExt; -use sqlx::database::HasArguments; -use sqlx::{ColumnIndex, Database, Decode, Encode, Executor, IntoArguments, MySql, Pool, Type}; +use sqlx::MySqlPool; use super::wait::wait_condition_fn; use crate::error::{self, Result}; @@ -34,19 +33,10 @@ pub struct NodeInfo { } /// Returns all [NodeInfo] in the cluster. -pub async fn fetch_nodes<'a, DB, E>(e: E) -> Result> -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> i64: Decode<'c, DB> + Type, - for<'c> String: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ - let sql = "select * from information_schema.cluster_info;"; +pub async fn fetch_nodes(db: &MySqlPool) -> Result> { + let sql = "select * from information_schema.cluster_info"; sqlx::query_as::<_, NodeInfo>(sql) - .fetch_all(e) + .fetch_all(db) .await .context(error::ExecuteQuerySnafu { sql }) } @@ -55,7 +45,7 @@ where /// /// This function repeatedly checks the status of all datanodes and waits until all of them are online /// or the timeout period elapses. A datanode is considered online if its `active_time` is less than 3 seconds. -pub async fn wait_for_all_datanode_online(greptime: Pool, timeout: Duration) { +pub async fn wait_for_all_datanode_online(greptime: MySqlPool, timeout: Duration) { wait_condition_fn( timeout, || { diff --git a/tests-fuzz/src/utils/partition.rs b/tests-fuzz/src/utils/partition.rs index 26b95e68f99e..197a51d00adc 100644 --- a/tests-fuzz/src/utils/partition.rs +++ b/tests-fuzz/src/utils/partition.rs @@ -17,8 +17,7 @@ use std::time::Duration; use common_telemetry::info; use snafu::ResultExt; -use sqlx::database::HasArguments; -use sqlx::{ColumnIndex, Database, Decode, Encode, Executor, IntoArguments, MySql, Pool, Type}; +use sqlx::MySqlPool; use store_api::storage::RegionId; use super::wait::wait_condition_fn; @@ -36,61 +35,33 @@ pub struct PartitionCount { pub count: i64, } -pub async fn count_partitions<'a, DB, E>(e: E, datanode_id: u64) -> Result -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> i64: Decode<'c, DB> + Type, - for<'c> String: Decode<'c, DB> + Type, - for<'c> u64: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ +pub async fn count_partitions(db: &MySqlPool, datanode_id: u64) -> Result { let sql = "select count(1) as count from information_schema.region_peers where peer_id == ?"; - Ok(sqlx::query_as::<_, PartitionCount>(sql) + sqlx::query_as::<_, PartitionCount>(sql) .bind(datanode_id) - .fetch_all(e) + .fetch_one(db) .await - .context(error::ExecuteQuerySnafu { sql })? - .remove(0)) + .context(error::ExecuteQuerySnafu { sql }) } /// Returns the [Partition] of the specific `region_id` -pub async fn fetch_partition<'a, DB, E>(e: E, region_id: u64) -> Result -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> u64: Decode<'c, DB> + Type, - for<'c> String: Decode<'c, DB> + Type, - for<'c> u64: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ +pub async fn fetch_partition(db: &MySqlPool, region_id: u64) -> Result { let sql = "select region_id, peer_id as datanode_id from information_schema.region_peers where region_id = ?;"; sqlx::query_as::<_, Partition>(sql) .bind(region_id) - .fetch_one(e) + .fetch_one(db) .await .context(error::ExecuteQuerySnafu { sql }) } /// Returns all [Partition] of the specific `table` -pub async fn fetch_partitions<'a, DB, E>(e: E, table_name: Ident) -> Result> -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> u64: Decode<'c, DB> + Type, - for<'c> String: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ +pub async fn fetch_partitions(db: &MySqlPool, table_name: Ident) -> Result> { let sql = "select b.peer_id as datanode_id, a.greptime_partition_id as region_id from information_schema.partitions a left join information_schema.region_peers b on a.greptime_partition_id = b.region_id where a.table_name= ? order by datanode_id asc;"; sqlx::query_as::<_, Partition>(sql) .bind(table_name.value.to_string()) - .fetch_all(e) + .fetch_all(db) .await .context(error::ExecuteQuerySnafu { sql }) } @@ -124,7 +95,7 @@ pub fn pretty_print_region_distribution(distribution: &BTreeMap, + greptime: MySqlPool, selected_datanode: u64, timeout: Duration, ) { diff --git a/tests-fuzz/src/validator/column.rs b/tests-fuzz/src/validator/column.rs index 349057817bf8..8642a275a438 100644 --- a/tests-fuzz/src/validator/column.rs +++ b/tests-fuzz/src/validator/column.rs @@ -15,8 +15,7 @@ use common_telemetry::debug; use datatypes::data_type::DataType; use snafu::{ensure, ResultExt}; -use sqlx::database::HasArguments; -use sqlx::{ColumnIndex, Database, Decode, Encode, Executor, IntoArguments, Type}; +use sqlx::MySqlPool; use crate::error::{self, Result}; use crate::ir::create_expr::ColumnOption; @@ -198,24 +197,16 @@ pub fn assert_eq(fetched_columns: &[ColumnEntry], columns: &[Column]) -> Result< } /// Returns all [ColumnEntry] of the `table_name` from `information_schema`. -pub async fn fetch_columns<'a, DB, E>( - e: E, +pub async fn fetch_columns( + db: &MySqlPool, schema_name: Ident, table_name: Ident, -) -> Result> -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> String: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ +) -> Result> { let sql = "SELECT table_schema, table_name, column_name, greptime_data_type as data_type, semantic_type, column_default, is_nullable FROM information_schema.columns WHERE table_schema = ? AND table_name = ?"; sqlx::query_as::<_, ColumnEntry>(sql) .bind(schema_name.value.to_string()) .bind(table_name.value.to_string()) - .fetch_all(e) + .fetch_all(db) .await .context(error::ExecuteQuerySnafu { sql }) } diff --git a/tests-fuzz/src/validator/row.rs b/tests-fuzz/src/validator/row.rs index 1e9535d6677f..5648a24f48b8 100644 --- a/tests-fuzz/src/validator/row.rs +++ b/tests-fuzz/src/validator/row.rs @@ -17,11 +17,8 @@ use common_time::date::Date; use common_time::{DateTime, Timestamp}; use datatypes::value::Value; use snafu::{ensure, ResultExt}; -use sqlx::database::HasArguments; -use sqlx::{ - Column, ColumnIndex, Database, Decode, Encode, Executor, IntoArguments, Row, Type, TypeInfo, - ValueRef, -}; +use sqlx::mysql::MySqlRow; +use sqlx::{Column, ColumnIndex, Database, MySqlPool, Row, TypeInfo, ValueRef}; use crate::error::{self, Result}; use crate::ir::insert_expr::{RowValue, RowValues}; @@ -151,33 +148,17 @@ pub struct ValueCount { pub count: i64, } -pub async fn count_values<'a, DB, E>(e: E, sql: &'a str) -> Result -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> i64: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, - for<'c> &'c str: ColumnIndex<::Row>, -{ - Ok(sqlx::query_as::<_, ValueCount>(sql) - .fetch_all(e) +pub async fn count_values(db: &MySqlPool, sql: &str) -> Result { + sqlx::query_as::<_, ValueCount>(sql) + .fetch_one(db) .await - .context(error::ExecuteQuerySnafu { sql })? - .remove(0)) + .context(error::ExecuteQuerySnafu { sql }) } /// Returns all [RowEntry] of the `table_name`. -pub async fn fetch_values<'a, DB, E>(e: E, sql: &'a str) -> Result::Row>> -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> String: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, -{ +pub async fn fetch_values(db: &MySqlPool, sql: &str) -> Result> { sqlx::query(sql) - .fetch_all(e) + .fetch_all(db) .await .context(error::ExecuteQuerySnafu { sql }) } diff --git a/tests-fuzz/src/validator/table.rs b/tests-fuzz/src/validator/table.rs index 406719b2d660..3e45930f2954 100644 --- a/tests-fuzz/src/validator/table.rs +++ b/tests-fuzz/src/validator/table.rs @@ -13,8 +13,7 @@ // limitations under the License. use snafu::{ensure, ResultExt}; -use sqlx::database::HasArguments; -use sqlx::{ColumnIndex, Database, Decode, Encode, Executor, IntoArguments, Row, Type}; +use sqlx::{MySqlPool, Row}; use crate::error::{self, Result, UnexpectedSnafu}; use crate::ir::alter_expr::AlterTableOption; @@ -47,17 +46,9 @@ fn parse_show_create(show_create: &str) -> Result> { } /// Fetches table options from the context -pub async fn fetch_table_options<'a, DB, E>(e: E, sql: &'a str) -> Result> -where - DB: Database, - >::Arguments: IntoArguments<'a, DB>, - for<'c> E: 'a + Executor<'c, Database = DB>, - for<'c> String: Decode<'c, DB> + Type, - for<'c> String: Encode<'c, DB> + Type, - usize: ColumnIndex<::Row>, -{ +pub async fn fetch_table_options(db: &MySqlPool, sql: &str) -> Result> { let fetched_rows = sqlx::query(sql) - .fetch_all(e) + .fetch_all(db) .await .context(error::ExecuteQuerySnafu { sql })?; ensure!( diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index 057890b6395d..d3434908b7e5 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -64,7 +64,7 @@ session.workspace = true similar-asserts.workspace = true snafu.workspace = true sql.workspace = true -sqlx = { version = "0.6", features = [ +sqlx = { version = "0.8", features = [ "runtime-tokio-rustls", "mysql", "postgres",