diff --git a/include/pgduckdb/pgduckdb_planner.hpp b/include/pgduckdb/pgduckdb_planner.hpp index 1784a46f..7977e6c4 100644 --- a/include/pgduckdb/pgduckdb_planner.hpp +++ b/include/pgduckdb/pgduckdb_planner.hpp @@ -11,6 +11,6 @@ extern "C" { extern bool duckdb_explain_analyze; -PlannedStmt *DuckdbPlanNode(Query *parse, int cursor_options, ParamListInfo bound_params); +PlannedStmt *DuckdbPlanNode(Query *parse, int cursor_options); std::tuple, duckdb::unique_ptr> -DuckdbPrepare(const Query *query, ParamListInfo bound_params); +DuckdbPrepare(const Query *query); diff --git a/src/pgduckdb_hooks.cpp b/src/pgduckdb_hooks.cpp index 486c58af..9759b901 100644 --- a/src/pgduckdb_hooks.cpp +++ b/src/pgduckdb_hooks.cpp @@ -119,7 +119,7 @@ static PlannedStmt * DuckdbPlannerHook(Query *parse, const char *query_string, int cursor_options, ParamListInfo bound_params) { if (pgduckdb::IsExtensionRegistered()) { if (duckdb_execution && IsAllowedStatement(parse)) { - PlannedStmt *duckdbPlan = DuckdbPlanNode(parse, cursor_options, bound_params); + PlannedStmt *duckdbPlan = DuckdbPlanNode(parse, cursor_options); if (duckdbPlan) { return duckdbPlan; } @@ -129,7 +129,7 @@ DuckdbPlannerHook(Query *parse, const char *query_string, int cursor_options, Pa if (!IsAllowedStatement(parse)) { elog(ERROR, "(PGDuckDB/DuckdbPlannerHook) Only SELECT statements involving DuckDB are supported."); } - PlannedStmt *duckdbPlan = DuckdbPlanNode(parse, cursor_options, bound_params); + PlannedStmt *duckdbPlan = DuckdbPlanNode(parse, cursor_options); if (duckdbPlan) { return duckdbPlan; } diff --git a/src/pgduckdb_node.cpp b/src/pgduckdb_node.cpp index ef4585d2..6c6c8fa2 100644 --- a/src/pgduckdb_node.cpp +++ b/src/pgduckdb_node.cpp @@ -62,7 +62,7 @@ Duckdb_CreateCustomScanState(CustomScan *cscan) { void Duckdb_BeginCustomScan(CustomScanState *cscanstate, EState *estate, int eflags) { DuckdbScanState *duckdb_scan_state = (DuckdbScanState *)cscanstate; - auto prepare_result = DuckdbPrepare(duckdb_scan_state->query, estate->es_param_list_info); + auto prepare_result = DuckdbPrepare(duckdb_scan_state->query); auto prepared_query = std::move(std::get<0>(prepare_result)); auto duckdb_connection = std::move(std::get<1>(prepare_result)); diff --git a/src/pgduckdb_planner.cpp b/src/pgduckdb_planner.cpp index 7276bad5..5a793ee5 100644 --- a/src/pgduckdb_planner.cpp +++ b/src/pgduckdb_planner.cpp @@ -24,7 +24,7 @@ extern "C" { bool duckdb_explain_analyze = false; std::tuple, duckdb::unique_ptr> -DuckdbPrepare(const Query *query, ParamListInfo bound_params) { +DuckdbPrepare(const Query *query) { Query *copied_query = (Query *)copyObjectImpl(query); /* @@ -61,11 +61,11 @@ DuckdbPrepare(const Query *query, ParamListInfo bound_params) { } static Plan * -CreatePlan(Query *query, ParamListInfo bound_params) { +CreatePlan(Query *query) { /* * Prepare the query, se we can get the returned types and column names. */ - auto prepare_result = DuckdbPrepare(query, bound_params); + auto prepare_result = DuckdbPrepare(query); auto prepared_query = std::move(std::get<0>(prepare_result)); if (prepared_query->HasError()) { @@ -114,9 +114,9 @@ CreatePlan(Query *query, ParamListInfo bound_params) { } PlannedStmt * -DuckdbPlanNode(Query *parse, int cursor_options, ParamListInfo bound_params) { +DuckdbPlanNode(Query *parse, int cursor_options) { /* We need to check can we DuckDB create plan */ - Plan *duckdb_plan = (Plan *)castNode(CustomScan, CreatePlan(parse, bound_params)); + Plan *duckdb_plan = (Plan *)castNode(CustomScan, CreatePlan(parse)); if (!duckdb_plan) { return nullptr;