summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-10 17:07:34 +0100
committermkanat%kerio.com <>2005-03-10 17:07:34 +0100
commitb5e1b3f1e725062345edcacd9657da7b8f85874d (patch)
tree5479c059ec9fe26c41b2022daf378fc429683c55 /globals.pl
parent190493a53426b2fdc7c589ea144af6515b94b06b (diff)
downloadbugzilla-b5e1b3f1e725062345edcacd9657da7b8f85874d.tar.gz
bugzilla-b5e1b3f1e725062345edcacd9657da7b8f85874d.tar.xz
Bug 285403: LearnAboutColumns does not work on PostgreSQL
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=Tomas.Kopal, a=justdave
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl25
1 files changed, 3 insertions, 22 deletions
diff --git a/globals.pl b/globals.pl
index 53119c034..13542dcac 100644
--- a/globals.pl
+++ b/globals.pl
@@ -148,6 +148,8 @@ sub GetFieldID {
# XXXX - this needs to go away
sub GenerateVersionTable {
+ my $dbh = Bugzilla->dbh;
+
SendSQL("SELECT versions.value, products.name " .
"FROM versions, products " .
"WHERE products.id = versions.product_id " .
@@ -217,9 +219,8 @@ sub GenerateVersionTable {
$::prodmaxvotes{$p} = $votesperuser;
}
- my $cols = LearnAboutColumns("bugs");
+ @::log_columns = $dbh->bz_table_columns('bugs');
- @::log_columns = @{$cols->{"-list-"}};
foreach my $i ("bug_id", "creation_ts", "delta_ts", "lastdiffed") {
my $w = lsearch(\@::log_columns, $i);
if ($w >= 0) {
@@ -982,26 +983,6 @@ sub GetLongDescriptionAsText {
return ($result, $anyprivate);
}
-# Fills in a hashtable with info about the columns for the given table in the
-# database. The hashtable has the following entries:
-# -list- the list of column names
-# <name>,type the type for the given name
-
-sub LearnAboutColumns {
- my ($table) = (@_);
- my %a;
- SendSQL("show columns from $table");
- my @list = ();
- my @row;
- while (@row = FetchSQLData()) {
- my ($name,$type) = (@row);
- $a{"$name,type"} = $type;
- push @list, $name;
- }
- $a{"-list-"} = \@list;
- return \%a;
-}
-
# Returns a list of all the legal values for a field that has a
# list of legal values, like rep_platform or resolution.
sub get_legal_field_values {