#638702 by jhodgdon: fix issues where the return value of db_affected_rows() was not properly considered