Commit Graph

263 Commits

Author SHA1 Message Date
Malcolm Tredinnick 9d0bacebd2 Fixed #3501 -- Fixed date filtering in querysets for nullable date fields. Only
affects SQLite.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:48:24 +00:00
Ian Kelly 43b03ba57d Refs #9408: Removed support for passing params as dicts in the oracle backend. Wasn't documented, didn't work, isn't necessary.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-14 00:54:16 +00:00
Karen Tracey cb6a5886f6 Fixed #5079 -- Avoid converting Decimals to floats during save to the database.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-12 00:35:24 +00:00
Malcolm Tredinnick 3dfbaae32b Fixed #9307 -- Added the ability to pickle the Query class used by the Oracle
backend.

This allows Querysets to be cached for Oracle and should provide a model for
adding pickling support to other (external) database backends that need a
custom Query class.

Thanks to Justin Bronn for some assistance with this patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9272 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 09:36:22 +00:00
Ian Kelly 934025e58d Fixed #9136: Do slicing in Oracle with rownum instead of row_number() for a speed improvement. Thanks, Guillaume Taglang.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9235 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-18 00:00:20 +00:00
Ian Kelly 51d101b573 Fixed Oracle introspection mapping of DATE columns, and added an entry for Oracle 10g native float columns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-13 19:38:18 +00:00
Ian Kelly 9a72913edd Fixed .distinct() not working with slicing in Oracle, due to the
row numbers necessarily being distinct.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 17:15:58 +00:00
Malcolm Tredinnick e99cd48769 Fixed #9113 -- Improved exception message reporting when importing sqlite3 fails.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-17 07:23:17 +00:00
Ian Kelly 0cd7fbec56 Fixed an incorrectly named DatabaseOperations method. It was causing non-Oracle backends to fail when running syncdb with tablespaces set.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-10 23:03:07 +00:00
Adrian Holovaty 42a878cfea db: Gave each DatabaseClient class an 'executable_name' attribute (e.g., 'psql' or 'mysql'), so that we can use it to make a more helpful error message. Refs #8978
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-09 02:13:58 +00:00
Matt Boersma 1b39622327 Fixed re-raising of ORA-01400 as an IntegrityError in a way that works on Python 2.3 and 2.4 as well.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-04 16:41:59 +00:00
Jacob Kaplan-Moss 3a18002bbd Fixed #8210 and #8664: moved `USStateField` and `PhoneNumberField` to `django.contrib.localflavor.us`. This is a backwards-incompatible change, albeit a minor one; just add an aditional `import` and go on your way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:15:35 +00:00
Ian Kelly d2f420ec8a Corrected Oracle DatabaseError definition.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8810 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 19:58:41 +00:00
Ian Kelly c887d71e76 Fixed escaping of wildcard characters in iexact lookups in Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 19:37:48 +00:00
Jacob Kaplan-Moss e545058ba9 Fixed #8354: the MySQL backend no longer raises a cryptic error. Instead, it raises a less-cryptic error. Obiously this isn't a perfect solution by any means, but it'll do until we can revisit timezone handling in the future.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:48:39 +00:00
Malcolm Tredinnick 4480645ac3 Fixed #8316 -- Put tighter restrictions on the type of Foreign Key fields
created for MySQL (because MySQL + InnoDB has those restrictions).
Patch from julianb.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 00:49:03 +00:00
Malcolm Tredinnick 90279aeaf0 Fixed #8575 -- Catch one particular instance of OperationalError in MySQL and
convert it to an IntegrityError, which seems like the more natural case (and is
consistent with other backends). This makes exception handling in Django much
easier.

The solution is extensible for any other error codes we may wish to add going
forwards.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 04:30:07 +00:00
Malcolm Tredinnick 21672c26bf Fixed #8592 -- Fixed a bug in the way savepoint usage was disabled for
PostgreSQL < 8.0.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 06:49:00 +00:00
Malcolm Tredinnick 71dda19184 Fixed #8597 -- Allow the use of strings containing underscores and percentage
signs in "iexact" queries on PostgreSQL again (this case was missed in [8536]).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 05:42:05 +00:00
Malcolm Tredinnick 4f711eb5e3 Fixed #8347 -- Added a few missing field type conversion to SQLite's inspectdb
handling. Patch from trbs.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 08:58:07 +00:00
Matt Boersma 1aa4889808 Fixed get_or_create test case for Oracle by re-raising the more specific IntegrityError for "ORA-01400: Cannot insert NULL into [table.col]"
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 17:20:28 +00:00
Jacob Kaplan-Moss 3df7266056 Fixed #3575: use UPPER() instead ILIKE for postgres case-insensitive comparisons.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 12:56:06 +00:00
Malcolm Tredinnick 29d2160213 Fixed #7464 -- Fixed the psycopg2 backend to handle SafeString values as
parameters. Based on a patch from Digitalxero@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8532 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 04:13:27 +00:00
Matt Boersma 6b5a607606 Fixed #7628 -- Oracle backend won't try to recreate existing sequences during syncdb. Thanks, cmarshal.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-24 20:16:56 +00:00
Malcolm Tredinnick 64ca36bf08 Fixed #8214 -- Added back a stringification that was dropped during [8131].
This restores filtering on dates in the admin, for example. Thanks to akfarrell
and a small team of workers at the Portland Sprint.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 18:01:16 +00:00
Brian Rosner 264771f1b6 Fixed #7536 -- Added NEWDECIMAL to introspection types in the mysql backend. Thanks Jerome Etienne for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 04:14:23 +00:00
Matt Boersma 6e36ce1429 Fixed Oracle backend limit/offset SQL to again use extra_select, properly this time. This cleans up a test case failure, and hopefully gets contrib.gis working again.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8471 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-22 20:26:20 +00:00
Russell Keith-Magee 0d3dd8b68b Fixed #8485: Reordered imports in the database backends to ensure that the availability of the MySQL and Oracle backends is confirmed before any attempt is made to use the backend. Many thanks to Karen Tracey for her work in narrowing down a number of vague reports into a concrete problem.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-22 14:18:53 +00:00
Matt Boersma db76b1e89d Fixed Oracle backend not to use extra_select for limit/offset type queries, which fixes a majority of the currently failing tests. Thanks, Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8445 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-19 23:04:34 +00:00
Russell Keith-Magee 7299b39752 Fixed #8355: Removed some whitespace that was apparently causing difficulty with script compilation. Thanks to bear330 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 04:48:57 +00:00
Malcolm Tredinnick 93462f9516 Reverted [8318] and [8329], since the change turned out to have no effect, upon
closer examination of the C-library layer.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8380 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 14:58:59 +00:00
Russell Keith-Magee 1691c22821 Fixed #8331 -- Added style parameter to sqlite backend implementation of sql_remove_table_constraints, missed in recent db backend refactor. Thanks to d00gs for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 07:35:47 +00:00
Matt Boersma ca020a5edd Fixed oracle-specific test DB creation code so the test suite will run again.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 18:49:44 +00:00
Malcolm Tredinnick a14f41f345 Fixed #8260 -- Changed [8318] to also work with MySQLdb 1.2.1p2.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 16:28:52 +00:00
Malcolm Tredinnick bb5a35cc54 Fixed a group of missing imports, aliases and parameter passings from the
db.backend.creation refactoring.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 16:06:55 +00:00
Malcolm Tredinnick 6294fc7179 Changed "exact" matches in MySQL to use the database's native collation.
This effectively reverses the change in [7798]. It was proving too difficult to
successfully manage all the side effects here and provide a satisfactory
solution for everybody. Many thanks to arne, Martin von Löwis and, particular,
Karen Tracey, for doing a lot of research and proto-patches here to establish what was possible and practical.

This is backwards incompatible if you were relying on the behaviour after
[7798]. The docs have been updated to indicate the solution.

Refs #2170, #7789, #8102.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 07:52:33 +00:00
Malcolm Tredinnick ca71eacdf4 Convert binary-matched VARCHAR fields to unicode objects in the MySQL backend.
This conforms to Djangos' policy of returning Unicode everywhere.

Suggested by arne and Martin von Löwis. Refs #7789.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 07:52:17 +00:00
Malcolm Tredinnick 6bebb23318 Do not use savepoints with PostgreSQL prior to 8.0.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 06:31:29 +00:00
Malcolm Tredinnick 220993bcc5 Added savepoint support to the transaction code.
This is a no-op for most databases. Only necessary on PostgreSQL so that we can
do things which will possibly intentionally raise an IntegrityError and not
have to rollback the entire transaction. Not supported for PostgreSQL versions
prior to 8.0, so should be used sparingly in internal Django code.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 05:34:56 +00:00
Jacob Kaplan-Moss ab1a442a01 Fixed stupid syntax error in [8303].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 15:54:42 +00:00
Jacob Kaplan-Moss 5d837afe23 Fixed #8228: fixed a Python 2.3 compatibility from [8296].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 15:24:44 +00:00
Russell Keith-Magee 97fd752fe7 Removed some empty modules that are no longer required after [8296].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8301 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 14:16:09 +00:00
Russell Keith-Magee 9dc4ba875f Fixed #5461 -- Refactored the database backend code to use classes for the creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 12:11:25 +00:00
Jacob Kaplan-Moss 049d490875 Fixed #7921: for sqlite3 2.4.1 or later, adapt str objects to unicode, thus preveting weird failures with 8-bit bytestrings. Martin von Löwis and Karen Tracey tracked this one down -- thanks!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-09 23:59:01 +00:00
Malcolm Tredinnick 32d5c39016 Fixed #6523 -- Use the correct cast on field types for PostgreSQL when
searching within a field column (e.g. "like", "contains", etc). Required for
PostgreSQL 8.3. Thanks to Dan Watson for the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 20:09:53 +00:00
Gary Wilson Jr c85c8f8891 Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use hashlib module when available. Patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 05:56:57 +00:00
Malcolm Tredinnick b7e74e5e56 Fixed #8028 -- A couple of small docstring fixes from [8131]. Thanks, Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30 03:16:39 +00:00
Malcolm Tredinnick 464a9c8ca4 Fixed #7637 -- Added an extra parameterisation hook to the Oracle backend.
Required for some extension modules (in particular, geo-django). Patch from
Justin Bronn.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30 01:29:31 +00:00
Malcolm Tredinnick b3b71a0922 Fixed #7560 -- Moved a lot of the value conversion preparation for
loading/saving interactions with the databases into django.db.backend. This
helps external db backend writers and removes a bunch of database-specific
if-tests in django.db.models.fields.

Great work from Leo Soto.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29 05:09:29 +00:00
Matt Boersma 96d141dfda Fixed Oracle backend failure in test suite for modeltests.queries. Item.objects.all()[0:0] was optimizing out the limits clause and returning all rows.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-24 20:11:37 +00:00
Adrian Holovaty 29f0e8182f Fixed #7847 -- Removed a whole bunch of unused imports from throughout the codebase. Thanks, julien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:24:09 +00:00
Malcolm Tredinnick 436ef181f3 Fixed #5552 -- Raise an error, rather than failing silently, when DATABASE_NAME
is not specified for SQLite.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 22:36:31 +00:00
Malcolm Tredinnick c681f4070c Removed the mysql_old backend. It smells bad and has no friends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 17:38:53 +00:00
Adrian Holovaty d261c1d000 Fixed #7805 -- Removed ImageField.get_internal_type() because it doesn't offer anything beyond FileField's implementation. Thanks, Gulopine
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 04:34:47 +00:00
Malcolm Tredinnick 3b37c8151a Fixed #7411 -- worked around some possible transaction conflicts in SQLite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-15 18:47:32 +00:00
Malcolm Tredinnick 6048389391 Fixed #7532 -- Removed some dead code from the db backends. Thanks, Ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-06 14:26:37 +00:00
Ian Kelly 3b6487130a Fixed #7407 -- in Oracle, made sure table names are properly quoted when resetting sequences. Thanks, erny.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-03 19:21:54 +00:00
Ian Kelly ee837ad46a Refs #7565. Fixed Oracle sequence resetting on child models.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-03 18:42:47 +00:00
Malcolm Tredinnick 8e816c8304 Fixed #2170 -- "exact" lookups in MySQL are now case-sensitive (the same as other backends).
This is a backwards incompatible change if you were relying on 'exact' being
case-insensitive. For that, you should be using 'iexact'.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 10:25:35 +00:00
Malcolm Tredinnick f9df4d1435 Make sure we only create the minimum number of table indexes for MySQL.
This patch simplifies a bunch of code for all backends and removes some
duplicate index creation for MySQL, in particular (versions 4.x and later).
Patch from Nis Jørgensen.

Fixed #5671, #5680, #7170, #7186.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7790 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 04:46:59 +00:00
Malcolm Tredinnick b0bc8b9dfd Fixed #7565 -- Fixed a problem with PostgreSQL sequence resetting in loaddata.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 00:38:14 +00:00
Ian Kelly c237ef625c Fixed a "column" instance that wis massed in [7743].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7772 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 17:44:54 +00:00
Adrian Holovaty 2b926d4222 Fixed #7319 -- Removed unused DatabaseFeatures attribute 'needs_upper_for_iops'. Thanks, leosoto
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7747 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:05:48 +00:00
Malcolm Tredinnick 915001ad0b Fixed #7109 -- Quote certain values before passing them for substitution in
Field.db_type().

This fixes a problem with using reserved words for field names in Oracle. Only
affects Oracle at the moment, but the same changes could easily be used by
other backends if they are required (requires changing creation.py, only).

This commit also reverts [7501] so that if the fix doesn't work, it will show
up in the tests (and if it does work, the tests will prevent us from breaking
it again).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7743 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 03:11:32 +00:00
Adrian Holovaty 06315375ce Fixed #7420 -- Abstracted some more database options into DatabaseFeatures -- supports_usecs, time_field_needs_date, interprets_empty_strings_as_nulls and date_field_supports_time_value -- and changed various hard-coded 'if DATABASE_BACKEND == oracle' statements to use the new options. Thanks to ramiro for the patch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-16 03:15:04 +00:00
Adrian Holovaty ac5b9f5857 Fixed #7427 -- Fixed docstring that was rendered incorrect due to qs-rf. Thanks, ramiro
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7624 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-12 04:23:14 +00:00
Ian Kelly 3c4d353016 Cleaned up some comments in the Oracle backend. Fixes #7139. Thanks, adamv.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-05 16:04:50 +00:00
Malcolm Tredinnick ba010ec1c0 Made some types of nested update queries very slightly more efficient at the
database level. Also worked around the fact that MySQL (and maybe other
backends we don't know about) cannot select from the table they're updating.

Fixed #7095.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7496 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 11:51:52 +00:00
Malcolm Tredinnick 9c52d56f6f Merged the queryset-refactor branch into trunk.
This is a big internal change, but mostly backwards compatible with existing
code. Also adds a couple of new features.

Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-27 02:50:16 +00:00
Malcolm Tredinnick 35afdedbed Fixed #6433 -- Handle some varied PostgreSQL version strings (beta versions and
Windows version strings). Patch from jerickso.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-13 02:04:10 +00:00
Ian Kelly 15a39f7fe5 Fixed #5985: Changed the lookups in the Oracle backend to use LIKEC instead of LIKE.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7412 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-10 17:44:40 +00:00
Malcolm Tredinnick c30a050e41 Removed the ado_mssql database backend.
It has not been maintained, contains bugs, and improved versions are available
externally(e.g. django-mssql and django-pyodbc at Google code).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-26 08:25:48 +00:00
Malcolm Tredinnick 89e7b673d8 Fixed #5531 -- Changes a while back meant we are handling import errors from
database backends differently now. Which meant the MySQLdb version check was
being swallowed. Changed the exception type to ensure this is percolated
correctly. Patch from Ramiro Morales.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-24 14:02:44 +00:00
Malcolm Tredinnick 732074541a Fixed #5883 -- Added __iter__ methods to the debug cursor and the postgresql backend cursor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 14:15:15 +00:00
Jacob Kaplan-Moss a9b4efc82b Re-enable substring lookups for IP address fields in Postgres using HOST() Thanks for the suggestion, Thomas Adamcik. Fixes #708.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 23:12:47 +00:00
Jacob Kaplan-Moss f7fbc289ad Reverted [7151] since it breaks exact IP lookups on PostgreSQL. Reopens #708
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 22:17:45 +00:00
Malcolm Tredinnick 6482f1f887 Fixed #708 -- Fixed searching within IP fields on PostgreSQL.
Based on a patch from Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23 09:15:35 +00:00
Malcolm Tredinnick f1a24be01c Fixed #6481 -- Fixed a bunch of import problems (and some whitespace cleanups).
Found by Bastian Kleineidam with help from pyflakes. Thanks.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-19 00:08:08 +00:00
Ian Kelly 6929c0d4d1 Fixed #6254: Made fetchone() in the oracle backend correctly convert
strings to unicode objects.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-04 22:51:22 +00:00
Matt Boersma c5d3a925c7 Set Oracle stmtcachesize to 20 instead of 0 for a performance boost.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-21 18:49:07 +00:00
Matt Boersma 72d279a29f Rearranged an Oracle ALTER statement so it is run only once per new connection, not on every cursor creation. Thanks, Ian Kelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-20 23:06:30 +00:00
Ian Kelly ed5eca598e Fixed ORA-01461 error when trying to store more than 4000 bytes in a TextField under Oracle
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6905 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-11 02:22:40 +00:00
Malcolm Tredinnick 348f2cbfc1 Fixed #5996 -- Add a pyscopg2 convertor for SafeUnicode -> unicode. Thanks, remco@diji.biz
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01 22:26:24 +00:00
Ian Kelly c750f01b48 Fixed a PL/SQL syntax bug causing manage.py sqlall to fail when piped to
sqlplus, introduced in [5950].


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01 18:50:43 +00:00
Malcolm Tredinnick 595e75e8dd Fixed #5729 -- For MySQL (only), always delay the creation of foreign key
references, for all tables, until after the table has been created. This means
that when using the InnoDB storage engine, true foreign key constraints are
created (inline "REFERENCES" are ignored by InnoDB, unfortunately).

Fully backwards compatible.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04 05:05:24 +00:00
Adrian Holovaty c599de2ac6 Added a BaseDatabaseOperations.last_executed_query() hook, which allows a database backend to specify how to get the last-executed query on a given cursor. Implemented it for the psycopg2 backend. This means that for psycopg2, the SQL statements in django.db.connection.queries will now reflect the exact SQL as sent to the server, instead of a naive and misleading string-interpolated version
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-23 19:00:31 +00:00
Gary Wilson Jr 73f495158c Fixed #5710 -- Fixed a missing table name quoting in the postgresql backend, thanks davep@atomicdroplet.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 05:53:56 +00:00
Jacob Kaplan-Moss 980fa8b827 Fixed #231: all fields that should take max_length now do. Thanks, Don Spaulding.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 23:33:57 +00:00
Ian Kelly 8c5214d9b4 Made Oracle backend cast CharField values of None to u'' instead of ''
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 23:23:55 +00:00
Jacob Kaplan-Moss 4c0ac53ff8 Fixed a missing import in mysql backend. Thanks for pointing it out, mattmcc.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 23:02:39 +00:00
Ian Kelly 17cd87a264 Fixed an Oracle sqlflush / sequence reset column name bug exposed by the new test case in [6195].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 22:07:54 +00:00
Adrian Holovaty dfdbf9ec1e Fixed #5161 -- Changed MySQL backend only to report warning once. Thanks, durdinator
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6229 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 22:05:58 +00:00
Ian Kelly f180d95903 Fixed #4896: fixed #4765: Patch for cursor.executemany using oracle and
sqlite3. Thanks, jdetaeye@www.frepple.com


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 21:32:25 +00:00
Matt Boersma a6b1d65e33 Fixed #5226. Now we check the Oracle version and give an explicit
error when we encounter a regex operator that isn't supported on 9i or 
earlier.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 18:26:07 +00:00
Ian Kelly 93f60163e8 Fixed #5218: Made Oracle create autoinc triggers using the correct name
of the AutoField column rather than always assume "ID".


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 18:12:36 +00:00
Adrian Holovaty f36e96cc9c Added django/db/backends/creation.py, with BaseCreation. Refs #5461
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 16:44:53 +00:00
Malcolm Tredinnick 134bf3a26b Backed out [6165]. It breaks things for people using psycopg2 because it requires psycopg to also be installed due to imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 06:21:25 +00:00
Gary Wilson Jr 30b24a6cce Refs #4299 -- Removed some code duplication in the postgresql introspection modules by letting the `postgresql_psycopg2` backend use identical functions from the `postgresql` backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6165 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 05:33:39 +00:00
Adrian Holovaty 41576fea71 Fixed #5263 -- Updated docstring for sqlite3 backend. Thanks, Paul Bx
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6035 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-02 20:04:44 +00:00
Adrian Holovaty 8b8a36c7d0 Changed postgresql and postgresql_psycopg2 backends NOT to do a SELECT version() for every connection, which was ludicrous. Now the version is only retrieved if it needs to be, via a lazy loader.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25 19:24:47 +00:00