This is a bug in MySQLdb due to the regular expression that MySQLdb uses to parse expressions INSERT:
In /usr/lib/pymodules/python2.7/MySQLdb/cursors.py :
restr = (r"\svalues\s*"
r"(\(((?<!\\)'[^\)]*?\)[^\)]*(?<!\\)?'"
r"|[^\(\)]|"
r"(?:\([^\)]*\))"
r")+\))")
insert_values= re.compile(restr)
, , , MySQLdb 1.2.3. ( , MySQLdb - 1.2.4b4.)
, , . , - , . , , INSERT ... SELECT SELECT WHERE , ... , .
oursql; . .