gh-117995: Don't raise DeprecationWarnings for indexed nameless params (#118001)

Filter out '?NNN' placeholders when looking for named params.

Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
Erlend E. Aasland 2024-04-22 08:43:20 +02:00 committed by GitHub
parent 8b541c017e
commit 550483b7e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 1 deletions

View file

@ -669,7 +669,7 @@ 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) {
if (name != NULL && name[0] != '?') {
int ret = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
"Binding %d ('%s') is a named parameter, but you "
"supplied a sequence which requires nameless (qmark) "