diff options
| author | David M <davidmj@users.sourceforge.net> | 2007-01-07 17:45:19 +0000 |
|---|---|---|
| committer | David M <davidmj@users.sourceforge.net> | 2007-01-07 17:45:19 +0000 |
| commit | 5474f1a0aea96c98202a28e048c9d408ff9b1b63 (patch) | |
| tree | 6cf43979c31944b9a81ff1b0bf184f919d93b40c /phpBB/install/install_convert.php | |
| parent | 29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8 (diff) | |
| download | forums-5474f1a0aea96c98202a28e048c9d408ff9b1b63.tar forums-5474f1a0aea96c98202a28e048c9d408ff9b1b63.tar.gz forums-5474f1a0aea96c98202a28e048c9d408ff9b1b63.tar.bz2 forums-5474f1a0aea96c98202a28e048c9d408ff9b1b63.tar.xz forums-5474f1a0aea96c98202a28e048c9d408ff9b1b63.zip | |
#6836
git-svn-id: file:///svn/phpbb/trunk@6856 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install/install_convert.php')
| -rw-r--r-- | phpBB/install/install_convert.php | 25 |
1 files changed, 25 insertions, 0 deletions
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; |
