summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-04-15 14:46:04 +0200
committermkanat%kerio.com <>2005-04-15 14:46:04 +0200
commitd8f3d06a17581384beb0bdf1adbbadc5566d7760 (patch)
tree79dd912ba9f5bcf55d6335315d70d8349881407d /Bugzilla/DB.pm
parent7be1f1c90805dc6c1845434fc215f9f07199db75 (diff)
downloadbugzilla-d8f3d06a17581384beb0bdf1adbbadc5566d7760.tar.gz
bugzilla-d8f3d06a17581384beb0bdf1adbbadc5566d7760.tar.xz
Bug 290414: bz_index_info is slightly broken and has unclear API
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=Tomas.Kopal, a=justdave
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index d72cd5e82..e8a3f362e 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -587,8 +587,12 @@ sub bz_column_info {
sub bz_index_info {
my ($self, $table, $index) = @_;
-
- return $self->_bz_real_schema->get_index_abstract($table, $index);
+ my $index_def =
+ $self->_bz_real_schema->get_index_abstract($table, $index);
+ if (ref($index_def) eq 'ARRAY') {
+ $index_def = {FIELDS => $index_def, TYPE => ''};
+ }
+ return $index_def;
}
@@ -1368,7 +1372,10 @@ C<Bugzilla::DB::Schema::ABSTRACT_SCHEMA>.
Description: Get abstract index definition.
Params: $table - The table the index is on.
$index - The name of the index.
- Returns: An abstract index definition for that index.
+ Returns: An abstract index definition for that index,
+ always in hashref format. The hashref will
+ always contain the TYPE element, but it will
+ be an empty string if it's just a normal index.
If the index does not exist, we return undef.
=back