This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients berker.peksag, erlendaasland, serhiy.storchaka
Date 2021-02-26.11:22:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614338540.57.0.185180748159.issue43296@roundup.psfhosted.org>
In-reply-to
Content
> 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?
History
Date User Action Args
2021-02-26 11:22:20erlendaaslandsetrecipients: + erlendaasland, berker.peksag, serhiy.storchaka
2021-02-26 11:22:20erlendaaslandsetmessageid: <1614338540.57.0.185180748159.issue43296@roundup.psfhosted.org>
2021-02-26 11:22:20erlendaaslandlinkissue43296 messages
2021-02-26 11:22:20erlendaaslandcreate