.. changelog::
:version: 1.0.13
+ .. change::
+ :tags: bug, sql
+ :tickets: 3690
+
+ 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::
:tags: bug, sql
:tickets: 3682
if key in seen:
# this is an "ambiguous" element, replacing
# the full record in the map
+ key = key.lower() if not self.case_sensitive else key
by_key[key] = (None, key, None)
seen.add(key)
lambda: row[u2.c.user_id]
)
+ @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