Add an index prefix to Mysql key definitions when (var)chars are changed to text...
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Thu, 16 Nov 2006 21:33:17 +0000 (21:33 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Thu, 16 Nov 2006 21:33:17 +0000 (21:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1794 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_install.php
t3lib/stddb/tables.sql

index 6c53713..922b0b3 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2006-11-16  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * Added freeIndexSetId GROUP BY in tx_indexedsearch->execFinalQuery() to make SELECT work on DBs other than Mysql
+       * Add an index prefix to Mysql key definitions when (var)chars are changed to text when multiplyDBfieldSize is set
+       * Reverted change to key of sys_refindex on 2006-09-01 (key prefix is set now automatically)
 
 2006-11-13  Bernhard Kraft  <kraftb@kraftb.at>
 
index 2ac5cc0..0f16d91 100755 (executable)
@@ -388,6 +388,19 @@ class t3lib_install {
                                                                                        )
                                                                                )
                                                                        );
+                                                                               // Change key definition if necessary (must use "prefix" on TEXT columns)
+                                                                       foreach ($cfg['keys'] as $kN => $kType) {
+                                                                               $match = array();
+                                                                               preg_match('/^([^(]*)\(([^)]+)\)(.*)/', $kType, $match);
+                                                                               $keys = array();
+                                                                               foreach (t3lib_div::trimExplode(',',$match[2]) as $kfN) {
+                                                                                       if ($fN == $kfN)        {
+                                                                                               $kfN .= '('.$newSize.')';
+                                                                                       }
+                                                                                       $keys[] = $kfN;
+                                                                               }
+                                                                               $total[$table]['keys'][$kN] = $match[1].'('.join(',',$keys).')'.$match[3];
+                                                                       }
                                                                }
                                                        break;
                                                        case 'tinytext':
index 673f5c8..1a14140 100755 (executable)
@@ -285,7 +285,7 @@ CREATE TABLE sys_refindex (
   PRIMARY KEY (hash),
   KEY lookup_rec (tablename,recuid),
   KEY lookup_uid (ref_table,ref_uid),
-  KEY lookup_string (ref_table,ref_string(199))
+  KEY lookup_string (ref_table,ref_string)
 );
 
 #