From 2b6123e236bb9112d511e57f40da4133cac4121f Mon Sep 17 00:00:00 2001 From: Guangyang Li Date: Tue, 28 Feb 2017 14:27:16 -0500 Subject: [PATCH] Allow semicolon at the end of bulk insert query --- MySQLdb/cursors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py index 9ebf0a1..d5f3828 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -28,7 +28,7 @@ else: RE_INSERT_VALUES = re.compile( r"\s*((?:INSERT|REPLACE)\s.+\sVALUES?\s+)" + r"(\(\s*(?:%s|%\(.+\)s)\s*(?:,\s*(?:%s|%\(.+\)s)\s*)*\))" + - r"(\s*(?:ON DUPLICATE.*)?)\Z", + r"(\s*(?:ON DUPLICATE.*)?);?\s*\Z", re.IGNORECASE | re.DOTALL)