diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 1e26fae..ed98c23 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -16,9 +16,8 @@ jobs: name: Build extension binaries uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.0.0 with: - duckdb_version: v1.0.0 + duckdb_version: main extension_name: sqlsmith - exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' duckdb-stable-deploy: name: Deploy extension binaries @@ -26,7 +25,6 @@ jobs: uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@v1.0.0 secrets: inherit with: - duckdb_version: v1.0.0 + duckdb_version: main extension_name: sqlsmith - exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools' - deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} \ No newline at end of file + deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }} diff --git a/src/include/statement_generator.hpp b/src/include/statement_generator.hpp index d699a4d..2f361bb 100644 --- a/src/include/statement_generator.hpp +++ b/src/include/statement_generator.hpp @@ -58,16 +58,18 @@ class StatementGenerator { unique_ptr GenerateStatement(StatementType type); // came from private private: - unique_ptr GenerateAttachUse(); - unique_ptr GenerateSet(); unique_ptr GenerateAttach(); + unique_ptr GenerateCreate(); + unique_ptr GenerateDelete(); unique_ptr GenerateDetach(); + unique_ptr GenerateAttachUse(); unique_ptr GenerateSelect(); - unique_ptr GenerateCreate(); + unique_ptr GenerateSet(); + unique_ptr GenerateQueryNode(); - unique_ptr GenerateCreateInfo(); unique_ptr GenerateAttachInfo(); + unique_ptr GenerateCreateInfo(); unique_ptr GenerateDetachInfo(); void GenerateCTEs(QueryNode &node); diff --git a/src/statement_generator.cpp b/src/statement_generator.cpp index 21a555d..4e20391 100644 --- a/src/statement_generator.cpp +++ b/src/statement_generator.cpp @@ -109,6 +109,9 @@ unique_ptr StatementGenerator::GenerateStatement() { if (RandomPercentage(30)) { return GenerateStatement(StatementType::SET_STATEMENT); } + if (RandomPercentage(40)) { //20 + return GenerateStatement(StatementType::DELETE_STATEMENT); + } return GenerateStatement(StatementType::CREATE_STATEMENT); } @@ -125,6 +128,8 @@ unique_ptr StatementGenerator::GenerateStatement(StatementType typ // generate USE statement case StatementType::SET_STATEMENT: return GenerateSet(); + case StatementType::DELETE_STATEMENT: + return GenerateDelete(); default: throw InternalException("Unsupported type"); } @@ -175,6 +180,26 @@ unique_ptr StatementGenerator::GenerateAttachUse() { return multi_statement; } +unique_ptr StatementGenerator::GenerateDelete() { + auto delete_statement = make_uniq(); + auto state = GetDatabaseState(context); + if (!generator_context->tables_and_views.empty()) { + auto &entry_ref = Choose(generator_context->tables_and_views); + auto &entry = entry_ref.get(); + if (entry.type == CatalogType::TABLE_ENTRY) { + auto result = make_uniq(); + result->table_name = entry.name; + delete_statement->table = std::move(result); + } else { + delete_statement->table = GenerateTableRef(); + } + } else { + delete_statement->table = GenerateTableRef(); + } + + return delete_statement; +} + //===--------------------------------------------------------------------===// // Generate Detach Info //===--------------------------------------------------------------------===//