From 103a00d4ee598c240b0e2eaa30f085b98b450392 Mon Sep 17 00:00:00 2001 From: Guangyang Li Date: Tue, 28 Feb 2017 04:54:17 -0500 Subject: [PATCH] Allow semicolon at the end of bulk insert query (#545) --- pymysql/cursors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymysql/cursors.py b/pymysql/cursors.py index 4128453..dc3ce1e 100644 --- a/pymysql/cursors.py +++ b/pymysql/cursors.py @@ -14,7 +14,7 @@ from . import err 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)