Refix bug 1226 after revert

This patch properly fixes bug 1226 without introducing a breaking
change to idempotency which was introduced in PR #1358

We can properly assign permissions to databases with a '.' in the name
of the database as well as assign priviliges to all databases as
specified with '*'
pull/18777/head
Sam Yaple 9 years ago committed by Matt Clay
parent 1b34f1a7ac
commit 52d364b74c

@ -317,6 +317,11 @@ def privileges_unpack(priv):
privs = []
for item in priv.strip().split('/'):
pieces = item.strip().split(':')
dbpriv = pieces[0].rsplit(".", 1)
# Do not escape if privilege is for database '*' (all databases)
if dbpriv[0].strip('`') != '*':
pieces[0] = "`%s`.%s" % (dbpriv[0].strip('`'), dbpriv[1])
if '.' in pieces[0]:
pieces[0] = pieces[0].split('.')
for idx, piece in enumerate(pieces):

Loading…
Cancel
Save