From 61890499431396f3209e0a135122a1af507364f6 Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Sat, 10 Aug 2002 14:34:16 +0000 Subject: Bug 161865 - GetFieldID shouldn't INSERT into the fielddefs table r=joel x2 --- checksetup.pl | 10 +++++++--- globals.pl | 7 +------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/checksetup.pl b/checksetup.pl index ea4377fe9..74d008708 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -1746,6 +1746,9 @@ sub AddFDef ($$$) { } +# Note that all of these entries are unconditional, from when GetFieldID +# used to create an entry if it wasn't found. New fielddef columns should +# be created with their associated schema change. AddFDef("bug_id", "Bug \#", 1); AddFDef("short_desc", "Summary", 1); AddFDef("product", "Product", 1); @@ -1779,9 +1782,10 @@ AddFDef("(to_days(now()) - to_days(bugs.delta_ts))", "Days since bug changed", 0); AddFDef("longdesc", "Comment", 0); AddFDef("alias", "Alias", 0); - - - +AddFDef("everconfirmed", "Ever Confirmed", 0); +AddFDef("groupset", "Groupset", 0); +AddFDef("reporter_accessible", "Reporter Accessible", 0); +AddFDef("cc_accessible", "CC Accessible", 0); ########################################################################### # Detect changed local settings diff --git a/globals.pl b/globals.pl index ec57bffb2..cdaf84512 100644 --- a/globals.pl +++ b/globals.pl @@ -349,12 +349,7 @@ sub GetFieldID { my ($f) = (@_); SendSQL("SELECT fieldid FROM fielddefs WHERE name = " . SqlQuote($f)); my $fieldid = FetchOneColumn(); - if (!$fieldid) { - my $q = SqlQuote($f); - SendSQL("REPLACE INTO fielddefs (name, description) VALUES ($q, $q)"); - SendSQL("SELECT LAST_INSERT_ID()"); - $fieldid = FetchOneColumn(); - } + die "Unknown field id: $f" if !$fieldid; return $fieldid; } -- cgit v1.2.3-24-g4f1b