[TYPO3-ttnews] Category select SQL and DBAL

Rupert Germann rupi at gmx.li
Wed Nov 25 17:08:03 CET 2009


hi,

I'm currently working on the DBAL compatibility of tt_news and managed 
to get it to work on postgres8.

Besides the already committed "Distinct" patch and the caching problems 
patch:
http://bugs.typo3.org/view.php?id=12453
http://bugs.typo3.org/view.php?id=12756

there is the evil "IFNULL" in the query which leads to "query could not 
be parsed" when listing news from a selected category.

while looking deeper at the concerned queries, I started to ask myself: 
for what exactly is this IFNULL statement used?

I tried what happens if I remove it by changing:

... AND (IFNULL(tt_news_cat_mm.uid_foreign,0) IN (selectedCategories)

to

... AND (tt_news_cat_mm.uid_foreign IN (selectedCategories)

and all seems to work as before:
selecting news by categories with AND/OR
deselecting news by categories with AND/OR
and also "show only non categorized"

Can this be? or did I overlook something?

please test the attached patch mainly on non-DBAL systems. If this works 
we are a big step further on the way to dbal compatibility.

bugtracker:
http://bugs.typo3.org/view.php?id=12757


greets
rupert



More information about the TYPO3-project-tt-news mailing list