If any meta operations are used while an occlusion query is in progress (such as by calling glClear) then the results aren't saved and restored correctly so the final value is wrong. I posted a patch for this a while ago and I'm opening a bug so we don't forget about it.
There is also a piglit test for it which I pushed to master
I've pushed the patch.
on Feb 24, 2017 at 21:53:18.
(provided by the Example extension).