- Fixed erroneous reference to "owner" attribute in
Informix dialect when reflecting tables.
[ticket:1645]
-
+
+- oracle
+ - The "table_names" dialect function, used by MetaData
+ .reflect(), omits "index overflow tables", a system
+ table generated by Oracle when "index only tables"
+ with overflow are used. These tables aren't accessible
+ via SQL and can't be reflected. [ticket:1637]
+
- ext
- A column can be added to a joined-table declarative
superclass after the class has been constructed
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 nvl(tablespace_name, 'no tablespace') NOT IN ('SYSTEM', 'SYSAUX')"
+ s = "select table_name from all_tables where nvl(tablespace_name, 'no tablespace') "\
+ "NOT IN ('SYSTEM', 'SYSAUX') AND IOT_NAME IS NULL"
cursor = connection.execute(s)
else:
- s = "select table_name from all_tables where nvl(tablespace_name, 'no tablespace') 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 "\
+ "AND IOT_NAME IS NULL"
cursor = connection.execute(s, {'owner': self._denormalize_name(schema)})
return [self._normalize_name(row[0]) for row in cursor]
eq_(row['bindata'].read(), 'this is binary')
finally:
t.drop(engine)
+
+class DontReflectIOTTest(TestBase):
+ """test that index overflow tables aren't included in table_names."""
+
+ def setup(self):
+ testing.db.execute("""
+ CREATE TABLE admin_docindex(
+ token char(20),
+ doc_id NUMBER,
+ token_frequency NUMBER,
+ token_offsets VARCHAR2(2000),
+ CONSTRAINT pk_admin_docindex PRIMARY KEY (token, doc_id))
+ ORGANIZATION INDEX
+ TABLESPACE users
+ PCTTHRESHOLD 20
+ OVERFLOW TABLESPACE users
+ """)
+
+ def teardown(self):
+ testing.db.execute("drop table admin_docindex")
+
+ def test_reflect_all(self):
+ m = MetaData(testing.db)
+ m.reflect()
+ eq_(
+ set(t.name for t in m.tables.values()),
+ set(['admin_docindex'])
+ )
+
class BufferedColumnTest(TestBase, AssertsCompiledSQL):
__only_on__ = 'oracle'