summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Refactor for cx_Oracle version 6oracle_numericMike Bayer2017-09-1112-2341/+2522
| | | | | | | | | Drops support for cx_Oracle prior to version 5.x, reworks numeric and binary support. Fixes: #4064 Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
* Don't use repr() for Column/ColumnClause in warningMike Bayer2017-09-101-1/+1
| | | | | | | | for #4073, use the string version of the column expression in the warning, otherwise the repr() is showing the hex id which causes unlimited warnings. Change-Id: I6869b685b237e7f02c7b5071701dd63a3577182a
* Warn instead of raise for unmapped column that matches on keyticket_4073Mike Bayer2017-09-101-3/+19
| | | | | | | | | | | | | | | Modified the change made to the ORM update/delete evaluator in :ticket:`3366` such that if an unmapped column expression is present in the update or delete, if the evaluator can match its name to the mapped columns of the target class, a warning is emitted, rather than raising UnevaluatableError. This is essentially the pre-1.2 behavior, and is to allow migration for applications that are currently relying upon this pattern. However, if the given attribute name cannot be matched to the columns of the mapper, the UnevaluatableError is still raised, which is what was fixed in :ticket:`3366`. Change-Id: I658ed0dbf485b7f8009774f9c12d9912447abd2a Fixes: #4073
* Merge "Remove LRU warnings"mike bayer2017-09-091-25/+0
|\
| * Remove LRU warningsMike Bayer2017-09-081-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed the warnings that are emitted when the LRU caches employed by the mapper as well as loader srtategies reach their threshold; the purpose of this warning was at first a guard against excess cache keys being generated but became basically a check on the "creating many engines" antipattern. While this is still an antipattern, the presense of test suites which both create an engine per test as well as raise on all warnings will be an inconvenience; it should not be critical that such test suites change their architecture just for this warning (though engine-per-test suite is always better). Change-Id: I41ef8cd642d05a845f53119b196440f9d7879cd9 Fixes: #4071
* | Rename MySQL dml.insert().values to .insertedMike Bayer2017-09-082-13/+14
|/ | | | | | | | | | | Changed the name of the ``.values`` attribute of the new MySQL INSERT..ON DUPLICATE KEY UPDATE construct to ``.inserted``, as :class:`.Insert` already has a method called :meth:`.Insert.values`. The ``.inserted`` attribute ultimately renders the MySQL ``VALUES()`` function. Change-Id: I8da8e30a3077698385a4b77e2c2032e2d1ff10b2 Fixes: #4072
* - skip oracle tests until we can merge refactorMike Bayer2017-09-081-0/+2
| | | | Change-Id: Ie9bec6e8f51d52349dcbd8009981818e459e88b8
* Merge "Check for non-mapped property in synonym"mike bayer2017-09-051-0/+25
|\
| * Check for non-mapped property in synonymMike Bayer2017-09-041-0/+25
| | | | | | | | | | | | | | | | | | | | An :class:`.InvalidRequestError` is raised when a :func:`.synonym` is used against an attribute that is not against a :class:`.MapperProperty`, such as an association proxy. Previously, a recursion overflow would occur trying to locate non-existent attributes. Change-Id: If2ce38c429a69951df4c94b71b74edbd59d775e3 Fixes: #4067
* | Merge "Ensure custom ops have consistent typing behavior, boolean support"mike bayer2017-09-041-2/+31
|\ \
| * | Ensure custom ops have consistent typing behavior, boolean supportMike Bayer2017-09-011-2/+31
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Refined the behavior of :meth:`.Operators.op` such that in all cases, if the :paramref:`.Operators.op.is_comparison` flag is set to True, the return type of the resulting expression will be :class:`.Boolean`, and if the flag is False, the return type of the resulting expression will be the same type as that of the left-hand expression, which is the typical default behavior of other operators. Also added a new parameter :paramref:`.Operators.op.return_type` as well as a helper method :meth:`.Operators.bool_op`. Change-Id: Ifc8553cd4037d741b84b70a9702cbd530f1a9de0 Fixes: #4063
* | Always check that discarded state is the expected oneMike Bayer2017-09-041-1/+62
|/ | | | | | | | | | | | Fixed race condition in ORM identity map which would cause objects to be inappropriately removed during a load operation, causing duplicate object identities to occur, particularly under joined eager loading which involves deduplication of objects. The issue is specific to garbage collection of weak references and is observed only under the Pypy interpreter. Change-Id: I9f6ae3fe5b078f26146af82b15d16f3a549a9032 Fixes: #4068
* Consider merge key with (None, ) as non-persistentMike Bayer2017-08-311-0/+36
| | | | | | | | | | | | Fixed bug in :meth:`.Session.merge` where objects in a collection that had the primary key attribute set to ``None`` for a key that is typically autoincrementing would be considered to be a database-persisted key for part of the internal deduplication process, causing only one object to actually be inserted in the database. Change-Id: I0a6e00043be0b2979cda33740e1be3b430ecf8c7 Fixes: #4056 (cherry picked from commit 5243341ed886e10a0d3f7fef8ae3d071e0ffdcf0)
* Add SQL Server CI coverageMike Bayer2017-08-3124-110/+166
| | | | Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
* Additional fixes to sane rowcountMike Bayer2017-08-314-26/+51
| | | | | | | | Implement rowcount assertions and single row check for post_update as well as deletes. Change-Id: I4e5ba7e8747bf0e0b41f569089eb8cdbf064b7a9 Fixes: #4062
* Add new sane_rowcount_w_returning flagMike Bayer2017-08-312-14/+10
| | | | | | | | | | | | | | | | | Added a new class of "rowcount support" for dialects that is specific to when "RETURNING", which on SQL Server looks like "OUTPUT inserted", is in use, as the PyODBC backend isn't able to give us rowcount on an UPDATE or DELETE statement when OUTPUT is in effect. This primarily affects the ORM when a flush is updating a row that contains server-calcluated values, raising an error if the backend does not return the expected row count. PyODBC now states that it supports rowcount except if OUTPUT.inserted is present, which is taken into account by the ORM during a flush as to whether it will look for a rowcount. ORM tests are implicit in existing tests run against PyODBC Fixes: #4062 Change-Id: Iff17cbe4c7a5742971ed85a4d58660c18cc569c2
* Implement AUTOCOMMIT for pyodbc, pymssqlMike Bayer2017-08-291-1/+1
| | | | | | | In prep for CI coverage for SQL Server, allow AUTOCOMMIT isolation level to work Change-Id: I850b977e75f53385986f2c181be4e4412dd3b3f4
* Generalize autocommit testingMike Bayer2017-08-291-0/+7
| | | | | | | To support adding AUTOCOMMIT to more dialects, add a suite test Change-Id: I585dcce19fcdce70e8cf21aea4edaa97d7bf2bb9
* Merge "Apply percent sign escaping to literal binds, comments"mike bayer2017-08-282-3/+22
|\
| * Apply percent sign escaping to literal binds, commentsMike Bayer2017-08-252-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug in new percent-sign support (e.g. :ticket:`3740`) where a bound parameter rendered with literal_binds would fail to escape percent-signs for relevant dialects. In addition, ensured new table / column comment support feature also fully makes use of literal-rendered parameters so that this percent sign support takes place with table / column comment DDL as well, allowing percent sign support for the mysql / psycopg2 backends that require escaping of percent signs. Change-Id: Ia4136a300933e9bc6a01a7b9afd5c7b9a3fee4e3 Fixes: #4054 Fixes: #4052
* | Merge "Allow for multiple FOLLOWING/PRECEDING in a window range"mike bayer2017-08-251-12/+18
|\ \ | |/ |/|
| * Allow for multiple FOLLOWING/PRECEDING in a window rangeMike Bayer2017-08-251-12/+18
| | | | | | | | | | | | | | | | | | | | | | Altered the range specification for window functions to allow for two of the same PRECEDING or FOLLOWING keywords in a range by allowing for the left side of the range to be positive and for the right to be negative, e.g. (1, 3) is "1 FOLLOWING AND 3 FOLLOWING". Change-Id: I7d3a6c641151bb49219104968d18dac2266f3db8 Fixes: #4053
* | Merge "Ensure col is not None when retrieving quick populators"mike bayer2017-08-242-13/+136
|\ \ | |/ |/|
| * Ensure col is not None when retrieving quick populatorsMike Bayer2017-08-232-13/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where an :func:`.undefer_group` option would not be recognized if it extended from a relationship that was loading using joined eager loading. In particular we need to double check the column both in terms of the given "adapter" as well as without applying the "adapter" when searching for the column in the result. As we now avoid redoing the row processor step we also improve on callcounts in joined eager loading. Change-Id: I0f48766f12f7299f4626ff41a00bf1f5bfca5f3b Fixes: #4048
* | - remove 3.4'sMike Bayer2017-08-231-184/+6
|/ | | | Change-Id: I16c9bceaf1ab68f72059b43bf01bb11f6395e6d5
* Handle cache key for option that has no strategyMike Bayer2017-08-222-0/+67
| | | | | | | | | | Fixed regression where the use of a :func:`.undefer_group` option in conjunction with a lazy loaded relationship option would cause an attribute error, due to a bug in the SQL cache key generation added in 1.2 as part of :ticket:`3954`. Change-Id: Icd9a34f0b5aa96d6433a2ab9c8d3eaee0006f609 Fixes: #4049
* Deactivate transaction if rollback failsMike Bayer2017-08-221-1/+107
| | | | | | | | | | | | Fixed regression introduced in 1.2.0b1 due to :ticket:`3934` where the :class:`.Session` would fail to "deactivate" the transaction, if a rollback failed (the target issue is when MySQL loses track of a SAVEPOINT). This would cause a subsequent call to :meth:`.Session.rollback` to raise an error a second time, rather than completing and bringing the :class:`.Session` back to ACTIVE. Fixes: #4050 Change-Id: Id245e8dd3487cb006b2d6631c8bd513b5ce81abe
* - ensure identifier re-use doesn't make this breakMike Bayer2017-08-221-3/+4
| | | | Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf
* - this test doesn't work in strict mode, not that importantMike Bayer2017-08-201-0/+1
| | | | Change-Id: I3ed361af5c9f0c7acbeb8b534966828949f4958b
* - a few mysql fixes, more to comeMike Bayer2017-08-202-8/+19
| | | | Change-Id: Icdcc8ed03374251b8d3815ae58e2726ea27c14b4
* - dont run sql mode config tests if we aren't on mysqlMike Bayer2017-08-191-0/+6
| | | | Change-Id: Ia5a491ec505afed1511a17a167cd1f7d8371acd4
* First level repair for cx_Oracle 6.0 test regressionsMike Bayer2017-08-182-1/+9
| | | | | | | | | | | | Fixed more regressions caused by cx_Oracle 6.0; at the moment, the only behavioral change for users is disconnect detection now detects for cx_Oracle.DatabaseError in addition to cx_Oracle.InterfaceError, as this behavior seems to have changed. Other issues regarding numeric precision and uncloseable connections are pending with the upstream cx_Oracle issue tracker. Change-Id: Id61f1e33b21c155a598396340dfdecd28ff4066b Fixes: #4045
* Merge "Enable uuid for pg8000"mike bayer2017-08-171-4/+2
|\
| * Enable uuid for pg8000Mike Bayer2017-08-081-4/+2
| | | | | | | | | | | | | | | | | | Enabled UUID support for the pg8000 driver, which supports native Python uuid round trips for this datatype. Arrays of UUID are still not supported, however. Change-Id: I44ca323c5d9f2cd87327210233bc36a3556eb050 Fixes: #4016
* | Merge "Ensure Oracle index w/ col DESC etc. is reflected"mike bayer2017-08-142-1/+51
|\ \
| * | Ensure Oracle index w/ col DESC etc. is reflectedMike Bayer2017-08-142-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where an index reflected under Oracle with an expression like "column DESC" would not be returned, if the table also had no primary key, as a result of logic that attempts to filter out the index implicitly added by Oracle onto the primary key columns. Reworked the "filter out the primary key index" logic in oracle get_indexes() to be clearer. This changeset also adds an internal check to ColumnCollection to accomodate for the case of a column being added twice, as well as adding a private _table argument to Index such that reflection can specify the Table explicitly. The _table argument can become part of public API in a later revision or release if needed. Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa Fixes: #4042
* | | Isolate memory tests in forksMike Bayer2017-08-141-28/+83
|/ / | | | | | | | | | | | | | | | | | | | | | | Swing the biggest hammer, run multiprocessing.Process() for each memusage test individually so that they are fully isolated from the parent process and any side effects of pytest-xdist Also add --nomemory as a shortcut to exclude_tags=memory-intensive and add this to the setup.py test runner as the memory tests should not be running for quick runs Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
* | - try adding the prints back in and re-testMike Bayer2017-08-111-8/+8
| | | | | | | | Change-Id: I3a82b06ecc3c065240cc05871dee2881f20e414e
* | - take more print statements out, maybe this is notMike Bayer2017-08-101-8/+8
|/ | | | | | | | the issue - unblock pytest-xdist now that the upstream issue is fixed, maybe this old version is the issue Change-Id: I28dd7ae0872948a188651d42e2f4af60bcbafe81
* Add quoted_name to pg8000 py_typesMike Bayer2017-08-081-1/+16
| | | | | | | | | | | Fixed bug where the pg8000 driver would fail if using :meth:`.MetaData.reflect` with a schema name, since the schema name would be sent as a "quoted_name" object that's a string subclass, which pg8000 doesn't recognize. The quoted_name type is added to pg8000's py_types collection on connect. Change-Id: Id0f838320cb66563685e094e4eae2d5116100d27 Fixes: #4041
* - dont print samples, this appears like it may beMike Bayer2017-08-081-1/+6
| | | | | | itself causing the memory leak in conjunction with pytest-xdist Change-Id: Ia8704e54186e6dd60ea0e32a246fcf1419686663
* - allow the shrink phase for memusage to go until zeroed,Mike Bayer2017-08-081-3/+12
| | | | | | | some MySQL-env element is causing memory growth that goes very far before stopping Change-Id: Ic0882dd78636067980fceba4e3a969de78d5b26a
* Enable multi-level selectin polymorphic loadingMike Bayer2017-08-072-13/+342
| | | | | Change-Id: Icc742bbeecdb7448ce84caccd63e086af16e81c1 Fixes: #4026
* - fix one test for STRICT, which may be turned on by defaultMike Bayer2017-08-042-2/+3
| | | | | | in mariadb 10.2. more mariadb fixes coming Change-Id: I6e3a94ae7340772663677b1082506adbb2d84a38
* Merge "Check for column object in eval_none, not propkey"mike bayer2017-07-191-5/+44
|\
| * Check for column object in eval_none, not propkeyMike Bayer2017-07-181-5/+44
| | | | | | | | | | | | | | | | | | | | Fixed bug involving JSON NULL evaluation logic added in 1.1 as part of :ticket:`3514` where the logic would not accommodate ORM mapped attributes named differently from the :class:`.Column` that was mapped. Change-Id: I1848afcfb63ad7f074f315d8d3097666069b42be Fixes: #4031
* | Check for non-entity when inspecting for subqueryloadMike Bayer2017-07-181-0/+19
|/ | | | | | | | | | Fixed issue where adding additional non-entity columns to a query that includes an entity with subqueryload relationships would fail, due to an inspection added in 1.1.11 as a result of :ticket:`4011`. Change-Id: I8ef082be649125bdc07b428cb9b0a77a65d73671 Fixes: #4033
* Add support for CACHE and ORDER to sequencesDavid Moore2017-07-051-0/+12
| | | | | | | | | | | Added new keywords :paramref:`.Sequence.cache` and :paramref:`.Sequence.order` to :class:`.Sequence`, to allow rendering of the CACHE parameter understood by Oracle and PostgreSQL, and the ORDER parameter understood by Oracle. Pull request courtesy David Moore. Change-Id: I082c3f8ef56ef89dbaad5da9d5695be5313b0614 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/96
* Implement MySQL's ON DUPLICATE KEY UPDATEMichael Doronin2017-07-032-3/+104
| | | | | | | | | | | Added support for MySQL's ON DUPLICATE KEY UPDATE MySQL-specific :class:`.mysql.dml.Insert` object. Pull request courtesy Michael Doronin. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Resolves: #4009 Change-Id: Ic71424f3c88af6082b48a910a2efb7fbfc0a7eb4 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/365
* Merge "Support state expiration for with_expression(); rename ↵mike bayer2017-06-261-4/+51
|\ | | | | | | deferred_expression"