diff options
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index d8aa58c2c..4e1223eea 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -456,9 +456,9 @@ class SQLiteCompiler(compiler.SQLCompiler): def visit_cast(self, cast, **kwargs): if self.dialect.supports_cast: - return super(SQLiteCompiler, self).visit_cast(cast) + return super(SQLiteCompiler, self).visit_cast(cast, **kwargs) else: - return self.process(cast.clause) + return self.process(cast.clause, **kwargs) def visit_extract(self, extract, **kw): try: diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4448f7c7b..673e5f89b 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -961,7 +961,6 @@ class SQLCompiler(Compiled): literal_binds=False, skip_bind_expression=False, **kwargs): - if not skip_bind_expression and bindparam.type._has_bind_expression: bind_expression = bindparam.type.bind_expression(bindparam) return self.process(bind_expression, diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index d779caaea..61d906e1c 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -790,7 +790,7 @@ class _Binary(TypeEngine): def literal_processor(self, dialect): def process(value): - value = value.decode(self.dialect.encoding).replace("'", "''") + value = value.decode(dialect.encoding).replace("'", "''") return "'%s'" % value return process @@ -801,6 +801,9 @@ class _Binary(TypeEngine): # Python 3 - sqlite3 doesn't need the `Binary` conversion # here, though pg8000 does to indicate "bytea" def bind_processor(self, dialect): + if dialect.dbapi is None: + return None + DBAPIBinary = dialect.dbapi.Binary def process(value): |
