Avoid "There is no query" Exception for Materialized Views with Joins or Subqueries
Official CH changelog text
Avoid "There is no query" exception for materialized views with joins or with subqueries attached to system logs (system.query_log, metric_log, etc) or to engine=Buffer underlying table. #12120 (filimonov).