When rewriteBatchedStatement=true is set, INSERT SQL is rewritten the values in a single query and only single value of affected rows is returned. I am trying to get the ORIGINAL affected rows that server sent before the affected rows are rewritten by 1, SUCCESS_WITH_NO_INFO, or -3.
It seems if the insert statement is re-written as multiple queries instead of re-written values in one query, I am able to get the accurate update counts (correct me if I am wrong) but it won't allow under the current implementation. If insert statement doesn't contain 'insert .... select' as sub query or followed by another statement (create, update, ...), it won't set the reWritablePrepare=false in ClientPrepareResult constructor. Please inform me if I can have other way to get the affected rows (before updating them) for the bulk insert.