This behavior above appears when using "root" as the mysql user login (without password). When using another user the affected_rows is correctly given.
Weird! Seems this is a bug of some sort in mysql or PHP. I don't know which or how to report that to whom.