Fix defect for the function queryByLimitationOptions

Add the unit test