summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-04-21 10:36:19 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-04-21 10:36:19 -0400
commit1f3e5d9826fe989f2212745f6b3592b2ef9b5e32 (patch)
treee9c2cbdfd73de773ce72ad69266505315ec6188e /test/sql
parent8ab08cf805fb40c57d8b7eb5d4b99726fee4f2b3 (diff)
downloadsqlalchemy-1f3e5d9826fe989f2212745f6b3592b2ef9b5e32.tar.gz
Fix result set handling for case insensitive dupe cols
Fixed bug where when using ``case_sensitive=False`` with an :class:`.Engine`, the result set would fail to correctly accomodate for duplicate column names in the result set, causing an error when the statement is executed in 1.0, and preventing the "ambiguous column" exception from functioning in 1.1. Change-Id: If582bb9fdd057e4da3ae42f7180b17d1a1a2d98e Fixes: #3690
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_resultset.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py
index ba85fb82e..f74e51f62 100644
--- a/test/sql/test_resultset.py
+++ b/test/sql/test_resultset.py
@@ -689,6 +689,21 @@ class ResultProxyTest(fixtures.TablesTest):
)
@testing.requires.duplicate_names_in_cursor_description
+ def test_ambiguous_column_case_sensitive(self):
+ eng = engines.testing_engine(options=dict(case_sensitive=False))
+
+ row = eng.execute(select([
+ literal_column('1').label('SOMECOL'),
+ literal_column('1').label('SOMECOL'),
+ ])).first()
+
+ assert_raises_message(
+ exc.InvalidRequestError,
+ "Ambiguous column name",
+ lambda: row['somecol']
+ )
+
+ @testing.requires.duplicate_names_in_cursor_description
def test_ambiguous_column_contains(self):
users = self.tables.users
addresses = self.tables.addresses