diff options
| author | Gerhard Häring <gh@ghaering.de> | 2008-03-28 20:08:36 (GMT) |
|---|---|---|
| committer | Gerhard Häring <gh@ghaering.de> | 2008-03-28 20:08:36 (GMT) |
| commit | 2a11c05b9d0ceac23a08418a2a2d26acc0993dc9 (patch) | |
| tree | 33651a73732335c048ffd4e65092fcc2bcd406b6 /Modules/_sqlite/cursor.c | |
| parent | d289ea6df96e9e24e17914070fd5c2594e44413e (diff) | |
| download | cpython-2a11c05b9d0ceac23a08418a2a2d26acc0993dc9.zip cpython-2a11c05b9d0ceac23a08418a2a2d26acc0993dc9.tar.gz cpython-2a11c05b9d0ceac23a08418a2a2d26acc0993dc9.tar.bz2 | |
Update sqlite3 module to match current version of pysqlite.
Diffstat (limited to 'Modules/_sqlite/cursor.c')
| -rw-r--r-- | Modules/_sqlite/cursor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 566e4ff..2681fc7 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -424,10 +424,14 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* PyObject* descriptor; PyObject* second_argument = NULL; long rowcount = 0; + int allow_8bit_chars; if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) { return NULL; } + /* Make shooting yourself in the foot with not utf-8 decodable 8-bit-strings harder */ + allow_8bit_chars = ((self->connection->text_factory != (PyObject*)&PyUnicode_Type) && + (self->connection->text_factory != (PyObject*)&PyUnicode_Type && pysqlite_OptimizedUnicode)); Py_XDECREF(self->next_row); self->next_row = NULL; @@ -592,7 +596,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* pysqlite_statement_mark_dirty(self->statement); - pysqlite_statement_bind_parameters(self->statement, parameters); + pysqlite_statement_bind_parameters(self->statement, parameters, allow_8bit_chars); if (PyErr_Occurred()) { goto error; } |
