]> 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:18:32 +0000 (00:18 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 2 Nov 2012 23:18:32 +0000 (00:18 +0100)
r=dkl a=LpSolit

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

index 68682801594e69ca08a493d82cfda5cbe1bfb55a..6a21b4e892523a50353d17e6a705569ef93fb833 100644 (file)
@@ -523,17 +523,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 4a69db16d3b667143db2bc8888d9d6cbf49b2208..ebf59533f7c75af8e377cc1b188cfd4520df3cc1 100644 (file)
@@ -56,6 +56,8 @@ use constant BLOB_TYPE => { ora_type => ORA_BLOB };
 use constant MIN_LONG_READ_LEN => 32 * 1024;
 use constant FULLTEXT_OR => ' OR ';
 
+our $fulltext_label = 0;
+
 sub new {
     my ($class, $params) = @_;
     my ($user, $pass, $host, $dbname, $port) = 
@@ -171,11 +173,13 @@ sub sql_from_days{
 
     return " TO_DATE($date,'J') ";
 }
+
 sub sql_fulltext_search {
-    my ($self, $column, $text, $label) = @_;
+    my ($self, $column, $text) = @_;
     $text = $self->quote($text);
     trick_taint($text);
-    return "CONTAINS($column,$text,$label) > 0", "SCORE($label)";
+    $fulltext_label++;
+    return "CONTAINS($column,$text,$fulltext_label) > 0", "SCORE($fulltext_label)";
 }
 
 sub sql_date_format {
index f0e015cbcfa7371a1f392c4c1e2a3d766be5a704..95f03a6ae8604cbc28fa17e8af37340f012e575f 100644 (file)
@@ -2348,9 +2348,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;