Message387719
> If sqlite3_value_blob() returns NULL, we should check if sqlite3_errcode() equals SQLITE_NOMEM and raise MemoryError if it does.
This also applies to sqlite3_value_text().
It also applies to sqlite3_value_bytes() if a conversion takes place. We don't need to care about that as long as we call sqlite3_value_bytes() after conversion.
Also, PyTuple_SetItem() errors are not checked.
I would also suggest using PyUnicode_FromStringAndSize() iso. PyUnicode_FromString() in case SQLITE_TEXT, to avoid the unneeded strlen(). After sqlite3_value_text() is called, we can just use sqlite3_value_bytes(), since the length is precomputed as a result of the conversion.
Berker, would you allow a PR to improve all these issues in _pysqlite_build_py_params(), or would you prefer them split up in multiple PR's? |
|
Date |
User |
Action |
Args |
2021-02-26 11:22:20 | erlendaasland | set | recipients:
+ erlendaasland, berker.peksag, serhiy.storchaka |
2021-02-26 11:22:20 | erlendaasland | set | messageid: <1614338540.57.0.185180748159.issue43296@roundup.psfhosted.org> |
2021-02-26 11:22:20 | erlendaasland | link | issue43296 messages |
2021-02-26 11:22:20 | erlendaasland | create | |
|