Unfortunately REPLACE doesn't do what i need.
This code (shortened) from cursor.py (189):
m = insert_values.search(query)
p = m.start(1)
qv = query[p:]
qargs = db.literal(args)
q = [ query % qargs[0] ]
q.extend([ qv % a for a in qargs[1:] ])
duplicates "(%s,%s) ON DUPLICATE KEY..." for each inserted
record. Which is an SQL syntax error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=71372
No, I suppose it wouldn't. You ought to be able to use
REPLACE as a workaround.
Logged In: YES
user_id=1079993
Unfortunately REPLACE doesn't do what i need.
This code (shortened) from cursor.py (189):
m = insert_values.search(query)
p = m.start(1)
qv = query[p:]
qargs = db.literal(args)
q = [ query % qargs[0] ]
q.extend([ qv % a for a in qargs[1:] ])
duplicates "(%s,%s) ON DUPLICATE KEY..." for each inserted
record. Which is an SQL syntax error.
Logged In: YES
user_id=71372
Yeah, I get that.
Change this line:
insert_values = re.compile(r'\svalues\s*((.+))',
re.IGNORECASE)
to:
insert_values = re.compile(r'\svalues\s((.+))(.)',
re.IGNORECASE)
After:
add:
After:
add:
See if that fixes it.
Logged In: YES
user_id=1079993
Thanks! I'll try.
Logged In: YES
user_id=71372
Originator: NO
Believed to be fixed in 1.2.2