Bug #17554
closedProblem with strings in IN
0%
Description
I've a problem with DAM and PostgreSQL (DBAL)
---
LOG: statement: SELECT COUNT as "count"
FROM "tx_dam"
WHERE
1 = 1 AND "tx_dam"."pid" IN (1) AND "tx_dam"."file_type" IN ("gif","png","jpg","jpeg") AND (
"tx_dam"."file_path" LIKE 'fileadmin/weeaar/images/pictures/%') AND "tx_dam"."deleted" = 0
ERROR: column "gif" does not exist
The IN ("gif","png","jpg","jpeg") is qouted wrong. It should be IN ('gif', 'png', 'jpg', 'jpeg').
Marcel
(issue imported from #M6198)
Updated by Martin Kutschker over 16 years ago
You're right. But where does the quoting come from? Are you sure it's DBAL and not the DAM which adds the wrong quotes? Please, file a bug for DAM as well.
Updated by Xavier Perseguers about 15 years ago
Hi,
Is this still true? I mean, I don't use DAM with DBAL but according to code I fixed today for bug #12231, I guess it's not impossible that the quoting is a problem from DBAL.
Please confirm before I take time to investigate and provide a fix if needed.
Thanks.
Updated by Xavier Perseguers about 15 years ago
After a bit investigation with Oracle, if the original query (coming from DAM) contains double quotes for the IN strings, they are kept as-this, but if the strings are properly quoted (single quote), the generated query contains single quotes too, which is valid
Updated by Xavier Perseguers about 15 years ago
Unit tests in DBAL-trunk show that mapping is done the right way for strings within an IN clause. Problem with double quotes instead of single quotes has been fixed in latest version of DAM by using $GLOBALS['TYPO3_DB']->fullQuoteArray() instead of hard-coding quotes.