Project

General

Profile

Actions

Bug #20137

closed

DBAL where clauses not handled correctly

Added by Mangan about 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-03-06
Due date:
% Done:

0%

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

Description

When you have something like

marks.CONTENT = CONTENT
marks.CONTENT.table = tt_content
marks.CONTENT.select {
pidInList = this
orderBy = sorting
where = colPos=0
andWhere = header <> ''
languageField = sys_language_uid
}

it works with MySQL but not with DBAL. I guess that the SQL parameters are not passed correctly. I don't get any syntax working.

DBAL keeps telling me

Warning: Invalid argument supplied for foreach() in /cms/typo3conf/ext/dbal/class.ux_t3lib_db.php on line 966

Any ideas how to use more complex SQL queries with dbal?

(issue imported from #M10620)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #17554: Problem with strings in INClosed2007-08-22

Actions
Actions #1

Updated by Mangan about 15 years ago

things like andWhere = CType IS IN LIST ('html','text') don't work either

Actions #2

Updated by Ries van Twisk over 14 years ago

I did a quick test on my site using the following code:

page.20 = CONTENT
page.20.table = tt_content
page.20.select {
pidInList = this
orderBy = sorting
where = colPos=0
andWhere = header <> ''
languageField = sys_language_uid
}

And this give the expended result, no error and some data on the website.
This was tested with DBAL from SVN.

Ries

Actions #3

Updated by Xavier Perseguers over 14 years ago

Hi,

I confirm that I could not reproduce the issue as stated in the description with DBAL-trunk. SQL parser has been much improved lately and as such, the problem seems to have been solved automatically.

In your note from 06.03.09, you say that

andWhere = CType IS IN LIST

does not work either. This should be

andWhere = CType IN ('html', 'text')

I did not tested this andWhere clause but I fixed IN keyword support recently and as such it should work as well. I will test this case and if it works set this bug to resolved without any change needed.

Actions #4

Updated by Ries van Twisk over 14 years ago

Xavier,

the given IN clause by Mangan was indeed correct, however I think the most important part was teh first item and that is solved now.

Ries

Actions #5

Updated by Xavier Perseguers over 14 years ago

Well, I don't see any "IS IN LIST" operator on
http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html

Anyway, using

andWhere = CType IN ('html', 'text')

is supported, I just tested it. Gonna close this bug.

Actions

Also available in: Atom PDF