1 (edited by normalize.pro 2015-07-18 07:36)

Topic: SQL queries issue (WHERE id= vs WHERE t.id=)

Table names in FROMs and JOINs are aliased with "AS" statement in all the queries.
On the other hand, in WHEREs we have a plenty of unaliased clauses like id=some_condition (vs t.id=some_condition, where t is a table alias).

The problem is in high probability of column name indetermination when we trying to patch the query with a hook to join some extra tables. As a result we have a broken query to "debug".

Of cause we can "rewrite" the WHERE statement with aliased conditions in the same hook or patch the php code in place. But i think it's better to get all of WHEREs aliased out of the box.