Skip to content

Conversation

krlmlr
Copy link
Collaborator

@krlmlr krlmlr commented Feb 26, 2023

Closes #6465.

This adds a tiny change to the vendored cpp11 code, we should eventually upstream it to take advantage of future updates.

@krlmlr krlmlr requested a review from hannes February 26, 2023 19:05
@krlmlr krlmlr force-pushed the f-rel-prot branch 2 times, most recently from c8ebf68 to 9fc219d Compare February 26, 2023 19:46
}

[[cpp11::register]] SEXP rapi_rel_set_diff(duckdb::rel_extptr_t rel_a, duckdb::rel_extptr_t rel_b) {
auto res = std::make_shared<SetOpRelation>(rel_a->rel, rel_b->rel, SetOperationType::EXCEPT);
return make_external<RelationWrapper>("duckdb_relation", res);

cpp11::writable::list prot = {rel_a, rel_b};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but can't we do the list wrapping in make_external_prot, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean passing two arguments to make_external_prot(), or just inlining the prot variable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of the latter but not sure if it still shows the desired behaviour

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it would, the temporary list won't be destroyed for the duration of the make_external()call, and hece will remain protected. We can try in a second iteration.

@hannes hannes merged commit 7122507 into duckdb:master Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

R: Protection error in relational API
2 participants