From 1a612f5e8e93aad68933504051063800b985d398 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 13 Jun 2008 20:59:28 +0000 Subject: Bug 437770: Imported bugs are ignored by queries (they never appear in buglists) - Patch by Ed Goose r/a=LpSolit --- sanitycheck.cgi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sanitycheck.cgi') diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 237eaab38..171029b2e 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -29,6 +29,7 @@ use strict; use lib qw(. lib); use Bugzilla; +use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Util; use Bugzilla::Error; @@ -221,6 +222,26 @@ if ($cgi->param('repair_creation_date')) { Status('bug_creation_date_fixed', {bug_count => scalar(@$bug_ids)}); } +########################################################################### +# Fix entries in Bugs full_text +########################################################################### + +if ($cgi->param('repair_bugs_fulltext')) { + Status('bugs_fulltext_start'); + + my $bug_ids = $dbh->selectcol_arrayref('SELECT bugs.bug_id + FROM bugs + LEFT JOIN bugs_fulltext + ON bugs_fulltext.bug_id = bugs.bug_id + WHERE bugs_fulltext.bug_id IS NULL'); + + foreach my $bugid (@$bug_ids) { + Bugzilla::Bug->new($bugid)->_sync_fulltext('new_bug'); + } + + Status('bugs_fulltext_fixed', {bug_count => scalar(@$bug_ids)}); +} + ########################################################################### # Send unsent mail ########################################################################### @@ -864,6 +885,12 @@ Status('bug_check_creation_date'); BugCheck("bugs WHERE creation_ts IS NULL", 'bug_check_creation_date_error_text', 'repair_creation_date', 'bug_check_creation_date_repair_text'); +Status('bug_check_bugs_fulltext'); + +BugCheck("bugs LEFT JOIN bugs_fulltext ON bugs_fulltext.bug_id = bugs.bug_id " . + "WHERE bugs_fulltext.bug_id IS NULL", 'bug_check_bugs_fulltext_error_text', + 'repair_bugs_fulltext', 'bug_check_bugs_fulltext_repair_text'); + Status('bug_check_res_dupl'); BugCheck("bugs INNER JOIN duplicates ON bugs.bug_id = duplicates.dupe " . -- cgit v1.2.3-24-g4f1b