Minor bug fixes to --privileges for PostgreSQL query (corner case)

This commit is contained in:
Bernardo Damele 2011-03-11 14:54:41 +00:00
parent 1879a49506
commit 74ef1e53c7
2 changed files with 3 additions and 3 deletions

View File

@ -389,7 +389,7 @@ class Agent:
fieldsToCastStr = fieldsNoSelect
# Function
if re.search("\A\w+\(.*\)", fieldsToCastStr, re.I) or fieldsSelectCase or fieldsSubstr:
if re.search("\A\w+\(.*\)", fieldsToCastStr, re.I) or (fieldsSelectCase and "WHEN use" not in query) or fieldsSubstr:
fieldsToCastList = [fieldsToCastStr]
else:
fieldsToCastList = fieldsToCastStr.replace(", ", ",")

View File

@ -587,7 +587,7 @@ class Enumeration:
for priv in privs:
if priv.isdigit() and int(priv) == 1:
for position, pgsqlPriv in pgsqlPrivs:
for position, pgsqlPriv in pgsqlPrivs.items():
if position == i:
privileges.add(pgsqlPriv)
@ -607,7 +607,7 @@ class Enumeration:
for priv in privs:
if priv.upper() == "Y":
for position, mysqlPriv in mysqlPrivs:
for position, mysqlPriv in mysqlPrivs.items():
if position == i:
privileges.add(mysqlPriv)