[db-check] fix sql to fix bad eid referenced by inlined relation stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Sep 2009 08:16:06 +0200
branchstable
changeset 3374 d5bd1b659ce8
parent 3372 26b89dfe4170
child 3375 ebb11fa58ab9
child 3437 a30b5b5138a4
[db-check] fix sql to fix bad eid referenced by inlined relation
server/checkintegrity.py
--- a/server/checkintegrity.py	Tue Sep 22 18:59:00 2009 +0200
+++ b/server/checkintegrity.py	Wed Sep 23 08:16:06 2009 +0200
@@ -211,8 +211,8 @@
                     if not has_eid(cursor, eid, eids):
                         bad_related_msg(rschema, 'object', eid, fix)
                         if fix:
-                            sql = 'UPDATE %s SET %s = NULL WHERE %seid=%s;' % (
-                                table, column, SQL_PREFIX, eid)
+                            sql = 'UPDATE %s SET %s=NULL WHERE %s=%s;' % (
+                                table, column, column, eid)
                             session.system_sql(sql)
             continue
         cursor = session.system_sql('SELECT eid_from FROM %s_relation;' % rschema)