Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…ramiro.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d7e37b661c33c563a0cbca892697c62b52312223 1 parent cdffe90
Jacob Kaplan-Moss authored September 03, 2008

Showing 1 changed file with 34 additions and 0 deletions. Show diff stats Hide diff stats

  1. 34  docs/ref/databases.txt
34  docs/ref/databases.txt
@@ -238,6 +238,40 @@ of that field for more details, but usually this won't be something that will
238 238
 matter unless you're printing out the field values and are expecting to see
239 239
 ``True`` and ``False.``.
240 240
 
  241
+.. _sqlite-notes:
  242
+
  243
+
  244
+SQLite notes 
  245
+============ 
  246
+ 
  247
+Versions of SQLite 3.3.5 and older `contain a bug`_ when handling ``ORDER BY``
  248
+parameters. This can cause problems when you use the ``select`` parameter for
  249
+the ``extra()`` QuerySet method. The bug can be identified by the error message
  250
+``OperationalError: ORDER BY terms must not be non-integer constants``. The
  251
+problem can be solved updating SQLite to version 3.3.6 or newer, possibly also
  252
+updating the ``pysqlite2`` Python module in the process.
  253
+ 
  254
+.. _contain a bug: http://www.sqlite.org/cvstrac/tktview?tn=1768 
  255
+ 
  256
+This has a very low impact because 3.3.6 was released in April 2006, so most 
  257
+current binary distributions for different platforms include newer version of 
  258
+SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3`` 
  259
+modules. 
  260
+ 
  261
+However, in the case of Windows, the official binary distribution of the stable 
  262
+release of Python 2.5 (2.5.2 as of now) includes SQLite 3.3.4 so the bug can 
  263
+make itself evident in that platform. There are (as of Django 1.0) even three 
  264
+tests in the Django test suite that will fail when run under this setup.  As 
  265
+described above, this can be solved by downloading and installing a newer 
  266
+version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and 
  267
+uses a newer version of SQLite. Python 2.6 will ship with a newer version of 
  268
+SQLite and so will no be affected by this issue. 
  269
+ 
  270
+If you are in such platform and find yourself in the need to update 
  271
+``pysqlite``/SQLite, you will also need to manually modify the 
  272
+``django/db/backends/sqlite3/base.py`` file in the Django source tree so it 
  273
+attempts to import ``pysqlite2`` before that ``sqlite3`` and so it can take 
  274
+advantage of the new ``pysqlite2``/SQLite versions.
241 275
 
242 276
 .. _oracle-notes:
243 277
 

0 notes on commit d7e37b6

Please sign in to comment.
Something went wrong with that request. Please try again.