summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-2632-47/+47
| | | | Found using: https://github.com/intgr/topy
* - The "primaryjoin" model has been stretched a bit further to allowMike Bayer2014-04-192-2/+199
| | | | | | | | | | a join condition that is strictly from a single column to itself, translated through some kind of SQL function or expression. This is kind of experimental, but the first proof of concept is a "materialized path" join condition where a path string is compared to itself using "like". The :meth:`.Operators.like` operator has also been added to the list of valid operators to use in a primaryjoin condition. fixes #3029
* - Liberalized the contract for :class:`.Index` a bit in that you canMike Bayer2014-04-192-12/+102
| | | | | | | specify a :func:`.text` expression as the target; the index no longer needs to have a table-bound column present if the index is to be manually added to the table, either via inline declaration or via :meth:`.Table.append_constraint`. fixes #3028
* - Fixed bug in new :meth:`.DialectKWArgs.argument_for` method whereMike Bayer2014-04-151-0/+11
| | | | | adding an argument for a construct not previously included for any special arguments would fail. fixes #3024
* remove unused importMatt Chisholm2014-04-141-1/+0
|
* fix unclosed file ResourceWarningMatt Chisholm2014-04-141-1/+2
| | | | part of #2830
* - Fixed regression introduced in 0.9 where new "ORDER BY <labelname>"Mike Bayer2014-04-101-0/+9
| | | | | | feature from :ticket:`1068` would not apply quoting rules to the label name as rendered in the ORDER BY. fix #3020, re: #1068
* - Added new utility function :func:`.make_transient_to_detached` which canMike Bayer2014-04-091-1/+46
| | | | | | | be used to manufacture objects that behave as though they were loaded from a session, then detached. Attributes that aren't present are marked as expired, and the object can be added to a Session where it will act like a persistent one. fix #3017
* - reverse order of columns in sample CTEs as this is a UNION and the cols ↵Mike Bayer2014-04-021-5/+5
| | | | | | | | | | need to line up - alter this in the unit tests as well as these queries were just copied from the tests - remove the included_parts.join(parts) from the core CTE doc (also just copied from the test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't contribute to the query itself fixes #3014
* - back off the callcounts a bit for the boolean fixMike Bayer2014-04-011-17/+19
| | | | - rewrite callcounts for select()
* - Fixes to the newly enhanced boolean coercion in :ticket:`2804` whereMike Bayer2014-04-012-4/+82
| | | | | | | 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
* - Added new flag :paramref:`.expression.between.symmetric`, when set to TrueMike Bayer2014-03-301-3/+43
| | | | | | | 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
* dont need rowcount here...Mike Bayer2014-03-281-1/+0
|
* - Added new parameter :paramref:`.mapper.confirm_deleted_rows`. DefaultsMike Bayer2014-03-282-12/+25
| | | | | | | | | | | | 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 :ticket:`2403` for background on the original change. re: #2403 fix #3007
* - revert part of c01558ae7f4a for now as we also test that a DELETE of two rowsMike Bayer2014-03-282-7/+11
| | | | | | 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
* mark failing tests for buggy mysqlconnectorMike Bayer2014-03-281-0/+21
|
* - add further coverage for join_condition to make sure we get this case whereMike Bayer2014-03-281-0/+10
| | | | there are multiple, equivalent foreign keys
* pickle of execption not supported on mysqlconnectorMike Bayer2014-03-281-0/+2
|
* - Fixed ORM bug where changing the primary key of an object, then markingMike Bayer2014-03-283-23/+110
| | | | | | | | | | | | | 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.
* - Added support to automap for the case where a relationship shouldMike Bayer2014-03-281-0/+7
| | | | | | | 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
* - Fixed a very old behavior where the lazy load emitted for a one-to-manyMike Bayer2014-03-272-3/+161
| | | | | | | | | | | | | | | | | 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
* - Improved the check for "how to join from A to B" such that whenMike Bayer2014-03-271-0/+37
| | | | | | | | | 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
* - Tweaked the settings for mysql-connector-python; in Py2K, theMike Bayer2014-03-272-12/+14
| | | | | | | | | | | "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
* - fixes to multi-backend testsMike Bayer2014-03-271-2/+115
| | | | | - move the logic to determine "test id" into plugin_base - update callcounts
* fixes to get profiling tests working againMike Bayer2014-03-261-4/+0
|
* use integer division hereMike Bayer2014-03-261-1/+1
|
* - work on fixing some race-condition failures:Mike Bayer2014-03-261-4/+5
| | | | | | | | | | | 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
* - rework memusage tests so that it only runs five iterations at a time, if ↵Mike Bayer2014-03-261-29/+47
| | | | | | it sees success within that period, it's done. memusage tests have become very slow
* - Fixed regression caused by release 0.8.5 / 0.9.3's compatibilityMike Bayer2014-03-251-1/+1
| | | | | | | | | 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
* add some more mock structure so tricky DBAPIs like pypy workMike Bayer2014-03-241-0/+8
|
* - add some more rules to make sure all tests run if DBs are availableMike Bayer2014-03-244-6/+8
|
* fix some mysqlconnector failuresMike Bayer2014-03-241-4/+10
|
* - fix the uuid routine here to not run out of uuidsMike Bayer2014-03-243-24/+7
|
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-2423-237/+399
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - Added some new event mechanics for dialect-level events; the initialMike Bayer2014-03-241-1/+110
| | | | | | | 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.
* take out accidental PG dialect use hereMike Bayer2014-03-241-1/+1
|
* some profile updates...Mike Bayer2014-03-231-16/+61
|
* - Fixed regression from 0.8.3 as a result of :ticket:`2818`Mike Bayer2014-03-221-0/+11
| | | | | | 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
* - An event listener can now be associated with a :class:`.Engine`,Mike Bayer2014-03-221-0/+33
| | | | | | | | | | 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
* there's no "assert_call_count" on mockMike Bayer2014-03-221-9/+10
|
* - restore the old behavior of the connection pool replacing itself justMike Bayer2014-03-221-0/+12
| | | | | | | | 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.
* - Fixed a few errant ``u''`` strings that would prevent tests from passingMike Bayer2014-03-224-11/+11
| | | | in Py3.2. Patch courtesy Arfrever Frehtes Taifersar Arahesis. fixes #2980
* - A major improvement made to the mechanics by which the :class:`.Engine`Mike Bayer2014-03-222-16/+101
| | | | | | | | | | | | recycles the connection pool when a "disconnect" condition is detected; instead of discarding the pool and explicitly closing out connections, the pool is retained and a "generational" timestamp is updated to reflect the current time, thereby causing all existing connections to be recycled when they are next checked out. This greatly simplifies the recycle process, removes the need for "waking up" connect attempts waiting on the old pool and eliminates the race condition that many immediately-discarded "pool" objects could be created during the recycle operation. fixes #2985
* - Added new datatype :class:`.oracle.DATE`, which is a subclass ofMike Bayer2014-03-222-12/+17
| | | | | | | | | | | | :class:`.DateTime`. As Oracle has no "datetime" type per se, it instead has only ``DATE``, it is appropriate here that the ``DATE`` type as present in the Oracle dialect be an instance of :class:`.DateTime`. This issue doesn't change anything as far as the behavior of the type, as data conversion is handled by the DBAPI in any case, however the improved subclass layout will help the use cases of inspecting types for cross-database compatibility. Also removed uppercase ``DATETIME`` from the Oracle dialect as this type isn't functional in that context. fixes #2987
* Merge branch 'fix_table_registration' of https://github.com/malor/sqlalchemy ↵Mike Bayer2014-03-221-0/+1
|\ | | | | | | into t
| * Remove tables from metadata when autoload failspr/78Roman Podoliaka2014-03-121-0/+1
| | | | | | | | | | | | | | | | If autoloading of a table fails, don't register it in a metadata instance. It seems that the original behaviour was accidentally changed in f6198d9abf453182f4b111e0579a7a4ef1614e79, restore it. Closes issue #2988
* | - The :meth:`.ConnectionEvents.after_cursor_execute` event is nowMike Bayer2014-03-191-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | emitted for the "_cursor_execute()" method of :class:`.Connection`; this is the "quick" executor that is used for things like when a sequence is executed ahead of an INSERT statement, as well as for dialect startup checks like unicode returns, charset, etc. the :meth:`.ConnectionEvents.before_cursor_execute` event was already invoked here. The "executemany" flag is now always set to False here, as this event always corresponds to a single execution. Previously the flag could be True if we were acting on behalf of an executemany INSERT statement.
* | fix assertionMike Bayer2014-03-191-1/+1
| |
* | - Fixed bug in mutable extension as well asMike Bayer2014-03-192-0/+26
| | | | | | | | | | | | :func:`.attributes.flag_modified` where the change event would not be propagated if the attribute had been reassigned to itself. fixes #2997
* | - Improved an error message which would occur if a query() were madeMike Bayer2014-03-171-0/+13
| | | | | | | | | | | | | | against a non-selectable, such as a :func:`.literal_column`, and then an attempt was made to use :meth:`.Query.join` such that the "left" side would be determined as ``None`` and then fail. This condition is now detected explicitly.