Author: acydburn
Date: Wed Aug 5 15:50:39 2009
New Revision: 9930
Log:
Fix Bug #46285 (drop index patch by Paul) - i hope the re-addition of the FULLTEXT index works. :o
If someone wants to try? :)
Modified:
branches/phpBB-3_0_0/phpBB/develop/mysql_upgrader.php
Modified: branches/phpBB-3_0_0/phpBB/develop/mysql_upgrader.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/develop/mysql_upgrader.php (original)
--- branches/phpBB-3_0_0/phpBB/develop/mysql_upgrader.php Wed Aug 5 15:50:39 2009
***************
*** 40,52 ****
$db->sql_freeresult($result);
! $mysql_indexer = false;
if (strtolower($row['Type']) === 'mediumtext')
{
$mysql_indexer = true;
}
echo "USE $dbname;$newline$newline";
--- 40,57 ----
$db->sql_freeresult($result);
! $mysql_indexer = $drop_index = false;
if (strtolower($row['Type']) === 'mediumtext')
{
$mysql_indexer = true;
}
+ if (strtolower($row['Key']) === 'mul')
+ {
+ $drop_index = true;
+ }
+
echo "USE $dbname;$newline$newline";
***************
*** 124,129 ****
--- 129,141 ----
// Create Table statement
$generator = $textimage = false;
+ // Do we need to DROP a fulltext index before we alter the table?
+ if ($table_name == ($prefix . 'posts') && $drop_index)
+ {
+ echo "ALTER TABLE {$table_name}{$newline}";
+ echo "DROP INDEX post_text,{$newline}DROP INDEX post_subject,{$newline}DROP INDEX post_content;{$newline}{$newline}";
+ }
+
$line = "ALTER TABLE {$table_name} $newline";
// Table specific so we don't get overlap
***************
*** 236,241 ****
--- 248,259 ----
$line .= "\tDEFAULT CHARSET=utf8 COLLATE=utf8_bin;$newline$newline";
echo $line . "$newline";
+
+ // Do we now need to re-add the fulltext index? ;)
+ if ($table_name == ($prefix . 'posts') && $drop_index)
+ {
+ echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text){$newline}";
+ }
}
/**
|