Do real SQL

I few days ago I helped a friend making his Mambo installation fully operational under MySQL 5 again. Everything worked out of the box, except the php_shop module/plugin/whatever. It could the the categries, but refused to list any products.

Thanks to the lacking ORM i spent 10min of searching&grepping until I found the SQL that is responsible for getting the products. And there was a Join which operated on Attributes that belonged to tables other than the ones to Join. It seems that this was some kind of trick which apparently worked in MySQL 4.