web2py/web2py — pull request #497 by jotbe (2014-09-13 00:27:56+00:00)
Title: Fixed #1810: DAL.select(left=...) causes "Unknown column 't1.i1' in 'on ...

...clause'"

According to the MySQL 5.5 manual [1], comma-separated table references in joins
should be wrapped in parenthesis or JOIN should be used instead of comma.

Further explanation from the manual: The ON clause takes precedence since
a couple of versions so the operands for the ON clause change:

SELECT * FROM t1, t2 JOIN t3 ON (t1.i1 = t3.i3);

The operands for the ON are t2 and t3. t1.i1 is not known at this point.

[1] https://dev.mysql.com/doc/refman/5.5/en/join.html