summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index b0106314e..6cd938aa6 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -589,13 +589,18 @@ sub bz_index_info {
# XXX - Needs to be made cross-db compatible.
sub bz_get_field_def ($$) {
my ($self, $table, $field) = @_;
- my $sth = $self->prepare("SHOW COLUMNS FROM $table");
- $sth->execute;
- while (my $ref = $sth->fetchrow_arrayref) {
- next if $$ref[0] ne $field;
- return $ref;
- }
+ if ($self->bz_table_exists($table)) {
+
+ my $sth = $self->prepare("SHOW COLUMNS FROM $table");
+ $sth->execute;
+
+ while (my $ref = $sth->fetchrow_arrayref) {
+ next if $$ref[0] ne $field;
+ return $ref;
+ }
+ }
+ return undef;
}
# XXX - Needs to be made cross-db compatible