aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-11-18 23:54:59 +0000
committermkanat%bugzilla.org <>2006-11-18 23:54:59 +0000
commit70e3b6464c5029187ec144aa12fc8b77c03f90c8 (patch)
tree2862806e625d31b84d6dae341d466a3beda8d071
parent496a78f616b10c1c5c4bd0398021232e9bffa77e (diff)
downloadbugs-70e3b6464c5029187ec144aa12fc8b77c03f90c8.tar
bugs-70e3b6464c5029187ec144aa12fc8b77c03f90c8.tar.gz
bugs-70e3b6464c5029187ec144aa12fc8b77c03f90c8.tar.bz2
bugs-70e3b6464c5029187ec144aa12fc8b77c03f90c8.tar.xz
bugs-70e3b6464c5029187ec144aa12fc8b77c03f90c8.zip
Checkin fix for Bug 280633, which didn't work when the utf8 parameter was turned on.
-rw-r--r--Bugzilla.pm1
-rwxr-xr-xcontrib/recode.pl14
2 files changed, 12 insertions, 3 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 5a9d23e14..7c52dd500 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -53,6 +53,7 @@ our $_request_cache = {};
use constant SHUTDOWNHTML_EXEMPT => [
'editparams.cgi',
'checksetup.pl',
+ 'recode.pl',
];
# Non-cgi scripts that should silently exit.
diff --git a/contrib/recode.pl b/contrib/recode.pl
index 7db01dddf..10a4cbb44 100755
--- a/contrib/recode.pl
+++ b/contrib/recode.pl
@@ -174,9 +174,17 @@ if (exists $switch{'overrides'}) {
my $dbh = Bugzilla->dbh;
-# Make the database give us raw bytes.
-$dbh->do('SET character_set_results = NULL')
- if $dbh->isa('Bugzilla::DB::Mysql');
+if ($dbh->isa('Bugzilla::DB::Mysql')) {
+ # Get the actual current encoding of the DB.
+ my $collation_data = $dbh->selectrow_arrayref(
+ "SHOW VARIABLES LIKE 'character_set_database'");
+ my $db_charset = $collation_data->[1];
+ # Set our connection encoding to *that* encoding, so that MySQL
+ # correctly accepts our changes.
+ $dbh->do("SET NAMES $db_charset");
+ # Make the database give us raw bytes.
+ $dbh->do('SET character_set_results = NULL')
+}
$dbh->begin_work;