fixed wrong generated sql by filter CDB-2860