fixed bug with get_affected_rows() and user defined types

If an user defined type is used get_affected_rows() returns wrong values. See modified test7() in MySQL backend for this bug.