mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -518,7 +518,11 @@ _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
|
|||
return -1;
|
||||
sqlite3_result_int64(context, value);
|
||||
} else if (PyFloat_Check(py_val)) {
|
||||
sqlite3_result_double(context, PyFloat_AsDouble(py_val));
|
||||
double value = PyFloat_AsDouble(py_val);
|
||||
if (value == -1 && PyErr_Occurred()) {
|
||||
return -1;
|
||||
}
|
||||
sqlite3_result_double(context, value);
|
||||
} else if (PyUnicode_Check(py_val)) {
|
||||
Py_ssize_t sz;
|
||||
const char *str = PyUnicode_AsUTF8AndSize(py_val, &sz);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue