diff options
-rw-r--r-- | MySQLdb/MySQLdb/cursors.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/MySQLdb/MySQLdb/cursors.py b/MySQLdb/MySQLdb/cursors.py index ffe60c0..a8cfa3e 100644 --- a/MySQLdb/MySQLdb/cursors.py +++ b/MySQLdb/MySQLdb/cursors.py @@ -15,13 +15,32 @@ except ImportError: TupleType = tuple UnicodeType = str -restr = (r"\svalues\s*" - r"(\(((?<!\\)'[^\)]*?\)[^\)]*(?<!\\)?'" - r"|[^\(\)]|" - r"(?:\([^\)]*\))" - r")+\))") +restr = r""" + \s + values + \s* + ( + \( + [^()']* + (?: + (?: + (?:\( + # ( - editor hightlighting helper + [^)]* + \)) + | + ' + [^\\']* + (?:\\.[^\\']*)* + ' + ) + [^()']* + )* + \) + ) +""" -insert_values = re.compile(restr, re.I) +insert_values = re.compile(restr, re.S | re.I | re.X) from _mysql_exceptions import Warning, Error, InterfaceError, DataError, \ DatabaseError, OperationalError, IntegrityError, InternalError, \ |