Project

General

Profile

Actions

Bug #17554

closed

Problem with strings in IN

Added by Marcel Alburg over 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2007-08-22
Due date:
% Done:

0%

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

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)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #20137: DBAL where clauses not handled correctlyClosedXavier Perseguers2009-03-06

Actions
Actions #1

Updated by Martin Kutschker about 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.

Actions #2

Updated by Xavier Perseguers over 14 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.

Actions #3

Updated by Xavier Perseguers over 14 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

Actions #4

Updated by Xavier Perseguers over 14 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.

Actions

Also available in: Atom PDF