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 Mar 30, 2017 at 22:35:01.
(provided by the Example extension).