Bug #15487
closedexec_SELECT_mm_query -> whereClause is added without an 'AND'
0%
Description
The "whereClause" for the exec_SELECT_mm_query is added in the function without an 'AND'. So mysql produces an error because there are already "where"-statements associating the local and the foreign table.
Select produced from exec_SELECT_mm_query with where-clause
SELECT tx_iflowgallery_description.filename,
tx_iflowgallery_description.image_description, tx_iflowgallery_imagecategories.catname
FROM tx_iflowgallery_description,tx_iflowgallery_description_catname_mm,tx_iflowgallery_imagecategories
WHERE
tx_iflowgallery_description.uid=tx_iflowgallery_description_catname_mm.uid_local AND tx_iflowgallery_imagecategories.uid=tx_iflowgallery_description_catname_mm.uid_foreign tx_iflowgallery_description.filename='Blaue Berge.jpg' tx_iflowgallery_imagecategories.catname='Normal'
(issue imported from #M2364)
Updated by Wolfgang Klinger over 18 years ago
If we add the AND now this may cause problems as everybody excepts to add AND currently himself to make it work.
Updated by Oliver Klee over 18 years ago
Actually, the documentation says that the the parameter is an additional WHERE clause that gets appended. In other words, it doesn't say that the AND is automatically added.
I propose leaving the code as is (also to not break API compatibility), but to add a comment to the @param saying that the AND (without a space prefix) must be part of the parameter.
Updated by Wolfgang Klinger over 18 years ago
That's what I meant.
I'll submit this description:
- @param string Optional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->fullQuoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT! You have to prepend 'AND ' to this parameter yourself!