Conditional clauses with Entity field Query
In the alter hook, you should not be calling execute(). You don't want to run the query at this point, just change it.

function mymodule_query_or_alter(QueryAlterableInterface $query) {
 $or = db_or()-&gt;condition('field_a',$term-&gt;tid)
       -&gt;condition('field_B', $term-&gt;tid);
 $query-&gt;condition($or)
}