[Python-checkins] r46962 - in python/trunk: Lib/sqlite3/test/hooks.py Lib/sqlite3/test/userfunctions.py Modules/_sqlite/connection.c

Anthony Baxter anthony at interlink.com.au
Thu Jun 15 03:46:17 CEST 2006


On Thursday 15 June 2006 08:28, gerhard.haering wrote:

> - Added version checks in C code to make sure we don't trigger bugs
> in older SQLite versions.
> - Added version checks in test suite so that we don't execute tests
> that we know will fail with older (buggy) SQLite versions.
>
> Now, all tests should run against all SQLite versions from 3.0.8
> until 3.3.6 (latest one now). The sqlite3 module can be built
> against all these SQLite versions and the sqlite3 module does its
> best to not trigger bugs in SQLite, but using SQLite 3.3.3 or later
> is recommended.

> +void _sqlite3_result_error(sqlite3_context* ctx, const char*
> errmsg, int len) +{
> +    /* in older SQLite versions, calling sqlite3_result_error in
> callbacks +     * triggers a bug in SQLite that leads either to
> irritating results or +     * segfaults, depending on the SQLite
> version */
> +#if SQLITE_VERSION_NUMBER >= 3003003
> +    sqlite3_result_error(ctx, errmsg, len);
> +#endif

Could this code at least set a generic error message, saying something 
like "Unknown SQLite error in callback (see documentation for 
explanation)" and have a note in the docs saying "SQLite older than 
3.3.3 is buggy and can't give useful callback errors". Hm. Is the 
underlying sqlite3 version number even exported to Python?

Anthony
-- 
Anthony Baxter     <anthony at interlink.com.au>
It's never too late to have a happy childhood.


More information about the Python-checkins mailing list