summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-01-12 16:03:46 +0100
committermkanat%kerio.com <>2006-01-12 16:03:46 +0100
commit6930e2afb8af2a784f2c9ff6af3a8be6ee9a8920 (patch)
tree5d28cbd522f430f10eedc75e0077b17f99f305bd
parentbdd1e6e3436b81aefd5e7aac1e7f53b1a9d9f591 (diff)
downloadbugzilla-6930e2afb8af2a784f2c9ff6af3a8be6ee9a8920.tar.gz
bugzilla-6930e2afb8af2a784f2c9ff6af3a8be6ee9a8920.tar.xz
Bug 322771: PostgreSQL incorrectly detects that some summaries have control characters when they don't
Patch By Frederic Buclin <LpSolit@gmail.com> r=mkanat, a=justdave
-rwxr-xr-xchecksetup.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 847ada5bb..4ec455efa 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -4245,17 +4245,22 @@ $dbh->bz_alter_column('logincookies', 'cookie',
my $controlchar_bugs =
$dbh->selectall_arrayref("SELECT short_desc, bug_id FROM bugs WHERE " .
$dbh->sql_regexp('short_desc', "'[[:cntrl:]]'"));
-if (@$controlchar_bugs)
+if (scalar(@$controlchar_bugs))
{
- print 'Cleaning control characters from bug summaries...';
+ my $msg = 'Cleaning control characters from bug summaries...';
+ my $found = 0;
foreach (@$controlchar_bugs) {
my ($short_desc, $bug_id) = @$_;
- print " $bug_id...";
- $short_desc = clean_text($short_desc);
- $dbh->do("UPDATE bugs SET short_desc = ? WHERE bug_id = ?",
- undef, $short_desc, $bug_id);
+ my $clean_short_desc = clean_text($short_desc);
+ if ($clean_short_desc ne $short_desc) {
+ print $msg if !$found;
+ $found = 1;
+ print " $bug_id...";
+ $dbh->do("UPDATE bugs SET short_desc = ? WHERE bug_id = ?",
+ undef, $clean_short_desc, $bug_id);
+ }
}
- print " done.\n";
+ print " done.\n" if $found;
}
# If you had to change the --TABLE-- definition in any way, then add your