From 77fb2a5ede8b4f07b4aee8f7de30558d4a3be784 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Fri, 2 Nov 2012 23:30:44 +0000 Subject: [PATCH] Bug 804505: Oracle crashes when typing "word1 word2" in QuickSearch with "ORA-29907: found duplicate labels in primary invocations" r=dkl a=LpSolit git-svn-id: svn://10.0.0.236/trunk@264401 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Bug.pm | 7 ++----- mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm | 5 ++++- mozilla/webtools/bugzilla/Bugzilla/Search.pm | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 37017731ef3..cc0c5fd9c2b 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8455 \ No newline at end of file +8456 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm index 97b8591a759..3b14c4cb281 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm @@ -520,17 +520,14 @@ sub possible_duplicates { if ($dbh->FULLTEXT_OR) { my $joined_terms = join($dbh->FULLTEXT_OR, @words); ($where_sql, $relevance_sql) = - $dbh->sql_fulltext_search('bugs_fulltext.short_desc', - $joined_terms, 1); + $dbh->sql_fulltext_search('bugs_fulltext.short_desc', $joined_terms); $relevance_sql ||= $where_sql; } else { my (@where, @relevance); - my $count = 0; foreach my $word (@words) { - $count++; my ($term, $rel_term) = $dbh->sql_fulltext_search( - 'bugs_fulltext.short_desc', $word, $count); + 'bugs_fulltext.short_desc', $word); push(@where, $term); push(@relevance, $rel_term || $term); } diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm index e6beef5cc97..fcc4e88a941 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm @@ -159,10 +159,13 @@ sub sql_from_days{ return " TO_DATE($date,'J') "; } + sub sql_fulltext_search { - my ($self, $column, $text, $label) = @_; + my ($self, $column, $text) = @_; + state $label = 0; $text = $self->quote($text); trick_taint($text); + $label++; return "CONTAINS($column,$text,$label) > 0", "SCORE($label)"; } diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search.pm b/mozilla/webtools/bugzilla/Bugzilla/Search.pm index 3805cd2adf9..8746c270610 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search.pm @@ -2342,9 +2342,9 @@ sub _content_matches { # Create search terms to add to the SELECT and WHERE clauses. my ($term1, $rterm1) = - $dbh->sql_fulltext_search("$table.$comments_col", $value, 1); + $dbh->sql_fulltext_search("$table.$comments_col", $value); my ($term2, $rterm2) = - $dbh->sql_fulltext_search("$table.short_desc", $value, 2); + $dbh->sql_fulltext_search("$table.short_desc", $value); $rterm1 = $term1 if !$rterm1; $rterm2 = $term2 if !$rterm2;