diff options
| author | Michael Birtwell <michael.birtwell@starleaf.com> | 2017-05-25 11:11:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-05-25 16:02:13 -0400 |
| commit | f8a3f14e4f862a4bf0be591699f1f72815c72514 (patch) | |
| tree | 23352abe2b074a5470ec37a2151c11b039b44e77 /test/orm | |
| parent | de11c5217b4c62f86dfd05a28689159095ab1024 (diff) | |
| download | sqlalchemy-f8a3f14e4f862a4bf0be591699f1f72815c72514.tar.gz | |
Flatten operator precedence for comparison operators
The operator precedence for all comparison operators such as LIKE, IS,
IN, MATCH, equals, greater than, less than, etc. has all been merged
into one level, so that expressions which make use of these against
each other will produce parentheses between them. This suits the
stated operator precedence of databases like Oracle, MySQL and others
which place all of these operators as equal precedence, as well as
Postgresql as of 9.5 which has also flattened its operator precendence.
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #3999
Change-Id: I3f3d5124a64af0d376361cdf15a97e2e703be56f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/367
Diffstat (limited to 'test/orm')
| -rw-r--r-- | test/orm/test_relationships.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/orm/test_relationships.py b/test/orm/test_relationships.py index 52debbe3a..42c554bc8 100644 --- a/test/orm/test_relationships.py +++ b/test/orm/test_relationships.py @@ -442,12 +442,12 @@ class DirectSelfRefFKTest(fixtures.MappedTest, AssertsCompiledSQL): Entity = self.classes.Entity self.assert_compile( Entity.descendants.property.strategy._lazywhere, - "entity.path LIKE (:param_1 || :path_1)" + "entity.path LIKE :param_1 || :path_1" ) self.assert_compile( Entity.descendants.property.strategy._rev_lazywhere, - ":param_1 LIKE (entity.path || :path_1)" + ":param_1 LIKE entity.path || :path_1" ) def test_ancestors_lazyload_clause(self): @@ -456,12 +456,12 @@ class DirectSelfRefFKTest(fixtures.MappedTest, AssertsCompiledSQL): # :param_1 LIKE (:param_1 || :path_1) self.assert_compile( Entity.anscestors.property.strategy._lazywhere, - ":param_1 LIKE (entity.path || :path_1)" + ":param_1 LIKE entity.path || :path_1" ) self.assert_compile( Entity.anscestors.property.strategy._rev_lazywhere, - "entity.path LIKE (:param_1 || :path_1)" + "entity.path LIKE :param_1 || :path_1" ) def test_descendants_lazyload(self): @@ -524,7 +524,7 @@ class DirectSelfRefFKTest(fixtures.MappedTest, AssertsCompiledSQL): self.assert_compile( sess.query(Entity).join(Entity.descendants, aliased=True), "SELECT entity.path AS entity_path FROM entity JOIN entity AS " - "entity_1 ON entity_1.path LIKE (entity.path || :path_1)" + "entity_1 ON entity_1.path LIKE entity.path || :path_1" ) |
