Unit test and fix for DDC-2506: CTI JOIN WITH conditionals failing.

http://www.doctrine-project.org/jira/browse/DDC-2506