Bug #17552
closedIFNULL operator cannot be parsed
0%
Description
Hello,
i wanna use IrFAQ with DBAL and PostgreSQL. PostGresql dont use IFNULL and because of that, i changed that to COALESCE.
But now, i've a error (the same error like with IFNULL).
SQL engine parse ERROR: No field name found as expected in parseWhereClause(): near "COALESCE = 1) AND"
i've the version von svn.
Marcel
(issue imported from #M6196)
Files
Updated by Martin Kutschker about 17 years ago
DBAL supports only a limited set of SQL-functions.
But for your case it should IMHO provide a utility method to creates a) the IFNULL-equivalent for the DB (I think ADOdb has such a function) and b) support of course this function when parsing the query.
Updated by Xavier Perseguers almost 15 years ago
Taking information from duplicated bug:
When using tt_news and choosing to restrict the list of news with a set of news categories, FE rendering crashes with:
Could not parse where clause in /path/to/dbal/class.ux_t3lib_db.php : 1072
This is due by tt_news which issues this kind of query:
1=1 AND (IFNULL IN (21,22)) AND tt_news.sys_language_uid IN (0,-1) AND tt_news.pid > 0 AND tt_news.pid IN (61) AND tt_news.deleted=0 AND tt_news.t3ver_state<=0 AND tt_news.hidden=0 AND tt_news.starttime<=1266057900 AND (tt_news.endtime=0 OR tt_news.endtime>1266057900) AND (tt_news.fe_group='' OR tt_news.fe_group IS NULL OR tt_news.fe_group='0' OR (tt_news.fe_group LIKE '%,0,%' OR tt_news.fe_group LIKE '0,%' OR tt_news.fe_group LIKE '%,0' OR tt_news.fe_group='0') OR (tt_news.fe_group LIKE '%,-1,%' OR tt_news.fe_group LIKE '-1,%' OR tt_news.fe_group LIKE '%,-1' OR tt_news.fe_group='-1'))
Problem is the IFNULL which cannot be parsed ATM.
Updated by Xavier Perseguers almost 15 years ago
- Oracle equivalent is NVL : http://www.techonthenet.com/oracle/functions/nvl.php [^]
- MSSQL is ISNULL : http://msdn.microsoft.com/fr-fr/library/ms184325.aspx
- PostgreSQL would use COALESCE or a user-defined function mapping IFNULL to COALESCE as we usually do with PostgreSQL
Updated by Xavier Perseguers almost 15 years ago
Core trunk (rev. 6899) and DBAL trunk (rev. 29977)