Issue #24866:define all target types in query