From: mkanat%kerio.com <> Date: Thu, 12 Jan 2006 15:13:14 +0000 (+0000) Subject: Bug 322771: PostgreSQL incorrectly detects that some summaries have control character... X-Git-Tag: bugzilla-2.20.1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2c3b59391c8ca48ac0c58d16160791038029844;p=thirdparty%2Fbugzilla.git Bug 322771: PostgreSQL incorrectly detects that some summaries have control characters when they don't Patch By Frederic Buclin r=mkanat, a=justdave --- diff --git a/checksetup.pl b/checksetup.pl index 2cf33249da..2f3307a5ee 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -4175,17 +4175,22 @@ my $controlchar_bugs = $dbh->selectall_arrayref("SELECT short_desc, bug_id FROM bugs WHERE " . "'short_desc' " . $dbh->sql_regexp . " '[[: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