zendframework/zend-db

Join problem in version 2.8.0

Closed this issue · 1 comments

dafap commented

For queries like
SELECT * FROM t WHERE id IN (SELECT t1.id FROM t1 INNER JOIN t2 ON t1.ref=t2.ref WHERE t2.vintage=2016)
we need JOIN that return no column.
But if we send an empty array in 3rd parameter of Zend\Db\Sql\Join::join() method, in line 136, key 'column' is assigned by [Select::SQL_STAR] and the query send 2 columns, which causes an error :
Statement could not be executed (21000 - 1241 - Operand should contain 1 column(s))

Can you remove the conditional assignment ?

dafap commented

Solution in 2.8.1