felixge/node-mysql — pull request #237 by ichernev (2012-07-02 16:43:02+00:00)
Title: ON DUPLICATE KEY UPDATE produces wrong affectedRows

When you insert with on duplicate key update affected rows should be
* 0 when both the key is the same, and the update statement doesn't change anything
* 1 when the key differs, so a row is inserted
* 2 when the key is the same, and the row is updated

The first case produces affected rows == 0 in the mysql console, and 1 in node_mysql.
I also wrote a test for it. I'm using

% mysql --version
mysql Ver 14.14 Distrib 5.5.24, for Linux (x86_64) using readline 5.1