summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/oracle/base.py6
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py5
-rw-r--r--lib/sqlalchemy/ext/serializer.py2
-rw-r--r--lib/sqlalchemy/types.py4
4 files changed, 14 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py
index e0fa10b4f..831ba5f1b 100644
--- a/lib/sqlalchemy/dialects/oracle/base.py
+++ b/lib/sqlalchemy/dialects/oracle/base.py
@@ -429,6 +429,12 @@ class OracleCompiler(compiler.SQLCompiler):
return "CONTAINS (%s, %s)" % (self.process(binary.left),
self.process(binary.right))
+ def visit_true(self, expr, **kw):
+ return '1'
+
+ def visit_false(self, expr, **kw):
+ return '0'
+
def get_select_hint_text(self, byfroms):
return " ".join(
"/*+ %s */" % text for table, text in byfroms.items()
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 5d9368893..1acdb57b9 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -673,7 +673,10 @@ class ARRAY(sqltypes.Concatenable, sqltypes.TypeEngine):
if dim is None:
arr = list(arr)
if dim == 1 or dim is None and (
- not arr or not hasattr(arr[0], '__iter__')):
+ # this has to be (list, tuple), or at least
+ # not hasattr('__iter__'), since Py3K strings
+ # etc. have __iter__
+ not arr or not isinstance(arr[0], (list, tuple))):
if itemproc:
return collection(itemproc(x) for x in arr)
else:
diff --git a/lib/sqlalchemy/ext/serializer.py b/lib/sqlalchemy/ext/serializer.py
index b4c67538a..5a3fb5937 100644
--- a/lib/sqlalchemy/ext/serializer.py
+++ b/lib/sqlalchemy/ext/serializer.py
@@ -141,7 +141,7 @@ def Deserializer(file, metadata=None, scoped_session=None, engine=None):
return class_mapper(cls)
elif type_ == "mapperprop":
mapper, keyname = args.split(':')
- cls = pickle.loads(b64decode(args))
+ cls = pickle.loads(b64decode(mapper))
return class_mapper(cls).attrs[keyname]
elif type_ == "table":
return metadata.tables[args]
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py
index 1824a9b3f..46cf9e2a1 100644
--- a/lib/sqlalchemy/types.py
+++ b/lib/sqlalchemy/types.py
@@ -1184,7 +1184,9 @@ class Text(String):
In SQL, usually corresponds to CLOB or TEXT. Can also take Python
unicode objects and encode to the database's encoding in bind
- params (and the reverse for result sets.)
+ params (and the reverse for result sets.) In general, TEXT objects
+ do not have a length; while some databases will accept a length
+ argument here, it will be rejected by others.
"""
__visit_name__ = 'text'