Topic: MySQL "INNER JOIN" change in 5.0.12

MySQL syntax for joins mixed with commas has changed.  See http://bugs.mysql.com/bug.php?id=15823.

This affects ui_lists.inc, that I've found so far, and can be fixed by surrounding the comma-separated fields with parenthesis.  For example, in function gl_all_accounts_list on line 1381, change

FROM ".TB_PREF."chart_master,".TB_PREF."chart_types LEFT JOIN ".TB_PREF."bank_accounts ON ".TB_PREF."chart_master.account_code=".TB_PREF."bank_accounts.account_code

to

FROM (".TB_PREF."chart_master,".TB_PREF."chart_types) LEFT JOIN ".TB_PREF."bank_accounts ON ".TB_PREF."chart_master.account_code=".TB_PREF."bank_accounts.account_code

Re: MySQL "INNER JOIN" change in 5.0.12

Thanks leeg,

for pointing this out. The bug is fixed in the CVS. For those affected, please check out the new revision of /frontaccount/includes/ui/ui_lists.inc.

Regards
Admin

Re: MySQL "INNER JOIN" change in 5.0.12

Are there any more such constructs in FA now (function is now at line 1613)? In such cases, do the referred corresponding fields in the tables within those in the parantheses get automagically equated?

In this case, the WHERE clause states:

chart.account_code=acc.account_code

should it be

chart.account_code=acc.account_code AND chart.account_code=type.account_code

instead?