Merge "Fixed the scope of database query for testWhenByDayQuery"