Fix Bug #46285 (drop index patch by Paul) - i hope the re-addition of the FULLTEXT index works. :o

If someone wants to try? :)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9930 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2009-08-05 14:50:39 +00:00
parent 2c6e4d7e80
commit d0e9e4189c

View file

@ -40,13 +40,18 @@ $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$mysql_indexer = false;
$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,6 +129,13 @@ foreach ($schema_data as $table_name => $table_data)
// 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,6 +248,12 @@ foreach ($schema_data as $table_name => $table_data)
$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}";
}
}
/**