Skip to content

Commit

Permalink
Adapting shared_ptr for 0.10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Rosskopf committed May 25, 2024
1 parent bc17cb8 commit 62fdf19
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bics
Submodule bics updated from a591f0 to 4a328b
2 changes: 1 addition & 1 deletion odp
Submodule odp updated from 785f04 to 6da5bc
2 changes: 1 addition & 1 deletion rfc/src/include/sap_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace duckdb {
void AdaptValue(RfcInvocation &invocation, string &arg_name, Value &arg_value);
void AdaptValue(DATA_CONTAINER_HANDLE &container_handle, string &arg_name, Value &arg_value);
Value ConvertRfcValue(RfcInvocation &invocation, string &field_name);
Value ConvertRfcValue(shared_ptr<RfcInvocation> invocation, string &field_name);
Value ConvertRfcValue(std::shared_ptr<RfcInvocation> invocation, string &field_name);
Value ConvertCsvValue(Value &csv_value);

virtual std::string ToSqlLiteral();
Expand Down
2 changes: 1 addition & 1 deletion rfc/src/include/sap_rfc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace duckdb
void SetInactive();
void SetActive(idx_t projected_column_idx);
bool Finished();
std::shared_ptr<RfcReadColumnTask> CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output);
duckdb::shared_ptr<RfcReadColumnTask> CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output);
unsigned int GetRfcColumnIndex();
unsigned int GetProjectedColumnIndex();
std::shared_ptr<RfcConnection> GetConnection();
Expand Down
6 changes: 3 additions & 3 deletions rfc/src/sap_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ RfcFieldDesc::RfcFieldDesc(const RFC_FIELD_DESC& sap_desc) : _desc_handle(sap_de
return ConvertRfcValue(function_handle, field_name);
}

Value RfcType::ConvertRfcValue(shared_ptr<RfcInvocation> invocation, string &field_name)
Value RfcType::ConvertRfcValue(std::shared_ptr<RfcInvocation> invocation, string &field_name)
{
auto function_handle = invocation->GetFunctionHandle();
return ConvertRfcValue(function_handle, field_name);
Expand Down Expand Up @@ -1342,7 +1342,7 @@ RfcFieldDesc::RfcFieldDesc(const RFC_FIELD_DESC& sap_desc) : _desc_handle(sap_de
throw std::runtime_error(StringUtil::Format("Failed to invoke function:\n%s", rfcerrorinfo2std(error_info)));
}

return make_shared<RfcResultSet>(shared_from_this(), path);
return std::make_shared<RfcResultSet>(shared_from_this(), path);
}

std::shared_ptr<RfcResultSet> RfcInvocation::Invoke()
Expand Down Expand Up @@ -1752,7 +1752,7 @@ RfcFieldDesc::RfcFieldDesc(const RFC_FIELD_DESC& sap_desc) : _desc_handle(sap_de
std::vector<Value> &function_arguments,
std::string result_path)
{
auto func = make_shared<RfcFunction>(connection, function_name);
auto func = std::make_shared<RfcFunction>(connection, function_name);
auto invocation = function_arguments.size() > 0
? func->BeginInvocation(function_arguments)
: func->BeginInvocation();
Expand Down
6 changes: 3 additions & 3 deletions rfc/src/sap_rfc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace duckdb
std::vector<Value> RfcReadTableBindData::GetTableFieldMetas(std::shared_ptr<RfcConnection> connection, std::string table_name)
{
auto args = ArgBuilder().Add("TABNAME", Value(table_name));
auto func = make_shared<RfcFunction>(connection, "DDIF_FIELDINFO_GET");
auto func = std::make_shared<RfcFunction>(connection, "DDIF_FIELDINFO_GET");
auto func_args = args.BuildArgList();
auto invocation = func->BeginInvocation(func_args);
auto result_set = invocation->Invoke();
Expand Down Expand Up @@ -492,10 +492,10 @@ namespace duckdb
return current_state == ReadTableStates::FINISHED;
}

std::shared_ptr<RfcReadColumnTask> RfcReadColumnStateMachine::CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output)
duckdb::shared_ptr<RfcReadColumnTask> RfcReadColumnStateMachine::CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output)
{
std::lock_guard<mutex> t(thread_lock);
auto task = std::make_shared<RfcReadColumnTask>(this, client_context, column_output);
auto task = make_shared_ptr<RfcReadColumnTask>(this, client_context, column_output);
return task;
}

Expand Down
2 changes: 1 addition & 1 deletion rfc/src/scanner_describe_fields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace duckdb
auto connection = RfcAuthParams::FromContext(context).Connect();

// Create the function
auto func = make_shared<RfcFunction>(connection, "DDIF_FIELDINFO_GET");
auto func = std::make_shared<RfcFunction>(connection, "DDIF_FIELDINFO_GET");
auto func_args = CreateFunctionArguments(input);
auto invocation = func->BeginInvocation(func_args);
auto result_set = invocation->Invoke("/DFIES_TAB");
Expand Down
2 changes: 1 addition & 1 deletion rfc/src/scanner_describe_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static unique_ptr<FunctionData> RfcDescribeFunctionBind(ClientContext &context,

// Create the function
auto func_name = inputs[0].ToString();
auto func_handle = make_shared<RfcFunction>(connection, func_name);
auto func_handle = std::make_shared<RfcFunction>(connection, func_name);

auto func_args = CreateFunctionArguments(func_name);
auto result_set = RfcResultSet::InvokeFunction(connection, "RPY_FUNCTIONMODULE_READ", func_args);
Expand Down
7 changes: 1 addition & 6 deletions rfc/src/scanner_invoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ namespace duckdb
auto func_name = inputs[0].GetValue<string>();
auto func_args = std::vector<Value>(inputs.begin()+1, inputs.end());
auto path = GetPathNamedParam(input);
auto func = make_shared<RfcFunction>(connection, func_name);

// Create the invocation and bind arguments to it
auto invocation = func->BeginInvocation(func_args);
auto result_set = invocation->Invoke(path);
auto result_set = RfcResultSet::InvokeFunction(connection, func_name, func_args, path);
names = result_set->GetResultNames();
return_types = result_set->GetResultTypes();

// Make this invocation available to the bind data
auto bind_data = make_uniq<RfcFunctionBindData>();
bind_data->invocation = invocation;
bind_data->result_set = result_set;

return std::move(bind_data);
Expand Down
5 changes: 1 addition & 4 deletions rfc/src/scanner_show_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ namespace duckdb
auto connection = RfcAuthParams::FromContext(context).Connect();

// Create the function
auto func = make_shared<RfcFunction>(connection, "RFC_FUNCTION_SEARCH");
auto func_args = CreateFunctionArguments(input);
auto invocation = func->BeginInvocation(func_args);
auto result_set = invocation->Invoke("/FUNCTIONS");
auto result_set = RfcResultSet::InvokeFunction(connection, "RFC_FUNCTION_SEARCH", func_args, "/FUNCTIONS");
names = result_set->GetResultNames();
return_types = result_set->GetResultTypes();

auto bind_data = make_uniq<RfcFunctionBindData>();
bind_data->invocation = invocation;
bind_data->result_set = result_set;

return std::move(bind_data);
Expand Down
1 change: 0 additions & 1 deletion rfc/src/scanner_show_groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static unique_ptr<FunctionData> RfcShowGroupBind(ClientContext &context,
auto connection = RfcAuthParams::FromContext(context).Connect();

// Create the function
auto func = make_shared<RfcFunction>(connection, "RFC_GROUP_SEARCH");
auto func_args = CreateFunctionArguments(input);
auto result_set = RfcResultSet::InvokeFunction(connection, "RFC_GROUP_SEARCH", func_args, "/GROUPS");
names = std::vector<string>( { "name", "text" });
Expand Down

0 comments on commit 62fdf19

Please sign in to comment.