Commit Graph

10240 Commits

Author SHA1 Message Date
Sławek Ehlert 3db84b174a - cx_Oracle.makedsn can now be passed service_name; squash
commit of pr152
2014-04-02 13:45:53 -04:00
Mike Bayer a14729266a - make even more tables 2015-02-07 10:22:08 -05:00
Mike Bayer 68900c2654 - break up the tables here to avoid the error we're getting
on jenkins
2015-02-06 23:41:01 -05:00
Mike Bayer 66f2e1257a - back off the callcounts a bit for the boolean fix
- rewrite callcounts for select()
2014-04-01 18:29:54 -04:00
Mike Bayer 2e5c8913a8 - Fixes to the newly enhanced boolean coercion in 🎫2804 where
the new rules for "where" and "having" woudn't take effect for the
"whereclause" and "having" kw arguments of the :func:`.select` construct,
which is also what :class:`.Query` uses so wasn't working in the
ORM either. fixes #3013 re: #2804
2014-04-01 13:03:52 -04:00
Mike Bayer e16ede8cae - Added new flag :paramref:.expression.between.symmetric, when set to True
renders "BETWEEN SYMMETRIC".  Also added a new negation operator
"notbetween_op", which now allows an expression like ``~col.between(x, y)``
to render as "col NOT BETWEEN x AND y", rather than a parentheiszed NOT
string.  fixes #2990
2014-03-30 21:20:20 -04:00
Mike Bayer efd3c311e0 update 2014-03-30 21:09:33 -04:00
Mike Bayer f258c224d7 - fix mapper ref
- don't talk about "can't check for rows matched" here as we changed that in 0.9
2014-03-28 19:59:54 -04:00
Mike Bayer ccc0c44c3a 0.9.4 rel_0_9_4 2014-03-28 19:40:09 -04:00
Mike Bayer 6983e14790 dont need rowcount here... 2014-03-28 19:19:55 -04:00
Mike Bayer d6618e4119 - Added new parameter :paramref:.mapper.confirm_deleted_rows. Defaults
to True, indicates that a series of DELETE statements should confirm
that the cursor rowcount matches the number of primary keys that should
have matched;  this behavior had been taken off in most cases
(except when version_id is used) to support the unusual edge case of
self-referential ON DELETE CASCADE; to accomodate this, the message
is now just a warning, not an exception, and the flag can be used
to indicate a mapping that expects self-refererntial cascaded
deletes of this nature.  See also 🎫`2403` for background on the
original change. re: #2403 fix #3007
2014-03-28 18:00:35 -04:00
Mike Bayer a0329f71ad - revert part of c01558ae7f for now as we also test that a DELETE of two rows
where one is to be deleted from ON DELETE CASCADE succeeds; the check here makes that fail.
We will need to add an option to enable/disable this check per mapping, will likely
do this in next version
2014-03-28 17:42:55 -04:00
Mike Bayer 477b9e7f02 mark failing tests for buggy mysqlconnector 2014-03-28 17:26:45 -04:00
Mike Bayer 9a49d5fea5 revert inadvertent pdb 2014-03-28 16:48:20 -04:00
Mike Bayer 094a8550f1 - the rewording of orderinglist docs got committed by accident, finish it up 2014-03-28 16:47:12 -04:00
Mike Bayer 9c731b2ebf - add further coverage for join_condition to make sure we get this case where
there are multiple, equivalent foreign keys
2014-03-28 16:41:08 -04:00
Mike Bayer a04fb82028 pickle of execption not supported on mysqlconnector 2014-03-28 16:37:43 -04:00
Mike Bayer 28aaa59387 - fix set syntax supposed to be dict 2014-03-28 16:36:11 -04:00
Mike Bayer c01558ae7f - Fixed ORM bug where changing the primary key of an object, then marking
it for DELETE would fail to target the correct row for DELETE.
Then to compound matters, basic "number of rows matched" checks were
not being performed.  Both issues are fixed, however note that the
"rows matched" check requires so-called "sane multi-row count"
functionality; the DBAPI's executemany() method must count up the
rows matched by individual statements and SQLAlchemy's dialect must
mark this feature as supported, currently applies to some mysql dialects,
psycopg2, sqlite only. fixes #3006
- Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as
this seems to be supported as of psycopg2 2.0.9.
2014-03-28 16:32:11 -04:00
Mike Bayer 9cdbed37f8 clarify doc here 2014-03-28 11:05:46 -04:00
Mike Bayer 610e0594e2 - fix py3k bug re: dictionary values(), fixes #3005 2014-03-28 11:02:34 -04:00
Mike Bayer 4d93a52e77 - Added support to automap for the case where a relationship should
not be created between two classes that are in a joined inheritance
relationship, for those foreign keys that link the subclass back to
the superclass.
fixes #3004
2014-03-28 10:49:37 -04:00
Mike Bayer 825d3b0d6d - Fixed a very old behavior where the lazy load emitted for a one-to-many
could inappropriately pull in the parent table, and also return results
inconsistent based on what's in the parent table, when the primaryjoin
includes some kind of discriminator against the parent table, such
as ``and_(parent.id == child.parent_id, parent.deleted == False)``.
While this primaryjoin doesn't make that much sense for a one-to-many,
it is slightly more common when applied to the many-to-one side, and
the one-to-many comes as a result of a backref.
Loading rows from ``child`` in this case would keep ``parent.deleted == False``
as is within the query, thereby yanking it into the FROM clause
and doing a cartesian product.  The new behavior will now substitute
the value of the local "parent.deleted" for that parameter as is
appropriate.   Though typically, a real-world app probably wants to use a
different primaryjoin for the o2m side in any case.
fixes #2948
2014-03-27 20:38:46 -04:00
Mike Bayer 0611baa889 - Improved the check for "how to join from A to B" such that when
a table has multiple, composite foreign keys targeting a parent table,
the :paramref:`.relationship.foreign_keys` argument will be properly
interpreted in order to resolve the ambiguity; previously this condition
would raise that there were multiple FK paths when in fact the
foreign_keys argument should be establishing which one is expected.
fixes #2965
2014-03-27 19:43:15 -04:00
Mike Bayer 50576a01eb - Tweaked the settings for mysql-connector-python; in Py2K, the
"supports unicode statements" flag is now False, so that SQLAlchemy
will encode the *SQL string* (note: *not* the parameters)
to bytes before sending to the database.  This seems to allow
all unicode-related tests to pass for mysql-connector, including those
that use non-ascii table/column names, as well as some tests for the
TEXT type using unicode under cursor.executemany().
- other mysql-connector fixes; latest version seems to do better on
function call counts
2014-03-27 19:18:06 -04:00
Stefan Reich 460139f630 Added missing text_type requirement to TextTest
Conflicts:
	lib/sqlalchemy/testing/suite/test_types.py
2014-03-27 18:28:28 -04:00
Mike Bayer e3a1a2d01c - fixes to multi-backend tests
- move the logic to determine "test id" into plugin_base
- update callcounts
2014-03-27 13:17:20 -04:00
Mike Bayer b6411ee3cf fixes to get profiling tests working again 2014-03-26 20:43:20 -04:00
Mike Bayer bd86942b05 dont warn, that just crashes the test... 2014-03-26 19:15:49 -04:00
Mike Bayer 99d07abe17 try to liberalize the pool._refs assertion a bit 2014-03-26 16:52:04 -04:00
Mike Bayer a465f3d031 use integer division here 2014-03-26 16:39:43 -04:00
Mike Bayer 761c8ff15d - work on fixing some race-condition failures:
1. make sure pool._invalidate() sets the timestamp up before
invalidating the target connection.  we can otherwise show how the
conn.invalidate() + pool._invalidate() can lead to an extra connection
being made.
2. to help with that, soften up the check on connection.invalidate()
when connection is already closed. a warning is fine here
3. add a mutex to test_max_overflow() when we connect, because the way
we're using mock depends on an iterator, that needs to be synchronized
2014-03-26 16:31:52 -04:00
Mike Bayer dc0d581d5d - rework memusage tests so that it only runs five iterations at a time, if it sees success within
that period, it's done.  memusage tests have become very slow
2014-03-26 15:18:29 -04:00
Mike Bayer 4100f9c06e - remove nose dependency 2014-03-26 14:42:51 -04:00
Mike Bayer 1a35188b69 - Fixed regression caused by release 0.8.5 / 0.9.3's compatibility
enhancements where index reflection on Postgresql versions specific
to only the 8.1, 8.2 series again
broke, surrounding the ever problematic int2vector type.  While
int2vector supports array operations as of 8.1, apparently it only
supports CAST to a varchar as of 8.3.
fix #3000
2014-03-25 12:26:42 -04:00
Mike Bayer 74f7509d66 add some more mock structure so tricky DBAPIs like pypy work 2014-03-24 19:30:44 -04:00
Mike Bayer 12c8a10b81 fix 2014-03-24 13:33:53 -04:00
Mike Bayer 50d19f55d2 - add some more rules to make sure all tests run if DBs are available 2014-03-24 12:49:22 -04:00
Mike Bayer 990266f551 fix some mysqlconnector failures 2014-03-24 12:12:26 -04:00
Mike Bayer 82a67abf4b - fix the uuid routine here to not run out of uuids 2014-03-24 11:57:38 -04:00
Mike Bayer 7e6a5e7946 - fix some doctest failures (though some remain, as it's not easy to get doctest
to accept things flexibly), fix #2999
2014-03-24 11:48:18 -04:00
Mike Bayer 2f150bee28 - rename __multiple__ to __backend__, and apply __backend__ to a large number of tests.
- move out logging tests from test_execute to test_logging
2014-03-24 11:33:53 -04:00
Mike Bayer 87d7076b49 - Added some new event mechanics for dialect-level events; the initial
implementation allows an event handler to redefine the specific mechanics
by which an arbitrary dialect invokes execute() or executemany() on a
DBAPI cursor.  The new events, at this point semi-public and experimental,
are in support of some upcoming transaction-related extensions.
2014-03-24 10:22:39 -04:00
Mike Bayer ebd24974f4 take out accidental PG dialect use here 2014-03-24 10:09:07 -04:00
Mike Bayer ae7e0a2721 some profile updates... 2014-03-23 21:39:17 -04:00
Mike Bayer 39a8e2ed37 - Fixed regression from 0.8.3 as a result of 🎫2818
where :meth:`.Query.exists` wouldn't work on a query that only
had a :meth:`.Query.select_from` entry but no other entities.
re: #2818 fixes #2995
2014-03-22 19:55:00 -04:00
Mike Bayer b00e15b50f - An event listener can now be associated with a :class:.Engine,
after one or more :class:`.Connection` objects have been created
(such as by an orm :class:`.Session` or via explicit connect)
and the listener will pick up events from those connections.
Previously, performance concerns pushed the event transfer from
:class:`.Engine` to  :class:`.Connection` at init-time only, but
we've inlined a bunch of conditional checks to make this possible
without any additional function calls. fixes #2978
2014-03-22 19:34:18 -04:00
Mike Bayer a7a6b43660 there's no "assert_call_count" on mock 2014-03-22 19:10:00 -04:00
Mike Bayer 8e10ab92df - restore the old behavior of the connection pool replacing itself just
within userland engine.dispose(); as some SQLA tests already failed when the replace step
was removed, due to those conns still being referenced, it's likely this will
create surprises for all those users that incorrectly use dispose()
and it's not really worth dealing with.  This doesn't affect the change
we made for ref: #2985.
2014-03-22 19:02:37 -04:00
Mike Bayer 5d2bfc4df4 - Fixed a few errant `u''` strings that would prevent tests from passing
in Py3.2.  Patch courtesy Arfrever Frehtes Taifersar Arahesis. fixes #2980
2014-03-22 18:48:59 -04:00