Issue #20464:fix multiple query problems