Issue 1:
Migrated issue, originally created by cwebber (@cwebber)

Python built with sqlite 3.8.11.1 and before seems to be working fine. Building with newer versions of sqlite, such as 3.10.0 or 3.10.2 results in failing tests:

=================================== FAILURES ===================================
__________ QueryTest_sqlite_pysqlite.test_column_accessor_sqlite_raw ___________
Traceback (most recent call last):
File "<string>", line 2, in test_column_accessor_sqlite_raw
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/../lib/sqlalchemy/testing/exclusions.py", line 72, in decorate
return fn(*args, **kw)
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/sql/test_query.py", line 898, in test_column_accessor_sqlite_raw
assert 'user_id' not in r
AssertionError: assert 'user_id' not in (1, 'john')
_______ QueryTest_sqlite_pysqlite.test_column_accessor_sqlite_translated _______
Traceback (most recent call last):
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/../lib/sqlalchemy/engine/result.py", line 70, in __getitem__
processor, obj, index = self._keymap[key]
KeyError: 'query_users.user_id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 2, in test_column_accessor_sqlite_translated
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/../lib/sqlalchemy/testing/exclusions.py", line 72, in decorate
return fn(*args, **kw)
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/sql/test_query.py", line 918, in test_column_accessor_sqlite_translated
eq_(r['query_users.user_id'], 1)
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/../lib/sqlalchemy/engine/result.py", line 72, in __getitem__
processor, obj, index = self._parent._key_fallback(key)
File "/tmp/guix-build-python-sqlalchemy-0.9.7.drv-0/SQLAlchemy-0.9.7/test/../lib/sqlalchemy/engine/result.py", line 331, in _key_fallback
expression._string_or_unprintable(key))
sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for column 'query_users.user_id'"
=========================== short test summary info ============================
FAIL test/sql/test_query.py::QueryTest_sqlite_pysqlite::()::test_column_accessor_sqlite_raw
FAIL test/sql/test_query.py::QueryTest_sqlite_pysqlite::()::test_column_accessor_sqlite_translated
============= 2 failed, 5803 passed, 737 skipped in 237.59 seconds =============
phase `check' failed after 241.9 seconds

Issue 2:
Migrated issue, originally created by Michael Bayer (@zzzeek)

this script in http://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#dotted-column-names now passes:

import sqlite3

conn = sqlite3.connect(":memory:")
cursor = conn.cursor()

cursor.execute("create table x (a integer, b integer)")
cursor.execute("insert into x (a, b) values (1, 1)")
cursor.execute("insert into x (a, b) values (2, 2)")

cursor.execute("select x.a, x.b from x")
assert [c[0] for c in cursor.description] == ['a', 'b']

cursor.execute('''
select x.a, x.b from x where a=1
union
select x.a, x.b from x where a=2
''')
assert [c[0] for c in cursor.description] == ['a', 'b'], \
[c[0] for c in cursor.description]

the sqlite checkin is http://www.sqlite.org/src/info/47f10b7e5d8c1d96. We need to turn off translate_colnames for this version and also some tests fail.