Index: globals.pl =================================================================== RCS file: /cvsroot/mozilla/webtools/bugzilla/globals.pl,v retrieving revision 1.169.2.1 diff -u -r1.169.2.1 globals.pl --- globals.pl 30 May 2002 14:53:45 -0000 1.169.2.1 +++ globals.pl 3 Jun 2002 04:13:54 -0000 @@ -338,15 +338,17 @@ } my $whoid = DBNameToIdAndCheck($who); - + PushGlobalSQLState(); SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) " . "VALUES($bugid, $whoid, now(), " . SqlQuote($comment) . ")"); SendSQL("UPDATE bugs SET delta_ts = now() WHERE bug_id = $bugid"); + PopGlobalSQLState(); } sub GetFieldID { my ($f) = (@_); + PushGlobalSQLState(); SendSQL("SELECT fieldid FROM fielddefs WHERE name = " . SqlQuote($f)); my $fieldid = FetchOneColumn(); if (!$fieldid) { @@ -355,6 +357,7 @@ SendSQL("SELECT LAST_INSERT_ID()"); $fieldid = FetchOneColumn(); } + PopGlobalSQLState(); return $fieldid; } @@ -439,6 +442,7 @@ sub GenerateVersionTable { ConnectToDatabase(); + PushGlobalSQLState(); SendSQL("select value, program from versions order by value"); my @line; my %varray; @@ -591,6 +595,7 @@ close FID; rename $tmpname, "data/versioncache" || die "Can't rename $tmpname to versioncache"; ChmodDataFile('data/versioncache', 0666); + PopGlobalSQLState(); } @@ -653,17 +658,19 @@ # Reject if the new login is part of an email change which is # still in progress + PushGlobalSQLState(); SendSQL("SELECT eventdata FROM tokens WHERE tokentype = 'emailold' AND eventdata like '%:$username' OR eventdata like '$username:%'"); if (my ($eventdata) = FetchSQLData()) { + PopGlobalSQLState(); # Allow thru owner of token if($old_username && ($eventdata eq "$old_username:$username")) { return 1; } return 0; } - + PopGlobalSQLState(); return 1; } @@ -715,7 +722,9 @@ if (defined $keep) { $remove .= " AND cookie != " . SqlQuote($keep); } + PushGlobalSQLState(); SendSQL($remove); + PopGlobalSQLState(); } sub GenerateRandomPassword { @@ -1147,6 +1156,7 @@ } $query .= "ORDER BY longdescs.bug_when"; + PushGlobalSQLState(); SendSQL($query); while (MoreSQLData()) { my ($who, $when, $text) = (FetchSQLData()); @@ -1157,14 +1167,14 @@ $result .= $text; $count++; } - + PopGlobalSQLState(); return $result; } sub GetComments { my ($id) = (@_); my @comments; - + PushGlobalSQLState(); SendSQL("SELECT profiles.realname, profiles.login_name, date_format(longdescs.bug_when,'%Y-%m-%d %H:%i'), longdescs.thetext @@ -1182,7 +1192,7 @@ push (@comments, \%comment); } - + PopGlobalSQLState(); return \@comments; } @@ -1195,6 +1205,7 @@ sub LearnAboutColumns { my ($table) = (@_); my %a; + PushGlobalSQLState(); SendSQL("show columns from $table"); my @list = (); my @row; @@ -1204,6 +1215,7 @@ push @list, $name; } $a{"-list-"} = \@list; + PopGlobalSQLState(); return \%a; } @@ -1271,8 +1283,10 @@ sub GroupExists { my ($groupname) = (@_); ConnectToDatabase(); + PushGlobalSQLState(); SendSQL("select count(*) from groups where name=" . SqlQuote($groupname)); my $count = FetchOneColumn(); + PopGlobalSQLState(); return $count; } @@ -1296,8 +1310,10 @@ my ($groupbit) = (@_); $groupbit ||= 0; ConnectToDatabase(); + PushGlobalSQLState(); SendSQL("select isactive from groups where bit=$groupbit"); my $isactive = FetchOneColumn(); + PopGlobalSQLState(); return $isactive; } @@ -1328,6 +1344,7 @@ if ($who) { $whopart = " AND votes.who = $who"; } + PushGlobalSQLState(); SendSQL("SELECT profiles.login_name, profiles.userid, votes.count, " . "products.votesperuser, products.maxvotesperbug " . "FROM profiles " . @@ -1415,6 +1432,7 @@ SendSQL("UPDATE bugs SET votes = $v, delta_ts = delta_ts " . "WHERE bug_id = $id"); } + PopGlobalSQLState(); }