QA-6238: Fixed query.
Removed logging.