Issue #24395:tweak query