Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c33baf

Browse filesBrowse files
André Malofarcepest
authored andcommitted
Patch 2/4: executemany-regex improvement. It should match better and faster now. It also may be more readable.
https://sourceforge.net/p/mysql-python/patches/78/
1 parent a7f55a5 commit 1c33baf
Copy full SHA for 1c33baf

File tree

Expand file treeCollapse file tree

1 file changed

+25
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+25
-6
lines changed

‎MySQLdb/MySQLdb/cursors.py

Copy file name to clipboardExpand all lines: MySQLdb/MySQLdb/cursors.py
+25-6Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,32 @@
1515
TupleType = tuple
1616
UnicodeType = str
1717

18-
restr = (r"\svalues\s*"
19-
r"(\(((?<!\\)'[^\)]*?\)[^\)]*(?<!\\)?'"
20-
r"|[^\(\)]|"
21-
r"(?:\([^\)]*\))"
22-
r")+\))")
18+
restr = r"""
19+
\s
20+
values
21+
\s*
22+
(
23+
\(
24+
[^()']*
25+
(?:
26+
(?:
27+
(?:\(
28+
# ( - editor hightlighting helper
29+
[^)]*
30+
\))
31+
|
32+
'
33+
[^\\']*
34+
(?:\\.[^\\']*)*
35+
'
36+
)
37+
[^()']*
38+
)*
39+
\)
40+
)
41+
"""
2342

24-
insert_values = re.compile(restr, re.I)
43+
insert_values = re.compile(restr, re.S | re.I | re.X)
2544

2645
from _mysql_exceptions import Warning, Error, InterfaceError, DataError, \
2746
DatabaseError, OperationalError, IntegrityError, InternalError, \

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.