From 6810fe0cbf7ca00790d7f361b5d2451b4507a362 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 9ebf0a14..d5f38285 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -28,7 +28,7 @@ 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)