Browse files

Added a note about SQLite versions before 3.3.6. Refs #7570. Thanks, …


git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent cdffe90 commit d7e37b661c33c563a0cbca892697c62b52312223 @jacobian jacobian committed Sep 3, 2008
Showing with 34 additions and 0 deletions.
  1. +34 −0 docs/ref/databases.txt
@@ -238,6 +238,40 @@ of that field for more details, but usually this won't be something that will
matter unless you're printing out the field values and are expecting to see
``True`` and ``False.``.
+.. _sqlite-notes:
+SQLite notes
+Versions of SQLite 3.3.5 and older `contain a bug`_ when handling ``ORDER BY``
+parameters. This can cause problems when you use the ``select`` parameter for
+the ``extra()`` QuerySet method. The bug can be identified by the error message
+``OperationalError: ORDER BY terms must not be non-integer constants``. The
+problem can be solved updating SQLite to version 3.3.6 or newer, possibly also
+updating the ``pysqlite2`` Python module in the process.
+.. _contain a bug:
+This has a very low impact because 3.3.6 was released in April 2006, so most
+current binary distributions for different platforms include newer version of
+SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3``
+However, in the case of Windows, the official binary distribution of the stable
+release of Python 2.5 (2.5.2 as of now) includes SQLite 3.3.4 so the bug can
+make itself evident in that platform. There are (as of Django 1.0) even three
+tests in the Django test suite that will fail when run under this setup. As
+described above, this can be solved by downloading and installing a newer
+version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and
+uses a newer version of SQLite. Python 2.6 will ship with a newer version of
+SQLite and so will no be affected by this issue.
+If you are in such platform and find yourself in the need to update
+``pysqlite``/SQLite, you will also need to manually modify the
+``django/db/backends/sqlite3/`` file in the Django source tree so it
+attempts to import ``pysqlite2`` before that ``sqlite3`` and so it can take
+advantage of the new ``pysqlite2``/SQLite versions.
.. _oracle-notes:

0 comments on commit d7e37b6

Please sign in to comment.