From 1a98095a931d82d10f0b4e66e59fed67d4848349 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 25 Mar 2011 21:46:49 +0000 Subject: [PATCH] minor improvement for that MySQL identification naming --- plugins/generic/enumeration.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 288643bf3..782682aff 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -749,6 +749,9 @@ class Enumeration: else: return tables + if Backend.getIdentifiedDbms() == DBMS.MYSQL: + conf.db = self.__safeMySQLIdentificatorNaming(conf.db) + if bruteForce: resumeAvailable = False @@ -1006,8 +1009,10 @@ class Enumeration: for columnData in value: name = columnData[0] + if Backend.getIdentifiedDbms() == DBMS.MYSQL: name = self.__safeMySQLIdentificatorNaming(name) + if len(columnData) == 1: columns[name] = "" else: @@ -1213,7 +1218,7 @@ class Enumeration: Returns an safe representation of identificator name for MySQL """ retVal = value - if isinstance(value, basestring) and any(filter(lambda x: x in value, ['-', ' '])) and '`' not in value: + if isinstance(value, basestring) and not re.match(r"\A[A-Za-z0-9]+\Z", value): retVal = "`%s`" % value return retVal