Commit Graph

393 Commits

Author SHA1 Message Date
Jacob Kaplan-Moss 8f0f73c7b8 Fixed #2705: added a `select_for_update()` clause to querysets.
A number of people worked on this patch over the years -- Hawkeye, Colin Grady,
KBS, sakyamuni, anih, jdemoor, and Issak Kelly. Thanks to them all, and
apologies if I missed anyone.

Special thanks to Dan Fairs for picking it up again at the end and seeing this
through to commit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-20 20:42:07 +00:00
Ian Kelly b4c83138e9 Fixed #15534: Made the Oracle runtime test for regex capabilities use the !DatabaseOperations connection instead of grabbing the default connection.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-18 21:59:20 +00:00
Ian Kelly d3c08fd813 Fixed #15573: Forced the default site id to be 1 when creating test databases, to prevent a large number of errors when running the tests using the oracle backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-15 21:49:22 +00:00
Ramiro Morales 30b3d51599 Fixed #13630 -- Made __init__ methods of all DB backends' DatabaseOperations classes take a `connection` argument. Thanks calexium for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-05 00:19:17 +00:00
Russell Keith-Magee 8911754555 Deprecated the psycopg-based postgresql database backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:39:08 +00:00
Russell Keith-Magee f9972bcf86 Removed deprecated DB backend functions for creating m2m tables.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15979 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:38:25 +00:00
Adrian Holovaty 579eb97961 Simplified sqlite backend ImproperlyConfigured check now that we don't support Python 2.4
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:27:05 +00:00
Adrian Holovaty 13864703bc Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-28 02:11:19 +00:00
Ian Kelly 23103bddb9 Fixed another case-sensitivity bug in Oracle introspection. This one was harmless, but it was causing an irritating test failure.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-09 22:45:20 +00:00
Ian Kelly 5a79b55239 Fixed a case-sensitivity bug in Oracle introspection that was preventing inspectdb from identifying foreign keys.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-09 19:40:44 +00:00
Ian Kelly d9e61a435a Added a skip for a test that fails in Oracle. Unlike other backends, Oracle does not allow duplicate rows where there is a unique_together constraint for which some but not all of the columns are NULL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-08 22:41:25 +00:00
Russell Keith-Magee 670f4d9628 Fixed #15327 -- Modified the Oracle test database signature method to allow for the case where TEST_USER is unspecified. Thanks to depaolim for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15568 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-19 07:41:17 +00:00
Russell Keith-Magee 756f1c218d Fixed #15293 -- Updated the dummy backend to support the APIs introduced by r15493. Thanks to mp for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15528 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 00:07:09 +00:00
Russell Keith-Magee 7e46b17000 Fixed #15297 -- Corrected an attribute naming regressoin from fixing #9964. Thanks to leonov for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15527 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 00:06:52 +00:00
Russell Keith-Magee c40a1d1835 Removed more redundant code from the debug cursor wrapper. Thanks to Ramiro for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 23:50:39 +00:00
Russell Keith-Magee e3a2fef7cc Fixed #15289 -- Removed a redundant __getattr__ implementation from the debug SQL cursor wrapper. Thanks to Apollo13 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 23:38:50 +00:00
Russell Keith-Magee 6314a1b42e Fixed #9964 -- Ensure that all database operations make transactions dirty, not just write operations. Many thanks to Shai Berger for his work and persistence on this issue.
This is BACKWARDS INCOMPATIBLE for anyone relying on the current behavior that allows manually managed read-only transactions to be left dangling without a manual commit or rollback.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 13:03:34 +00:00
Russell Keith-Magee d1cd53d9cf Changeset r15232 refactored transactions so that all transaction state is maintained on the connection. This changeset continues that work, moving all transaction control to the connection, too. The transaction control functions in django.db.transaction are left as a generic way to easily apply a transaction control function based on a DB alias. Refs #9964.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-12 13:02:42 +00:00
Alex Gaynor 5718a678e5 Fixed #15230 -- added some more attributes to the dummy database backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-06 18:46:40 +00:00
Ramiro Morales dc5f2607de Fixed #15029 -- Moved to database backends the ability to decide if two DATABASES items are different when creating temporary databases for tests.
hG: Enter commit message.  Lines beginning with 'HG:' are removed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-02 14:02:14 +00:00
Russell Keith-Magee 74d485c4ec Fixed #15170 -- Skip the inspectdb test under MySQL/MyISAM, because it can't differentiate a foreign key from an integer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-01 14:42:52 +00:00
Alex Gaynor 7c0e40534b Fixed #15173 -- fixed the tests when run under pypy.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-27 00:00:32 +00:00
Ian Kelly 91c61c0baa Fixed #14149: Initialize the Oracle connection.operators at connection time since some systems don't seem to like the "TRANSLATE" trick.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-24 21:34:18 +00:00
Russell Keith-Magee b31a1b9926 Refs #14661 -- Clarified the handling of initial data injected via custom SQL.
This is BACKWARDS INCOMPATIBLE CHANGE for anyone relying on SQL-injected initial data in a test case.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-18 16:43:01 +00:00
Alex Gaynor fcbf881d82 Refactor all uses of thread locals to be more consistant and sane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-17 09:52:47 +00:00
Alex Gaynor f544d98896 2 small optimizations: a) move an import out of a function, b) remove a cache that did nothing, tiny tiny speed up on CPython, but a big one on PyPy
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-12 13:39:31 +00:00
Russell Keith-Magee dc25fa776a Fixed #15006 -- Removed some stray tabs in python code. Thanks to vanschelven for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15134 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-03 13:19:59 +00:00
Karen Tracey b1f6a4d66f Fixed #10154: Allow combining F expressions with timedelta values.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-22 03:34:04 +00:00
Luke Plant 363177ea32 Small performance tweak - avoid loading django.core.management in DB backend code
django.core.management (and dependencies) will usually not be needed in a web context.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 21:32:59 +00:00
Russell Keith-Magee 673e6fc7fb Fixed #11675 -- Added support for the PyLibMC cache library. In order to support this, and clean up some other 1.3 caching additions, this patch also includes some changes to the way caches are defined. This means you can now have multiple caches, in the same way you have multiple databases. A huge thanks to Jacob Burch for the work on the PyLibMC backend, and to Jannis for his work on the cache definition changes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 15:19:19 +00:00
Ramiro Morales c2657d8923 Fixed #14921 -- Tweak changes made in r14861 for the Oracle backend so the test runner can actually create the test DB. Thanks Karen for the report.
In Oracle, the name of a DB as handled by Django hasn't a counterpart anyway. So use the 'production DB name' as it was done before.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 01:36:09 +00:00
Ramiro Morales e0d8c5fca2 Fixed error introduced in r14666 that results in the message reporting the test DB name to be created being shown actually after the real action when the operation fails.
Implemented that by factoring out calculation of test DB name to an internal method.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-08 23:48:28 +00:00
Ian Kelly b8c368feb2 Replaced an ImportError with ImproperlyConfigured in the Oracle backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-08 07:56:43 +00:00
Ian Kelly 5475da1c32 Added a regression test for r14781. Also fixed a bug where connection.vendor was effectively always 'unknown', causing all vendor-specific tests to be skipped.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-03 18:15:54 +00:00
Ian Kelly cbf9d6e0bb Fixed the Oracle environment variables not getting set correctly under Cygwin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14781 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-03 00:54:39 +00:00
Ian Kelly 1f68dc4ad4 Fixed #11706: Added an Oracle connection option to disable the use of RETURNING INTO in INSERT statements.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-01 23:36:56 +00:00
Ramiro Morales 752bd8bf75 Added printing of the name of test database being created/destroyed, at verbosity level 2. Refs #14415.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 17:18:26 +00:00
Ramiro Morales 6774207394 Fixed #14453 -- Changed handling of microseconds part in typecast_timestamp() DB backend helper function to be more correct. Thanks philipn for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14664 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 15:08:53 +00:00
Alex Gaynor 49d831380f Corrected the way databases were compared. This allows running the test suite with two in memory SQLite databases.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-19 08:08:08 +00:00
Ian Kelly 87a8046f90 Made the oracle backend throw the same ValueError as the mysql backend when a timezone-aware datetime is passed in. This fixes a datatypes test failure.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14544 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-12 18:39:30 +00:00
Ian Kelly e0e347c2d3 Fixed a misapplied test skip feature in the oracle backend from r14139.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14543 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-12 17:51:31 +00:00
Ian Kelly ee6bec6c09 Fixed #11101: Rewrote the sequence reset SQL for Oracle to prevent it from performing an implicit commit that caused all fixtures to be automatically committed, causing a large number of test failures.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14537 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-12 01:44:22 +00:00
Ramiro Morales cae746e037 Fixed error introduced in r14512.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11 05:17:31 +00:00
Ramiro Morales 4fb1825e75 Fixed small multi-db compatibility issue in the Oracle backend.
Also, converted a couple of constructs to a more Python idiomatic form.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14512 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11 05:07:32 +00:00
Ramiro Morales f91b41fe33 Implemented changes made in r14320 in the Oracle backend. Thanks Russell for reviewing the proposed fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11 04:36:20 +00:00
Carl Meyer 616b30227d Fixed #7539, #13067 -- Added on_delete argument to ForeignKey to control cascade behavior. Also refactored deletion for efficiency and code clarity. Many thanks to Johannes Dollinger and Michael Glassford for extensive work on the patch, and to Alex Gaynor, Russell Keith-Magee, and Jacob Kaplan-Moss for review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14507 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-09 16:46:42 +00:00
Ramiro Morales 9c619ac48b Fixed some Oracle backend test DB creation code bugs.
Made saving of modified settings compatible with multi-db, removed dead and superfluous code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-07 20:58:46 +00:00
Ramiro Morales 59d5537a6c Fixed #14630 -- Increased maximum size of the Oracle tablespace datafile used for tests from 100MB to 200MB.
This allows the execution of the full Django test suite without running out of allocated space.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14468 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-06 04:30:17 +00:00
Alex Gaynor ed51dd5d64 Avoid an O(n**2) operation where O(n) will suffice. Possibly worth a second or two when running the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14433 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-02 05:41:46 +00:00
Alex Gaynor fa8f0cb2d8 When looking for django tables which exist, query for all tables once, not once *per table*.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-31 00:53:58 +00:00