[c-c db-check] skip error while checking relation, useful when analyzing really broken database (after a migration failure for instance stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 07 Sep 2010 22:59:55 +0200
branchstable
changeset 6185 229006accd26
parent 6184 da580218a5b3
child 6186 8ada7df95877
[c-c db-check] skip error while checking relation, useful when analyzing really broken database (after a migration failure for instance
server/checkintegrity.py
--- a/server/checkintegrity.py	Tue Sep 07 22:58:31 2010 +0200
+++ b/server/checkintegrity.py	Tue Sep 07 22:59:55 2010 +0200
@@ -240,7 +240,12 @@
                                 table, column, column, eid)
                             session.system_sql(sql)
             continue
-        cursor = session.system_sql('SELECT eid_from FROM %s_relation;' % rschema)
+        try:
+            cursor = session.system_sql('SELECT eid_from FROM %s_relation;' % rschema)
+        except Exception, ex:
+            # usually because table doesn't exist
+            print 'ERROR', ex
+            continue
         for row in cursor.fetchall():
             eid = row[0]
             if not has_eid(session, cursor, eid, eids):