diff options
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r-- | Bugzilla/DB.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 684869006..a766a6e04 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -164,6 +164,16 @@ sub _handle_error { return 0; # Now let DBI handle raising the error } +my $cached_server_version; +sub server_version { + return $cached_server_version if defined($cached_server_version); + my $dbh = Bugzilla->dbh; + my $sth = $dbh->prepare('SELECT VERSION()'); + $sth->execute(); + ($cached_server_version) = $sth->fetchrow_array(); + return $cached_server_version; +} + 1; __END__ |