]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
handle null tablespace_name
authorJonathan Ellis <jbellis@gmail.com>
Tue, 20 May 2008 23:16:45 +0000 (23:16 +0000)
committerJonathan Ellis <jbellis@gmail.com>
Tue, 20 May 2008 23:16:45 +0000 (23:16 +0000)
lib/sqlalchemy/databases/oracle.py

index 45bbe2ea43c78c5f96cf23ab1d3041d6cb0c1f5b..5a839ec7c6523648855b963c3aeeb4eed4877a8f 100644 (file)
@@ -389,10 +389,10 @@ class OracleDialect(default.DefaultDialect):
     def table_names(self, connection, schema):
         # note that table_names() isnt loading DBLINKed or synonym'ed tables
         if schema is None:
-            s = "select table_name from all_tables where tablespace_name NOT IN ('SYSTEM', 'SYSAUX')"
+            s = "select table_name from all_tables where nvl(tablespace_name, 'no tablespace') NOT IN ('SYSTEM', 'SYSAUX')"
             cursor = connection.execute(s)
         else:
-            s = "select table_name from all_tables where tablespace_name NOT IN ('SYSTEM','SYSAUX') AND OWNER = :owner"
+            s = "select table_name from all_tables where nvl(tablespace_name, 'no tablespace') NOT IN ('SYSTEM','SYSAUX') AND OWNER = :owner"
             cursor = connection.execute(s, {'owner': self._denormalize_name(schema)})
         return [self._normalize_name(row[0]) for row in cursor]