]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 804505: Oracle crashes when typing "word1 word2" in QuickSearch with "ORA-29907...
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 2 Nov 2012 23:15:51 +0000 (00:15 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 2 Nov 2012 23:15:51 +0000 (00:15 +0100)
r=dkl a=LpSolit

Bugzilla/Bug.pm
Bugzilla/DB/Oracle.pm
Bugzilla/Search.pm

index 97b8591a759dab6a6fe719288fbce47e40126eb6..3b14c4cb281d336720f1e4f2deca8809b0aae56f 100644 (file)
@@ -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);
         }
index e6beef5cc977aab7164c66809e686edb869cf9b2..fcc4e88a94132eaafae1a6ea068afadaa7f9188a 100644 (file)
@@ -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)";
 }
 
index 3805cd2adf9bd619e9a9e7bc170ab3ec36341372..8746c270610b1c7120d493c14e9df222c812ae18 100644 (file)
@@ -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;