diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-01-31 17:57:17 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-01-31 17:57:17 -0500 |
| commit | b360dbf7ebb7cc5bb290847fdd9818d205244a94 (patch) | |
| tree | ec96fe0440c5f1165b54bfc9a993b3aa1c39924a /test/sql | |
| parent | 4b57df9e30b0181d9b9f2cad558a6f8362b0184a (diff) | |
| download | sqlalchemy-b360dbf7ebb7cc5bb290847fdd9818d205244a94.tar.gz | |
- Fixed bug whereby SQLite compiler failed to propagate compiler arguments
such as "literal binds" into a CAST expression.
- Fixed bug whereby binary type would fail in some cases
if used with a "test" dialect, such as a DefaultDialect or other
dialect with no DBAPI.
- Fixed bug where "literal binds" wouldn't work with a bound parameter
that's a binary type. A similar, but different, issue is fixed
in 0.8.
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_compiler.py | 6 | ||||
| -rw-r--r-- | test/sql/test_types.py | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 53b9f68fc..cd9d31864 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -1185,6 +1185,12 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): dialect=dialect ) + self.assert_compile( + select([literal(util.b("foo"))]), + "SELECT 'foo' AS anon_1", + dialect=dialect + ) + assert_raises_message( exc.CompileError, "Bind parameter 'foo' without a renderable value not allowed here.", diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 3df19874b..fd927b51a 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -1203,6 +1203,17 @@ class BinaryTest(fixtures.TestBase, AssertsExecutionResults): count().scalar(), 1) + def test_literal_roundtrip(self): + compiled = select([cast(literal(util.b("foo")), LargeBinary)]).compile( + dialect=testing.db.dialect, + compile_kwargs={"literal_binds": True}) + result = testing.db.execute(compiled) + eq_(result.scalar(), util.b("foo")) + + def test_bind_processor_no_dbapi(self): + b = LargeBinary() + eq_(b.bind_processor(default.DefaultDialect()), None) + def load_stream(self, name): f = os.path.join(os.path.dirname(__file__), "..", name) return open(f, mode='rb').read() |
