Match https://gerrit.wikimedia.org/r/88975 in QueryEngine

Change-Id: I525e7aff5313b2cfbe90fd63a279505ab6f4a397