mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
git-svn-id: file:///svn/phpbb/trunk@6856 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
29ef0fdb86
commit
5474f1a0ae
1 changed files with 25 additions and 0 deletions
|
@ -877,6 +877,21 @@ class install_convert extends module
|
||||||
$counting = -1;
|
$counting = -1;
|
||||||
$batch_time = 0;
|
$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())
|
while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time())
|
||||||
{
|
{
|
||||||
$old_current_table = $current_table;
|
$old_current_table = $current_table;
|
||||||
|
@ -899,9 +914,19 @@ class install_convert extends module
|
||||||
$mtime = explode(' ', microtime());
|
$mtime = explode(' ', microtime());
|
||||||
$batch_time = $mtime[0] + $mtime[1];
|
$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
|
// Take skip rows into account and only fetch batch_size amount of rows
|
||||||
$___result = $db->sql_query_limit($sql, $convert->batch_size, $skip_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
|
// This loop processes each row
|
||||||
$counting = 0;
|
$counting = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue