]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 291803: PostgreSQL dies when you insert a string longer than 2700 characters...
authormkanat%kerio.com <>
Thu, 9 Jun 2005 11:42:44 +0000 (11:42 +0000)
committermkanat%kerio.com <>
Thu, 9 Jun 2005 11:42:44 +0000 (11:42 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=jouni, a=justdave

Bugzilla/DB/Pg.pm
checksetup.pl

index 86c5497cd42af348558535f343286ad3665452c7..25378ccc37d9095f31dce1216d393117911f5a94 100644 (file)
@@ -197,4 +197,18 @@ sub bz_unlock_tables {
     }
 }
 
+#####################################################################
+# Custom Database Setup
+#####################################################################
+
+sub bz_setup_database {
+    my $self = shift;
+    $self->SUPER::bz_setup_database(@_);
+
+    # PostgreSQL doesn't like having *any* index on the thetext
+    # field, because it can't have index data longer than 2770
+    # characters on that field.
+    $self->bz_drop_index('longdescs', 'longdescs_thetext_idx');
+}
+
 1;
index 7151b86bf29d2f37c85ca9582dc834d75e7b1d44..d1068bbbdfbbbb30e43e11a023c59897e97fb8ba 100755 (executable)
@@ -3664,7 +3664,10 @@ if (!$dbh->bz_index_info('bugs', 'bugs_short_desc_idx')) {
     $dbh->bz_add_index('bugs', 'bugs_short_desc_idx', 
                        {TYPE => 'FULLTEXT', FIELDS => [qw(short_desc)]});
 }
-if (!$dbh->bz_index_info('longdescs', 'longdescs_thetext_idx')) {
+# Right now, we only create the "thetext" index on MySQL.
+if ($dbh->isa('Bugzilla::DB::Mysql') 
+    && !$dbh->bz_index_info('longdescs', 'longdescs_thetext_idx')) 
+{
     print "Adding full-text index for thetext column in longdescs table...\n";
     $dbh->bz_add_index('longdescs', 'longdescs_thetext_idx',
         {TYPE => 'FULLTEXT', FIELDS => [qw(thetext)]});