When using in mysql insert..on duplicate, what happens to the rest of the columns that are not being updated? Do they remain the same? I don’t want to erase the rest of the data, only need to make sure certain rows are there (and if they are not, then update them).
I believe that I should not be using replace, which does replace the entire row.
See also this question.
Correct. When using
INSERT..ON DUPLICATE UPDATE, if the INSERT fails, only the fields explicitly stated in the UPDATE clause are updated. The rest of the fields remain unchanged.