summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-02-14 19:37:38 +0100
committerbbaetz%acm.org <>2003-02-14 19:37:38 +0100
commita88bc79dcd14ef13b9a4850c5192981201aa23bf (patch)
tree3a9f651dbc1b016ab7365590def2e3d891d7ad41 /Bugzilla
parentd59e06001d9634de6b5297f9ed93e278b393706a (diff)
downloadbugzilla-a88bc79dcd14ef13b9a4850c5192981201aa23bf.tar.gz
bugzilla-a88bc79dcd14ef13b9a4850c5192981201aa23bf.tar.xz
Bug 192531 - Bugzilla not properly closing DB statement handles
Change code to work arround a perl < 5.8 leak when localising the tied statement attributes. Also, clear the sql statestack compat stuff so that the handles are really dead by the time we disconnect r,a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 23078369a..0de9b612c 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -54,13 +54,21 @@ sub ConnectToDatabase {
}
# XXX - mod_perl
-my $_current_sth;
+# These use |our| instead of |my| because they need to be cleared from
+# Bugzilla.pm. See bug 192531 for details.
+our $_current_sth;
+our @SQLStateStack = ();
sub SendSQL {
my ($str) = @_;
require Bugzilla;
$_current_sth = Bugzilla->dbh->prepare($str);
+
+ # This is really really ugly, but its what we get for not doing
+ # error checking for 5 years. See bug 189446 and bug 192531
+ $_current_sth->{RaiseError} = 0;
+
return $_current_sth->execute;
}
@@ -98,12 +106,7 @@ sub FetchSQLData {
return @result;
}
- # This is really really ugly, but its what we get for not doing
- # error checking for 5 years. See bug 189446.
- {
- local $_current_sth->{RaiseError};
- return $_current_sth->fetchrow_array;
- }
+ return $_current_sth->fetchrow_array;
}
sub FetchOneColumn {
@@ -111,9 +114,6 @@ sub FetchOneColumn {
return $row[0];
}
-# XXX - mod_perl
-my @SQLStateStack = ();
-
sub PushGlobalSQLState() {
push @SQLStateStack, $_current_sth;
push @SQLStateStack, $_fetchahead;