reverted a wrong patch around setFlags in database result iterator