1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-02 20:45:29 +02:00
git-svn-id: file:///svn/phpbb/trunk@6856 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-01-07 17:45:19 +00:00
parent 29ef0fdb86
commit 5474f1a0ae

View File

@ -877,6 +877,21 @@ class install_convert extends module
$counting = -1;
$batch_time = 0;
$mysql_convert = false;
switch ($db->sql_layer)
{
// Thanks MySQL, for silently converting...
case 'mysql':
case 'mysql4':
case 'mysqli':
if (version_compare($db->mysql_version, '4.1.3', '>='))
{
$mysql_convert = true;
}
break;
}
while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time())
{
$old_current_table = $current_table;
@ -899,9 +914,19 @@ class install_convert extends module
$mtime = explode(' ', microtime());
$batch_time = $mtime[0] + $mtime[1];
if ($mysql_convert)
{
$db->sql_query("SET NAMES 'latin1'");
}
// Take skip rows into account and only fetch batch_size amount of rows
$___result = $db->sql_query_limit($sql, $convert->batch_size, $skip_rows);
if ($mysql_convert)
{
$db->sql_query("SET NAMES 'utf8'");
}
// This loop processes each row
$counting = 0;