From 5474f1a0aea96c98202a28e048c9d408ff9b1b63 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 7 Jan 2007 17:45:19 +0000 Subject: [PATCH] #6836 git-svn-id: file:///svn/phpbb/trunk@6856 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 61096f5b86..6b53d18b74 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -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;