diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index c2037ad..2ff0b30 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -14,29 +14,30 @@ concurrency: jobs: duckdb-stable-build: name: Build extension binaries - uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@0e784765f6f87bd1ce9034afcce1e7f89fcd8777 + uses: duckdb/duckdb/.github/workflows/_extension_distribution.yml@4a89d97db8a5a23a15f3025c8d2d2885337c2637 with: - duckdb_version: v0.10.0 + duckdb_version: v0.10.1 extension_name: mysql_scanner exclude_archs: 'osx_amd64;osx_arm64;wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' vcpkg_commit: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 + build_duckdb_shell: false # Note: this workaround is required for building MacOS where extra toolchain config is required duckdb-stable-build-macos: name: Build extension binaries uses: ./.github/workflows/_extension_distribution_macos.yml with: - duckdb_version: v0.10.0 + duckdb_version: v0.10.1 extension_name: mysql_scanner vcpkg_commit: a42af01b72c28a8e1d7b48107b33e4f286a55ef6 duckdb-stable-deploy: name: Deploy extension binaries needs: [duckdb-stable-build, duckdb-stable-build-macos] - uses: duckdb/duckdb/.github/workflows/_extension_deploy.yml@0e784765f6f87bd1ce9034afcce1e7f89fcd8777 + uses: duckdb/duckdb/.github/workflows/_extension_deploy.yml@4a89d97db8a5a23a15f3025c8d2d2885337c2637 secrets: inherit with: - duckdb_version: v0.10.0 + duckdb_version: v0.10.1 extension_name: mysql_scanner exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} diff --git a/Makefile b/Makefile index bdc6e13..9817df9 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ endif ifneq ("${VCPKG_TARGET_TRIPLET}", "") TOOLCHAIN_FLAGS:=${TOOLCHAIN_FLAGS} -DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET}' endif +ifeq (${BUILD_SHELL},0) + TOOLCHAIN_FLAGS:=${TOOLCHAIN_FLAGS} -DBUILD_SHELL=0 +endif ifeq ($(GEN),ninja) GENERATOR=-G "Ninja" diff --git a/src/storage/mysql_optimizer.cpp b/src/storage/mysql_optimizer.cpp index f7b0917..3f3b1c4 100644 --- a/src/storage/mysql_optimizer.cpp +++ b/src/storage/mysql_optimizer.cpp @@ -23,16 +23,28 @@ void OptimizeMySQLScan(unique_ptr &op) { if (!IsMySQLScan(get.function.name)) { return; } - if (limit.limit || limit.offset) { - // not a constant limit + switch (limit.limit_val.Type()) { + case LimitNodeType::CONSTANT_VALUE: + case LimitNodeType::UNSET: + break; + default: + // not a constant or unset limit + return; + } + switch (limit.offset_val.Type()) { + case LimitNodeType::CONSTANT_VALUE: + case LimitNodeType::UNSET: + break; + default: + // not a constant or unset offset return; } auto &bind_data = get.bind_data->Cast(); - if (limit.limit_val > 0) { - bind_data.limit += " LIMIT " + to_string(limit.limit_val); + if (limit.limit_val.Type() != LimitNodeType::UNSET) { + bind_data.limit += " LIMIT " + to_string(limit.limit_val.GetConstantValue()); } - if (limit.offset_val > 0) { - bind_data.limit += " OFFSET " + to_string(limit.offset_val); + if (limit.offset_val.Type() != LimitNodeType::UNSET) { + bind_data.limit += " OFFSET " + to_string(limit.offset_val.GetConstantValue()); } // remove the limit op = std::move(op->children[0]); diff --git a/test/sql/attach_types.test b/test/sql/attach_types.test index b15bf1b..c40b804 100644 --- a/test/sql/attach_types.test +++ b/test/sql/attach_types.test @@ -33,7 +33,8 @@ NULL NULL NULL NULL # test all types statement ok CREATE TABLE all_types_tbl AS SELECT * -EXCLUDE (float, double, ubigint, hugeint, uhugeint, int_array, double_array, date_array, timestamp_array, timestamptz_array, varchar_array, nested_int_array, struct, struct_of_arrays, array_of_structs, map, "union") +EXCLUDE (float, double, ubigint, hugeint, uhugeint, int_array, double_array, date_array, timestamp_array, timestamptz_array, varchar_array, nested_int_array, struct, struct_of_arrays, array_of_structs, map, "union",fixed_int_array,fixed_varchar_array,fixed_nested_varchar_array,list_of_fixed_int_array,fixed_array_of_int_list,fixed_nested_int_array,struct_of_fixed_array,fixed_struct_array +) REPLACE( CASE WHEN int IS NOT NULL THEN '2000-01-01' ELSE NULL END AS date, CASE WHEN int IS NOT NULL THEN '2000-01-01 01:02:03' ELSE NULL END AS timestamp,