diff options
author | Gerhard Häring <gh@ghaering.de> | 2007-01-14 01:43:50 +0000 |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2007-01-14 01:43:50 +0000 |
commit | 0741a60ca7b332b755d8a6b3328da414f963f7b4 (patch) | |
tree | 470ec59548f5d0a1a875183c9edeedf8bd97454d /Modules/_sqlite/microprotocols.c | |
parent | b1a8ef629753ddfd23968a4418669ebbda83c835 (diff) | |
download | cpython-git-0741a60ca7b332b755d8a6b3328da414f963f7b4.tar.gz |
Merged changes from standalone version 2.3.3. This should probably all be
merged into the 2.5 maintenance branch:
- self->statement was not checked while fetching data, which could
lead to crashes if you used the pysqlite API in unusual ways.
Closing the cursor and continuing to fetch data was enough.
- Converters are stored in a converters dictionary. The converter name
is uppercased first. The old upper-casing algorithm was wrong and
was replaced by a simple call to the Python string's upper() method
instead.
-Applied patch by Glyph Lefkowitz that fixes the problem with
subsequent SQLITE_SCHEMA errors.
- Improvement to the row type: rows can now be iterated over and have a keys()
method. This improves compatibility with both tuple and dict a lot.
- A bugfix for the subsecond resolution in timestamps.
- Corrected the way the flags PARSE_DECLTYPES and PARSE_COLNAMES are
checked for. Now they work as documented.
- gcc on Linux sucks. It exports all symbols by default in shared
libraries, so if symbols are not unique it can lead to problems with
symbol lookup. pysqlite used to crash under Apache when mod_cache
was enabled because both modules had the symbol cache_init. I fixed
this by applying the prefix pysqlite_ almost everywhere. Sigh.
Diffstat (limited to 'Modules/_sqlite/microprotocols.c')
-rw-r--r-- | Modules/_sqlite/microprotocols.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c index 4956ac073b..5a78917d3b 100644 --- a/Modules/_sqlite/microprotocols.c +++ b/Modules/_sqlite/microprotocols.c @@ -57,7 +57,7 @@ microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast) PyObject* key; int rc; - if (proto == NULL) proto = (PyObject*)&SQLitePrepareProtocolType; + if (proto == NULL) proto = (PyObject*)&pysqlite_PrepareProtocolType; key = Py_BuildValue("(OO)", (PyObject*)type, proto); if (!key) { @@ -78,7 +78,7 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt) PyObject *adapter, *key; /* we don't check for exact type conformance as specified in PEP 246 - because the SQLitePrepareProtocolType type is abstract and there is no + because the pysqlite_PrepareProtocolType type is abstract and there is no way to get a quotable object to be its instance */ /* look for an adapter in the registry */ @@ -125,17 +125,17 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt) } /* else set the right exception and return NULL */ - PyErr_SetString(ProgrammingError, "can't adapt"); + PyErr_SetString(pysqlite_ProgrammingError, "can't adapt"); return NULL; } /** module-level functions **/ PyObject * -psyco_microprotocols_adapt(Cursor *self, PyObject *args) +psyco_microprotocols_adapt(pysqlite_Cursor *self, PyObject *args) { PyObject *obj, *alt = NULL; - PyObject *proto = (PyObject*)&SQLitePrepareProtocolType; + PyObject *proto = (PyObject*)&pysqlite_PrepareProtocolType; if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL; return microprotocols_adapt(obj, proto, alt); |