diff options
author | lpsolit%gmail.com <> | 2008-09-10 15:41:36 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2008-09-10 15:41:36 +0000 |
commit | 93e808dbc5e703df7318e18f048710f19fc8e92c (patch) | |
tree | 26b981f5176023855b75e58acacb686a88c5f64b /Bugzilla/Install | |
parent | de1fd5b0a978941a0e3aad505451d56b905ba487 (diff) | |
download | bugs-93e808dbc5e703df7318e18f048710f19fc8e92c.tar bugs-93e808dbc5e703df7318e18f048710f19fc8e92c.tar.gz bugs-93e808dbc5e703df7318e18f048710f19fc8e92c.tar.bz2 bugs-93e808dbc5e703df7318e18f048710f19fc8e92c.tar.xz bugs-93e808dbc5e703df7318e18f048710f19fc8e92c.zip |
Bug 452893: request.cgi crashes if a flag modification date is invalid - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r-- | Bugzilla/Install/DB.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 218ea093f..213fe3099 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -532,7 +532,10 @@ sub update_table_definitions { # 2008-07-28 tfu@redhat.com - Bug 431669 $dbh->bz_alter_column('group_control_map', 'product_id', { TYPE => 'INT2', NOTNULL => 1 }); - + + # 2008-09-07 LpSolit@gmail.com - Bug 452893 + _fix_illegal_flag_modification_dates(); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -3083,6 +3086,15 @@ sub _populate_bugs_fulltext { } } +sub _fix_illegal_flag_modification_dates { + my $dbh = Bugzilla->dbh; + + my $rows = $dbh->do('UPDATE flags SET modification_date = creation_date + WHERE modification_date < creation_date'); + # If no rows are affected, $dbh->do returns 0E0 instead of 0. + print "$rows flags had an illegal modification date. Fixed!\n" if ($rows =~ /^\d+$/); +} + 1; __END__ |