mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
[3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) (GH-31586)
(cherry picked from commit 3eb3b4f270
)
This commit is contained in:
parent
7190617b56
commit
3ea2a8f425
3 changed files with 79 additions and 64 deletions
|
@ -152,9 +152,16 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
|
|||
rc = sqlite3_bind_int64(self->st, pos, value);
|
||||
break;
|
||||
}
|
||||
case TYPE_FLOAT:
|
||||
rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter));
|
||||
case TYPE_FLOAT: {
|
||||
double value = PyFloat_AsDouble(parameter);
|
||||
if (value == -1 && PyErr_Occurred()) {
|
||||
rc = -1;
|
||||
}
|
||||
else {
|
||||
rc = sqlite3_bind_double(self->st, pos, value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TYPE_UNICODE:
|
||||
string = PyUnicode_AsUTF8AndSize(parameter, &buflen);
|
||||
if (string == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue