Project

General

Profile

Actions

Bug #15487

closed

exec_SELECT_mm_query -> whereClause is added without an 'AND'

Added by Wolfgang Neider almost 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-01-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

Actions #1

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.

Actions #2

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.

Actions #3

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!
Actions #4

Updated by Wolfgang Klinger over 18 years ago

comment added in CVS

Actions

Also available in: Atom PDF