Skip to content

Conversation

@r2evans
Copy link

@r2evans r2evans commented Jan 16, 2026

No description provided.

@r2evans r2evans changed the title fix #491, error and/or r-crash when lengths(params) are diff with POSIXt Fix error and/or r-crash when lengths(params) are different Jan 16, 2026
@r2evans r2evans mentioned this pull request Jan 16, 2026
R/dbi-result.R Outdated
lens <- lengths(params[!paramDfs])
maxlen <- max(lens)
if (!all(lens %in% c(maxlen, 1L))) {
cli::cli_abort("When sending multiple parameters, all must be the same length or length 1")
Copy link
Member

Choose a reason for hiding this comment

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

odbc already implicitly depends on vctrs via blob and hms, so I think we could make an explicit dependency, and then you could do:

params[!paramDfs] <- vctrs::vec_common_recycle(!!!params[!paramDfs], .arg = "params")

And that will handle both the error message and the recycling.

Copy link
Author

Choose a reason for hiding this comment

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

vctrs::vec_recycle_common :-)

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.

2 participants