[c-c delete] add quote on db drop statement to be more robust to exotic database names stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 20 Jan 2011 17:14:28 +0100
branchstable
changeset 6863 2e52db5cdbde
parent 6862 8bee6dfdbe96
child 6864 ea95004494a2
[c-c delete] add quote on db drop statement to be more robust to exotic database names
server/serverctl.py
--- a/server/serverctl.py	Thu Jan 20 16:45:21 2011 +0100
+++ b/server/serverctl.py	Thu Jan 20 17:14:28 2011 +0100
@@ -207,7 +207,7 @@
             cnx = _db_sys_cnx(source, 'DROP DATABASE', user=user)
             cursor = cnx.cursor()
             try:
-                cursor.execute('DROP DATABASE %s' % dbname)
+                cursor.execute('DROP DATABASE "%s"' % dbname)
                 print '-> database %s dropped.' % dbname
                 # XXX should check we are not connected as user
                 if user and helper.users_support and \