Commit d89b27ae authored by Frédéric Buclin's avatar Frédéric Buclin

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

r=mkanat a=LpSolit
parent c0771f45
......@@ -822,17 +822,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment