[hooks/syncschema] do not crash on DROP of an already dropped index/... (closes #2465393) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 31 Aug 2012 13:19:39 +0200
branchstable
changeset 8533 73469aa94afe
parent 8532 28a346df670e
child 8534 6ed331fd4347
[hooks/syncschema] do not crash on DROP of an already dropped index/... (closes #2465393)
hooks/syncschema.py
--- a/hooks/syncschema.py	Thu Aug 23 11:43:43 2012 +0200
+++ b/hooks/syncschema.py	Fri Aug 31 13:19:39 2012 +0200
@@ -755,7 +755,13 @@
         cols = ['%s%s' % (prefix, c) for c in self.cols]
         sqls = dbhelper.sqls_drop_multicol_unique_index(table, cols)
         for sql in sqls:
-            session.system_sql(sql)
+            try:
+                session.system_sql(sql)
+            except Exception: # should be ProgrammingError
+                if sql.startswith('DROP'):
+                    self.critical('execute of `%s` failed', sql)
+                    continue
+                raise
 
     # XXX revertprecommit_event