Fixed bug #6196: IFNULL operator cannot be parsed
[Packages/TYPO3.CMS.git] / typo3 / sysext / dbal / tests / db_oracle_testcase.php
index 074847f..865dde5 100644 (file)
@@ -781,5 +781,19 @@ class db_oracle_testcase extends BaseTestCase {
                $expected = 'SELECT *, CASE WHEN INSTR("datastructure", \'(fce)\', 4) > 0 THEN 2 ELSE 1 END AS "scope" FROM "tx_templavoila_tmplobj" WHERE 1 = 1';
                $this->assertEquals($expected, $query);
        }
+
+       /**
+        * @test
+        * @see http://bugs.typo3.org/view.php?id=6196
+        */
+       public function IfNullIsProperlyRemapped() {
+               $query = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery(
+                       '*',
+                       'tt_news_cat_mm',
+                       'IFNULL(tt_news_cat_mm.uid_foreign,0) IN (21,22)'
+               ));
+               $expected = 'SELECT * FROM "tt_news_cat_mm" WHERE NVL("tt_news_cat_mm"."uid_foreign", 0) IN (21,22)';
+               $this->assertEquals($expected, $query);
+       }
 }
 ?>
\ No newline at end of file