diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-25 16:08:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-25 16:08:21 -0400 |
commit | d92177cede956e4ca12e0fdad5021bdd54715161 (patch) | |
tree | 6b5c5514dd576007c23052d73370ecd833914a0c /test/dialect/postgresql/test_compiler.py | |
parent | b7e75172b391f728451c59c4f9eba2b79143bf66 (diff) | |
download | sqlalchemy-d92177cede956e4ca12e0fdad5021bdd54715161.tar.gz |
- Fixed bug in :class:`.postgresql.array` object where comparison
to a plain Python list would fail to use the correct array constructor.
Pull request courtesy Andrew. fixes #3141
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index c71852d90..b08fb0160 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -501,6 +501,16 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): 'param_3': 3, 'param_2': 2} ) + def test_array_literal_compare(self): + self.assert_compile( + postgresql.array([1, 2]) == [3, 4, 5], + "ARRAY[%(param_1)s, %(param_2)s] = " + "ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]", + checkparams={'param_5': 5, 'param_4': 4, 'param_1': 1, + 'param_3': 3, 'param_2': 2} + + ) + def test_array_literal_insert(self): m = MetaData() t = Table('t', m, Column('data', postgresql.ARRAY(Integer))) |