Bug 557686: PostgreSQL crashes when deleting a custom field of type Date/Time

r=mkanat a=LpSolit


git-svn-id: svn://10.0.0.236/branches/BUGZILLA-3_6-BRANCH@260161 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org
2010-04-07 01:18:54 +00:00
parent 28e84b65a2
commit 3a8feb5eb5
2 changed files with 2 additions and 6 deletions

View File

@@ -1 +1 @@
7073
7074

View File

@@ -722,17 +722,13 @@ sub remove_from_db {
}
else {
$bugs_query = "SELECT COUNT(*) FROM bugs WHERE $name IS NOT NULL";
if ($self->type != FIELD_TYPE_BUG_ID) {
if ($self->type != FIELD_TYPE_BUG_ID && $self->type != FIELD_TYPE_DATETIME) {
$bugs_query .= " AND $name != ''";
}
# Ignore the default single select value
if ($self->type == FIELD_TYPE_SINGLE_SELECT) {
$bugs_query .= " AND $name != '---'";
}
# Ignore blank dates.
if ($self->type == FIELD_TYPE_DATETIME) {
$bugs_query .= " AND $name != '00-00-00 00:00:00'";
}
}
my $has_bugs = $dbh->selectrow_array($bugs_query);