Fixed bug #4466: Index on tx_realurl_uniqalias breaks with DBAL
authorOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 19:27:45 +0000 (19:27 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 19:27:45 +0000 (19:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6463 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_sqlparser.php

index 3493d8b..5584ba7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
        * Follow-up to bugfix #12612: Removed reference operators for objects and code cleanup
        * Fixed bug #12517: Password change in User tools -> User setup impossible if rsaauth and saltedpassword are installed
        * Fixed bug #12608: User settings module reports changed password and settings if there was no change at all
+       * Fixed bug #4466: Index on tx_realurl_uniqalias breaks with DBAL (thanks to Xavier Perseguers)
 
 2009-11-17  Benjamin Mack  <benni@typo3.org>
 
index cbeb7a4..3c092b8 100644 (file)
@@ -466,7 +466,7 @@ class t3lib_sqlparser {
                                                break;
                                                case 'KEY':
                                                        if ($keyName = $this->nextPart($parseString, '^([[:alnum:]_]+)([[:space:]]+|\()'))      {
-                                                               $result['KEYS'][$keyName] = $this->getValue($parseString,'_LIST');
+                                                               $result['KEYS'][$keyName] = $this->getValue($parseString, '_LIST', 'INDEX');
                                                                if ($this->parse_error) { return $this->parse_error; }
                                                        } else return $this->parseError('No keyname found',$parseString);
                                                break;
@@ -1085,9 +1085,10 @@ class t3lib_sqlparser {
         *
         * @param       string          The parseString, eg. "(0,1,2,3) ..." or "('asdf','qwer') ..." or "1234 ..." or "'My string value here' ..."
         * @param       string          The comparator used before. If "NOT IN" or "IN" then the value is expected to be a list of values. Otherwise just an integer (un-quoted) or string (quoted)
+        * @param       string          The mode, eg. "INDEX"
         * @return      mixed           The value (string/integer). Otherwise an array with error message in first key (0)
         */
-       protected function getValue(&$parseString, $comparator = '') {
+       protected function getValue(&$parseString, $comparator = '', $mode = '') {
                $value = '';
 
                if (t3lib_div::inList('NOTIN,IN,_LIST',strtoupper(str_replace(array(' ',"\n","\r","\t"),'',$comparator))))      {       // List of values:
@@ -1097,6 +1098,10 @@ class t3lib_sqlparser {
 
                                while($comma==',')      {
                                        $listValues[] = $this->getValue($parseString);
+                                       if ($mode === 'INDEX') {
+                                                       // Remove any length restriction on INDEX definition
+                                               $this->nextPart($parseString, '^([(]\d+[)])');
+                                       }
                                        $comma = $this->nextPart($parseString,'^([,])');
                                }