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

Bug 557495: PostgreSQL crashes when deleting a custom field of type BugID

r/a=mkanat
parent 6479bb0f
......@@ -821,8 +821,10 @@ sub remove_from_db {
$bugs_query = "SELECT COUNT(*) FROM bug_$name";
}
else {
$bugs_query = "SELECT COUNT(*) FROM bugs WHERE $name IS NOT NULL
AND $name != ''";
$bugs_query = "SELECT COUNT(*) FROM bugs WHERE $name IS NOT NULL";
if ($self->type != FIELD_TYPE_BUG_ID) {
$bugs_query .= " AND $name != ''";
}
# Ignore the default single select value
if ($self->type == FIELD_TYPE_SINGLE_SELECT) {
$bugs_query .= " AND $name != '---'";
......
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