Try this:
query="""INSERT INTO table (A, B, C, D)
VALUES (%s, %s, %s, %s)
ON DUPLICATE KEY UPDATE
C= VALUES(C)
"""
Your query had 5 placeholders, but your tuples only have 4 values. You needed to duplicate C
, but the VALUES(C)
option will automatically get that from the original VALUES clause.