Skip to content

Commit

Permalink
We need to refactor bind_parameters() so it returns -1 on error
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland committed May 20, 2024
1 parent 4bde862 commit 50a746b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,12 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
for (i = 0; i < num_params; i++) {
const char *name = sqlite3_bind_parameter_name(self->st, i+1);
if (name != NULL && name[0] != '?') {
return PyErr_Format(state->ProgrammingError,
PyErr_Format(state->ProgrammingError,
"Binding %d ('%s') is a named parameter, but you "
"supplied a sequence which requires nameless (qmark) "
"placeholders.",
i+1, name);
return;
}

if (PyTuple_CheckExact(parameters)) {
Expand Down

0 comments on commit 50a746b

Please sign in to comment.