# HG changeset patch # User Daniele Nicolodi # Date 1357321279 -3600 # Node ID 00cbec2d663a103aaf4aa651e7102c8b23fc1260 # Parent cbbc747949f934904fd75ea9145af4e03a92bc83 Revoke privileges on 'transactions' table on database drop. diff -r cbbc747949f9 -r 00cbec2d663a src/ltpdarepo/database.py --- a/src/ltpdarepo/database.py Thu Apr 26 19:03:39 2012 +0200 +++ b/src/ltpdarepo/database.py Fri Jan 04 18:41:19 2013 +0100 @@ -72,13 +72,15 @@ curs = g.db.cursor() # remove database from ltpda databases list - curs.execute('DELETE FROM available_dbs WHERE db_name=%s', self.id) + curs.execute("DELETE FROM available_dbs WHERE db_name=%s", self.id) # drop database - curs.execute('DROP DATABASE `%s`' % self.id) - # revoke privileges assigned for the database - curs.execute('DELETE FROM mysql.db WHERE Db=%s', self.id) + curs.execute("DROP DATABASE `%s`" % self.id) + # revoke privileges assigned on the database + curs.execute("DELETE FROM mysql.db WHERE Db=%s", self.id) + # revoke privileges assigned on the transactions table + curs.execute("DELETE FROM mysql.tables_priv WHERE Db=%s AND Table_name='transactions'", self.id) # flush privileges - curs.execute('FLUSH PRIVILEGES') + curs.execute("FLUSH PRIVILEGES") g.db.commit()