diff options
author | Gerhard Häring <gh@ghaering.de> | 2006-07-02 17:48:30 (GMT) |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2006-07-02 17:48:30 (GMT) |
commit | 762fbd34858f7df608e6da8079bf648bc7d3d8cc (patch) | |
tree | e13a3f77d934422ff11bf4229032cff87b9a4b60 /Modules/_sqlite | |
parent | 6ffe499397acfe916202e3e46adfa868e6a307b9 (diff) | |
download | cpython-762fbd34858f7df608e6da8079bf648bc7d3d8cc.zip cpython-762fbd34858f7df608e6da8079bf648bc7d3d8cc.tar.gz cpython-762fbd34858f7df608e6da8079bf648bc7d3d8cc.tar.bz2 |
The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/cursor.c | 5 | ||||
-rw-r--r-- | Modules/_sqlite/module.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 98f5e0d..94aea9b 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -321,12 +321,13 @@ PyObject* _fetch_one_row(Cursor* self) } if (converter != Py_None) { - val_str = (const char*)sqlite3_column_text(self->statement->st, i); + nbytes = sqlite3_column_bytes(self->statement->st, i); + val_str = (const char*)sqlite3_column_blob(self->statement->st, i); if (!val_str) { Py_INCREF(Py_None); converted = Py_None; } else { - item = PyString_FromString(val_str); + item = PyString_FromStringAndSize(val_str, nbytes); if (!item) { return NULL; } diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h index 3fdac61..e514bd1 100644 --- a/Modules/_sqlite/module.h +++ b/Modules/_sqlite/module.h @@ -25,7 +25,7 @@ #define PYSQLITE_MODULE_H #include "Python.h" -#define PYSQLITE_VERSION "2.3.1" +#define PYSQLITE_VERSION "2.3.2" extern PyObject* Error; extern PyObject* Warning; |