summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Enable include_table for ON CONFLICT whereclausesMike Bayer2016-09-281-6/+22
| | | | | | | | | Fixed issue in new PG "on conflict" construct where columns including those of the "excluded" namespace would not be table-qualified in the WHERE clauses in the statement. Change-Id: Idfefc93e7e7b0d84805e23d5436d822d606f6a0a Fixes: #3807
* Merge "Handle BaseException in all _handle_dbapi_error"mike bayer2016-09-261-3/+91
|\
| * Handle BaseException in all _handle_dbapi_errorMike Bayer2016-09-211-3/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests illustrate that exceptions like GreenletExit and even KeyboardInterrupt can corrupt the state of a DBAPI connection like that of pymysql and mysqlclient. Intercept BaseException errors within the handle_error scheme and invalidate just the connection alone in this case, but not the whole pool. The change is backwards-incompatible with a program that currently intercepts ctrl-C within a database transaction and wants to continue working on that transaction. Ensure the event hook can be used to reverse this behavior. Change-Id: Ifaa013c13826d123eef34e32b7e79fff74f1b21b Fixes: #3803
* | Ensure mapper.polymorphic_on is polymorphic_prop.columns[0]Mike Bayer2016-09-211-1/+76
|/ | | | | | | | | Fixed bug where joined eager loading would fail for a polymorphically- loaded mapper, where the polymorphic_on was set to an un-mapped expression such as a CASE expression. Change-Id: Iffe68196aaac592165c89684f09f4c06cd78ce54 Fixes: #3800
* Merge "Add exclude_tablespaces argument to Oracle"mike bayer2016-09-201-0/+35
|\
| * Add exclude_tablespaces argument to OracleDavid Fraser2016-09-201-0/+35
| | | | | | | | | | | | | | | | | | Allows the SYSTEM and SYSAUX tablespaces to be only conditionally omitted when doing get_table_names() and get_temp_table_names(). Change-Id: Ie6995873f05163f2ce473a6a9c2d958a30681b44 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/292
* | Merge "Add the "triggering mapper" to the configure_mappers error message."mike bayer2016-09-202-7/+10
|\ \ | |/ |/|
| * Add the "triggering mapper" to the configure_mappers error message.John Perkins2016-09-202-7/+10
| | | | | | | | | | | | | | | | | | | | There are cases where the originating mapper name is not present in the exception message, such as relationship initialization against an unmapped class. Ensure the originating mapper is named in the string output. Pull-request: https://github.com/zzzeek/sqlalchemy/pull/298 Change-Id: I9f23bfa90b26dde9229ab7ec812eec9ceae48153
* | - disable two phase testing for mysql entirely, build serversMike Bayer2016-09-201-2/+3
| | | | | | | | | | | | have no time to deal with MySQL 5.7's issues Change-Id: Ic5f4e5b0aff1b4b5210bc7b5da203f536561e585
* | Merge "Allow SQL expressions to be set on PK columns"mike bayer2016-09-202-0/+69
|\ \
| * | Allow SQL expressions to be set on PK columnsMike Bayer2016-09-202-0/+69
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Removes an unnecessary transfer of modified PK column value to the params dictionary, so that if the modified PK column is already present in value_params, this remains in effect. Also propagate a new flag through to _emit_update_statements() that will trip "return_defaults()" across the board if a PK col w/ SQL expression change is present, and pull this PK value in _postfetch as well assuming we're an UPDATE. Change-Id: I9ae87f964df9ba8faea8e25e96b8327f968e5d1b Fixes: #3801
* | Merge "Exclude eq and ne from associative operators"mike bayer2016-09-201-0/+8
|\ \
| * | Exclude eq and ne from associative operatorsJohn Passaro2016-09-191-0/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | The "eq" and "ne" operators are no longer part of the list of "associative" operators, while they remain considered to be "commutative". This allows an expression like ``(x == y) == z`` to be maintained at the SQL level with parenthesis. Pull request courtesy John Passaro. Fixes: #3799 Change-Id: I3759d8987b35649d7418b6524316c9e70c857e68 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/308
* | Merge "Support bindparam() with callable for primaryjoin"mike bayer2016-09-202-3/+61
|\ \
| * | Support bindparam() with callable for primaryjoinMike Bayer2016-09-192-3/+61
| |/ | | | | | | | | | | | | | | | | | | | | Fixes the comparison of bindparam() objects based on the "callable" parameter being present which helps to correctly detect use_get, and also checks for "callable" when detecting parameters for value substitution and will not impact the object if present. Change-Id: I4c93ee5d404d2648dd9835beeae0c5fb67e37d19 Fixes: #3767
* | Merge "Fix ArgumentError access in Session._add_bind"mike bayer2016-09-191-0/+18
|\ \
| * | Fix ArgumentError access in Session._add_bindMike Bayer2016-09-191-0/+18
| |/ | | | | | | | | | | Fixes: #3798 Change-Id: Ib4e6344b599e871f9d46d36a5aeb7ba3104dc99b Pull-request: https://github.com/zzzeek/sqlalchemy/pull/293
* | Additions to support HAAlchemy pluginMike Bayer2016-09-163-39/+78
|/ | | | | | | | | | | | | | | | | | | - add a connect=True key to connection record to support pre-loading of _ConnectionRecord objects - ensure _ConnectionRecord.close() leaves the record in a good state for reopening - add _ConnectionRecord.record_info for persistent storage - add "in_use" accessor based on fairy_ref being present or not - allow for the exclusions system and SuiteRequirements to be usable without the full plugin_base setup. - move some Python-env requirements to the importable requirements.py module. - allow starttime to be queried - add additional events for engine plugins - have "dialect" be a first-class parameter to the pool, ensure the engine strategy supplies it up front Change-Id: Ibf549f7a1766e49d335cd6f5e26bacfaef9a8229
* - latest mysql 5.7 also crashing on XA recovery, disableMike Bayer2016-09-162-5/+6
| | | | | | XA recovery for all MySQL Change-Id: I4f77de521cd80c09fdf97e5bbe5dfd1c830dc3cb
* Repair foreign_keys population for Join._refresh_for_new_columnMike Bayer2016-09-152-1/+89
| | | | | | | | | | Fixed bug where setting up a single-table inh subclass of a joined-table subclass which included an extra column would corrupt the foreign keys collection of the mapped table, thereby interfering with the initialization of relationships. Change-Id: I04a0cf98fd456d12d5a5b9e77a46a01246969a63 Fixes: #3797
* Merge "Allow stringify compiler to render unnamed column"mike bayer2016-09-021-2/+11
|\
| * Allow stringify compiler to render unnamed columnMike Bayer2016-09-021-2/+11
| | | | | | | | | | | | | | | | | | | | Stringify of expression with unnamed :class:`.Column` objects, as occurs in lots of situations including ORM error reporting, will now render the name in string context as "<name unknown>" rather than raising a compile error. Change-Id: I76f637c5eb4cfdb1b526964cb001565b97e296da Fixes: #3789
* | Repair clauselist comparison to account for clause orderingMike Bayer2016-09-022-1/+146
|/ | | | | | | | | | | | | | | | Fixed bug where the "simple many-to-one" condition that allows lazy loading to use get() from identity map would fail to be invoked if the primaryjoin of the relationship had multiple clauses separated by AND which were not in the same order as that of the primary key columns being compared in each clause. This ordering difference occurs for a composite foreign key where the table-bound columns on the referencing side were not in the same order in the .c collection as the primary key columns on the referenced side....which in turn occurs a lot if one is using declarative mixins and/or declared_attr to set up columns. Change-Id: I66cce74f614c04ed693dc0d58ac8c952b2f8ae54 Fixes: #3788
* Check for supports_execution at ClauseElement baseMike Bayer2016-08-311-0/+20
| | | | | | | | | | Raise a more descriptive exception / message when ClauseElement or non-SQLAlchemy objects that are not "executable" are erroneously passed to ``.execute()``; a new exception ObjectNotExecutableError is raised consistently in all cases. Change-Id: I2dd393121e2c7e5b6b9e40286a2f25670876e8e4 Fixes: #3786
* Provide more informative error when joining with no entitiespr/304Michael Williamson2016-08-281-0/+13
|
* Raise when two validators conflictMike Bayer2016-08-261-1/+38
| | | | | | | | Two @validates decorators that make use of the same name is not supported. Raise an exception. Change-Id: Ia3e89ffdc9ef345a0de258e2ac0ac5e0bd421c61 Fixes: #3776
* Merge "Add docstring to declarative_base"mike bayer2016-08-221-0/+9
|\
| * Add docstring to declarative_baseFrazer McLean2016-08-061-0/+9
| | | | | | | | | | Change-Id: I5ad44362515908592f1e8b1e6254a5270d43234a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/295
* | Merge remote-tracking branch 'origin/pr/299'Mike Bayer2016-08-163-4/+4
|\ \
| * | Spelling fixespr/299Ville Skyttä2016-08-083-4/+4
| |/
* | Rework _apply_joins(), _prep_for_joins() totallyMike Bayer2016-08-151-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | The approach here is still error prone and hard to follow. Reorganize the whole thing to take a pretty blunt approach to the structure of to_join(). Also fix some never-called code (!) in _prep_for_joins() and ensure we re-use an aliased object. Fixes: #3774 Change-Id: Ie6319415ae7213b4a33eac2ab70803ad2880d340
* | Ensure final link in subqueryload join is correctMike Bayer2016-08-121-12/+45
| | | | | | | | | | | | | | | | | | Fixed bug in subquery eager loading where a subqueryload of an "of_type()" object linked to a second subqueryload of a plain mapped class would fail to link the joins correctly. Change-Id: I4be89e6f5e492438464a2ded01eb9c84d7ff7d4e Fixes: #3773
* | - fix this test which did not allow for the A/ ASub to be loadedMike Bayer2016-08-121-7/+15
|/ | | | | | polymorphically Change-Id: Id82435fa16b0456f32bce49715c6606e3a1534c8
* Build string/int processors for JSONIndexType, JSONPathTypeMike Bayer2016-08-041-0/+71
| | | | | | | | | | | | Fixed regression in JSON datatypes where the "literal processor" for a JSON index value, that needs to take effect for example within DDL, would not be invoked for the value. The native String and Integer datatypes are now called upon from within the JSONIndexType and JSONPathType. This is applied to the generic, Postgresql, and MySQL JSON types. Change-Id: Ifa5f2acfeee57a79d01d7fc85d265a37bd27c716 Fixes: #3765
* Propagate kwargs to all MySQL CAST pathsMike Bayer2016-08-041-0/+35
| | | | | Change-Id: I23a6abb26bbbe3d118887d043ce761fc4572d8d2 Fixes: #3766
* Ensure post-__clause_element__() expression are used in IndexMike Bayer2016-07-311-0/+14
| | | | | | | | | | | The change in Index for 1.1 combined with the fix for ref #3763 still fails to deliver the correct object resolved by __clause_element__() to the list of expressions for compilation. Make sure we use the expression that's been unwrapped from __clause_element__(). Change-Id: Ie1df8db5090de665048331786f0024d52851923f Fixes: #3763
* Merge "Index should extract __clause_element__() early"mike bayer2016-07-301-1/+23
|\
| * Index should extract __clause_element__() earlyMike Bayer2016-07-301-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where :class:`.Index` would fail to extract columns from compound SQL expressions if those SQL expressions were wrapped inside of an ORM-style ``__clause_element__()`` construct. This bug exists in 1.0.x as well, however in 1.1 is more noticeable as hybrid_property @expression now returns a wrapped element. Fixes: #3763 Change-Id: I992536386503a1fb3f2305790abe008d72c44c4a
* | Merge "Clarify order_by(False)"mike bayer2016-07-301-0/+78
|\ \ | |/ |/|
| * Clarify order_by(False)Mike Bayer2016-07-291-0/+78
| | | | | | | | | | | | | | | | It wasn't clear how this differs from order_by(None); add more tests and document that this has to do with whether or not mapper.order_by will be re-enabled as well. Change-Id: I332e8ac60c999b38c5a243f1cb72de3cf77891b6
* | - Consoliate test/sql/test_constraint ConstraintAPITestMike Bayer2016-07-302-371/+370
| | | | | | | | | | | | | | and test/sql/test_metadata IndexTest into test/sql/test_metadata ConstraintTest Change-Id: I7aeee9a1edbbd889200afc393695f73d5fbac3f3
* | Merge "Allow None to cancel Query.group_by()"mike bayer2016-07-291-0/+51
|\ \ | |/
| * Allow None to cancel Query.group_by()Iuri Diniz2016-07-291-0/+51
| | | | | | | | | | | | | | | | | | | | | | This replicates the same behavior as order_by(). order_by() will also be updated to deprecate passing of False as this is no longer functionally different than passing None. Change-Id: I2fc05d0317d28b6c83373769a48f7eea32d56290 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/297
* | Enable JSON testing for pymysqlMike Bayer2016-07-291-4/+1
|/ | | | | | | | PyMySQL upstream has released 0.7.6 which should resolve JSON encoding issues. Change-Id: Icf543d48dace1419a0aac78bdb15ec666f0edafe Fixes: #3754
* Allow Table._reset_exported to silently passMike Bayer2016-07-241-0/+15
| | | | | | | | | | | Fixed bug in :class:`.Table` where the internal method ``_reset_exported()`` would corrupt the state of the object. This method is intended for selectable objects and is called by the ORM in some cases; an erroneous mapper configuration would could lead the ORM to call this on on a :class:`.Table` object. Change-Id: I63fa34ee0cdf16358bb125c556390df79758bcbc Fixes: #3755
* - don't use pymysql at all for JSON, there's Py2K failures alsoMike Bayer2016-07-241-1/+1
| | | | Change-Id: I39a574ea72f5c7af0084dee3169679c5f534cb8b
* - Workaround in tests for https://github.com/PyMySQL/PyMySQL/issues/488Mike Bayer2016-07-241-4/+6
| | | | Change-Id: I4f935cce878eb1678b432f4cb4ba6ee122f8e9d4
* - a variety of test adjustments to accomodate for MySQL 5.7Mike Bayer2016-07-248-17/+46
| | | | Change-Id: Ied4245433d0d7b469dae6e7394c4931d8405f387
* Remove same-named relationship warningMike Bayer2016-07-191-1/+70
| | | | | | | | | | Removed a warning that dates back to 0.4 which emits when a same-named relationship is placed on two mappers that inherits via joined or single table inheritance. The warning does not apply to the current unit of work implementation. Change-Id: If528ec3a2f4dc60712d9044fd1ec6c4dfbf0eadb Fixes: #3749
* Merge "Add `default` parameter for `index_property`"mike bayer2016-07-131-0/+25
|\