Resynchronized DBAL after fixing blocking bug #15535
authorXavier Perseguers <typo3@perseguers.ch>
Mon, 23 Aug 2010 21:26:44 +0000 (21:26 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Mon, 23 Aug 2010 21:26:44 +0000 (21:26 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8652 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php
typo3/sysext/dbal/ext_emconf.php
typo3/sysext/dbal/tests/dbOracleTest.php

index ebc2450..9a11fd4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
 
 2010-08-23  Xavier Perseguers  <typo3@perseguers.ch>
 
+       * Resynchronized DBAL after fixing blocking bug #15535
        * Raised ADOdb to version 5.11.0
        * Raised DBAL to version 1.2.0alpha1
        * Fixed bug #15528: Add unit tests for t3lib_db_PreparedStatement (thanks to Helmut Hummel)
index eb91dc4..e94c9fb 100644 (file)
@@ -1,5 +1,7 @@
 2010-08-23  Xavier Perseguers  <typo3@perseguers.ch>
 
+       * Fixed bug #15535: Error: No pages are found on the rootlevel! in Frontend when using Oracle
+       * Updated ADOdb version dependency
        * Set version to 1.2.0alpha1
 
 2010-08-19  Xavier Perseguers  <typo3@perseguers.ch>
index 34d66c2..2ef1bfc 100644 (file)
@@ -29,7 +29,7 @@
 /**
  * PHP SQL engine
  *
- * $Id: class.ux_t3lib_sqlparser.php 36759 2010-08-14 15:55:24Z xperseguers $
+ * $Id: class.ux_t3lib_sqlparser.php 37143 2010-08-23 21:13:44Z xperseguers $
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  * @author     Karsten Dambekalns <k.dambekalns@fishfarm.de>
@@ -491,7 +491,7 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                $output .= ', ' . $v['func']['default'][1] . $this->compileAddslashes($v['func']['default'][0]) . $v['func']['default'][1];
                                                                $output .= ')';
                                                        } elseif (isset($v['func']) && $v['func']['type'] === 'FIND_IN_SET') {
-                                                               $output = ' ' . trim($v['modifier']) . ' ';
+                                                               $output .= ' ' . trim($v['modifier']) . ' ';
                                                                if ($functionMapping) {
                                                                        switch (TRUE) {
                                                                                case ($GLOBALS['TYPO3_DB']->runningADOdbDriver('mssql')):
@@ -643,7 +643,7 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                                $output .= ' ' . $v['comparator'];
 
                                                                                        // Detecting value type; list or plain:
-                                                                               if (t3lib_div::inList('NOTIN,IN', strtoupper(str_replace(array(' ', "\t", "\r", "\n"), '', $v['comparator'])))) {
+                                                                               if (t3lib_div::inList('NOTIN,IN', strtoupper(str_replace(array(' ', TAB, CR, LF), '', $v['comparator'])))) {
                                                                                        if (isset($v['subquery'])) {
                                                                                                $output .= ' (' . $this->compileSELECT($v['subquery']) . ')';
                                                                                        } else {
@@ -653,6 +653,12 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                                                }
                                                                                                $output .= ' (' . trim(implode(',', $valueBuffer)) . ')';
                                                                                        }
+                                                                               } else if (t3lib_div::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
+                                                                                       $lbound = $v['values'][0];
+                                                                                       $ubound = $v['values'][1];
+                                                                                       $output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
+                                                                                       $output .= ' AND ';
+                                                                                       $output .= $ubound[1] . $this->compileAddslashes($ubound[0]) . $ubound[1];
                                                                                } else if (isset($v['value']['operator'])) {
                                                                                        $values = array();
                                                                                        foreach ($v['value']['args'] as $fieldDef) {
index 85af6ed..7d66f8d 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "dbal".
 #
-# Auto generated 23-08-2010 15:51
+# Auto generated 23-08-2010 23:15
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -33,12 +33,12 @@ $EM_CONF[$_EXTKEY] = array(
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
        'version' => '1.2.0alpha1',
-       '_md5_values_when_last_written' => 'a:42:{s:9:"ChangeLog";s:4:"0ba7";s:28:"class.tx_dbal_autoloader.php";s:4:"8cd0";s:29:"class.tx_dbal_installtool.php";s:4:"29b5";s:26:"class.ux_db_list_extra.php";s:4:"60d9";s:21:"class.ux_t3lib_db.php";s:4:"6801";s:28:"class.ux_t3lib_sqlparser.php";s:4:"586b";s:16:"ext_autoload.php";s:4:"bd13";s:21:"ext_conf_template.txt";s:4:"f5cf";s:12:"ext_icon.gif";s:4:"c9ba";s:17:"ext_localconf.php";s:4:"5ece";s:14:"ext_tables.php";s:4:"b187";s:14:"ext_tables.sql";s:4:"1f95";s:27:"doc/class.tslib_fe.php.diff";s:4:"0083";s:14:"doc/manual.sxw";s:4:"57b6";s:45:"handlers/class.tx_dbal_handler_openoffice.php";s:4:"8556";s:43:"handlers/class.tx_dbal_handler_rawmysql.php";s:4:"ef52";s:40:"handlers/class.tx_dbal_handler_xmldb.php";s:4:"3ec1";s:31:"lib/class.tx_dbal_sqlengine.php";s:4:"75be";s:33:"lib/class.tx_dbal_tsparserext.php";s:4:"df12";s:14:"mod1/clear.gif";s:4:"cc11";s:13:"mod1/conf.php";s:4:"6e63";s:14:"mod1/index.php";s:4:"4a5e";s:18:"mod1/locallang.xml";s:4:"0b57";s:22:"mod1/locallang_mod.xml";s:4:"86ef";s:19:"mod1/moduleicon.gif";s:4:"2b8f";s:10:"res/README";s:4:"be19";s:26:"res/Templates/install.html";s:4:"62c9";s:30:"res/oracle/indexed_search.diff";s:4:"ec81";s:23:"res/oracle/realurl.diff";s:4:"86da";s:25:"res/oracle/scheduler.diff";s:4:"7c06";s:27:"res/oracle/templavoila.diff";s:4:"1fd5";s:43:"res/postgresql/postgresql-compatibility.sql";s:4:"bbff";s:22:"tests/BaseTestCase.php";s:4:"33db";s:26:"tests/FakeDbConnection.php";s:4:"cf49";s:23:"tests/dbGeneralTest.php";s:4:"dba5";s:21:"tests/dbMssqlTest.php";s:4:"a0f3";s:22:"tests/dbOracleTest.php";s:4:"2ff5";s:26:"tests/dbPostgresqlTest.php";s:4:"2f3f";s:30:"tests/sqlParserGeneralTest.php";s:4:"74b4";s:31:"tests/fixtures/mssql.config.php";s:4:"0e31";s:30:"tests/fixtures/oci8.config.php";s:4:"6c8a";s:36:"tests/fixtures/postgresql.config.php";s:4:"f13a";}',
+       '_md5_values_when_last_written' => 'a:42:{s:9:"ChangeLog";s:4:"4c7f";s:28:"class.tx_dbal_autoloader.php";s:4:"8cd0";s:29:"class.tx_dbal_installtool.php";s:4:"29b5";s:26:"class.ux_db_list_extra.php";s:4:"60d9";s:21:"class.ux_t3lib_db.php";s:4:"6801";s:28:"class.ux_t3lib_sqlparser.php";s:4:"5ca0";s:16:"ext_autoload.php";s:4:"bd13";s:21:"ext_conf_template.txt";s:4:"f5cf";s:12:"ext_icon.gif";s:4:"c9ba";s:17:"ext_localconf.php";s:4:"5ece";s:14:"ext_tables.php";s:4:"b187";s:14:"ext_tables.sql";s:4:"1f95";s:27:"doc/class.tslib_fe.php.diff";s:4:"0083";s:14:"doc/manual.sxw";s:4:"57b6";s:45:"handlers/class.tx_dbal_handler_openoffice.php";s:4:"8556";s:43:"handlers/class.tx_dbal_handler_rawmysql.php";s:4:"ef52";s:40:"handlers/class.tx_dbal_handler_xmldb.php";s:4:"3ec1";s:31:"lib/class.tx_dbal_sqlengine.php";s:4:"75be";s:33:"lib/class.tx_dbal_tsparserext.php";s:4:"df12";s:14:"mod1/clear.gif";s:4:"cc11";s:13:"mod1/conf.php";s:4:"6e63";s:14:"mod1/index.php";s:4:"4a5e";s:18:"mod1/locallang.xml";s:4:"0b57";s:22:"mod1/locallang_mod.xml";s:4:"86ef";s:19:"mod1/moduleicon.gif";s:4:"2b8f";s:10:"res/README";s:4:"be19";s:26:"res/Templates/install.html";s:4:"62c9";s:30:"res/oracle/indexed_search.diff";s:4:"ec81";s:23:"res/oracle/realurl.diff";s:4:"86da";s:25:"res/oracle/scheduler.diff";s:4:"7c06";s:27:"res/oracle/templavoila.diff";s:4:"1fd5";s:43:"res/postgresql/postgresql-compatibility.sql";s:4:"bbff";s:22:"tests/BaseTestCase.php";s:4:"33db";s:26:"tests/FakeDbConnection.php";s:4:"cf49";s:23:"tests/dbGeneralTest.php";s:4:"dba5";s:21:"tests/dbMssqlTest.php";s:4:"a0f3";s:22:"tests/dbOracleTest.php";s:4:"91ae";s:26:"tests/dbPostgresqlTest.php";s:4:"2f3f";s:30:"tests/sqlParserGeneralTest.php";s:4:"74b4";s:31:"tests/fixtures/mssql.config.php";s:4:"0e31";s:30:"tests/fixtures/oci8.config.php";s:4:"6c8a";s:36:"tests/fixtures/postgresql.config.php";s:4:"f13a";}',
        'constraints' => array(
                'depends' => array(
-                       'adodb' => '5.10.0-',
+                       'adodb' => '5.11.0-',
                        'php' => '5.2.0-0.0.0',
-                       'typo3' => '4.4.0beta1-0.0.0',
+                       'typo3' => '4.5.0alpha1-0.0.0',
                ),
                'conflicts' => array(
                ),
index a61309a..5d5c924 100644 (file)
@@ -208,6 +208,27 @@ class dbOracleTest extends BaseTestCase {
                }
        }
 
+       /**
+        * @test
+        * @see http://bugs.typo3.org/view.php?id=15535
+        */
+       public function groupConditionsAreProperlyTransformed() {
+               $query = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery(
+                       '*',
+                       'pages',
+                       'pid=0 AND pages.deleted=0 AND pages.hidden=0 AND pages.starttime<=1281620460 '
+                       . 'AND (pages.endtime=0 OR pages.endtime>1281620460) AND NOT pages.t3ver_state>0 '
+                       . 'AND pages.doktype<200 AND (pages.fe_group=\'\' OR pages.fe_group IS NULL OR '
+                       . 'pages.fe_group=\'0\' OR FIND_IN_SET(\'0\',pages.fe_group) OR FIND_IN_SET(\'-1\',pages.fe_group))'
+               ));
+               $expected = 'SELECT * FROM "pages" WHERE "pid" = 0 AND "pages"."deleted" = 0 AND "pages"."hidden" = 0 '
+                       . 'AND "pages"."starttime" <= 1281620460 AND ("pages"."endtime" = 0 OR "pages"."endtime" > 1281620460) '
+                       . 'AND NOT "pages"."t3ver_state" > 0 AND "pages"."doktype" < 200 AND ("pages"."fe_group" = \'\' '
+                       . 'OR "pages"."fe_group" IS NULL OR "pages"."fe_group" = \'0\' OR \',\'||"pages"."fe_group"||\',\' LIKE \'%,0,%\' '
+                       . 'OR \',\'||"pages"."fe_group"||\',\' LIKE \'%,-1,%\')';
+               $this->assertEquals($expected, $query);
+       }
+
        ///////////////////////////////////////
        // Tests concerning quoting
        ///////////////////////////////////////