From: bbaetz%student.usyd.edu.au <> Date: Sat, 10 Aug 2002 14:34:16 +0000 (+0000) Subject: Bug 161865 - GetFieldID shouldn't INSERT into the fielddefs table X-Git-Tag: bugzilla-2.17.1~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61890499431396f3209e0a135122a1af507364f6;p=thirdparty%2Fbugzilla.git Bug 161865 - GetFieldID shouldn't INSERT into the fielddefs table r=joel x2 --- diff --git a/checksetup.pl b/checksetup.pl index ea4377fe98..74d0087086 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 ec57bffb2b..cdaf845124 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; }