Skip to content

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Feb 10, 2025

Consistently raise ProgrammingError if the user tries to create an UDF
with an invalid number of parameters.

…on misuse

Consistently raise ProgrammingError if the user tries to create an UDF
with an invalid number of parameters.
@erlend-aasland erlend-aasland force-pushed the sqlite/check-num-params branch from fa21de0 to 8424b44 Compare February 10, 2025 07:46
check_num_params(pysqlite_Connection *self, const int n, const char *name)
{
int limit = sqlite3_limit(self->db, SQLITE_LIMIT_FUNCTION_ARG, -1);
assert(limit >= 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As long as we call this on a valid database pointer (checked via pysqlite_check_connection), we can assert we won't fail here.

@erlend-aasland erlend-aasland merged commit 3a2e7aa into python:main Feb 11, 2025
42 checks passed
@erlend-aasland erlend-aasland deleted the sqlite/check-num-params branch February 11, 2025 07:26
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.

1 participant