summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-10-16 16:26:31 +0200
committerByron Jones <bjones@mozilla.com>2013-10-16 16:26:31 +0200
commit4b5b03e55429a6e1c531650aa5be00f624b2bfa2 (patch)
tree11fce978297727eb1f1054c812ec20f87de2f628 /extensions
parentbebd1cb6430faa08b9937f1bf2c65af8c8f823ef (diff)
downloadbugzilla-4b5b03e55429a6e1c531650aa5be00f624b2bfa2.tar.gz
bugzilla-4b5b03e55429a6e1c531650aa5be00f624b2bfa2.tar.xz
Bug 926109: Error when searching for many columns at once (MariaDB can only use 61 tables in a join)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/TrackingFlags/Extension.pm4
-rw-r--r--extensions/TrackingFlags/lib/Flag.pm11
2 files changed, 15 insertions, 0 deletions
diff --git a/extensions/TrackingFlags/Extension.pm b/extensions/TrackingFlags/Extension.pm
index bbf1650d5..0432e7d2f 100644
--- a/extensions/TrackingFlags/Extension.pm
+++ b/extensions/TrackingFlags/Extension.pm
@@ -341,6 +341,10 @@ sub buglist_columns {
sub buglist_column_joins {
my ($self, $args) = @_;
+ # if there are elements in the tracking_flags array, then they have been
+ # removed from the query, so we mustn't generate joins
+ return if scalar @{ $args->{search}->{tracking_flags} };
+
my $column_joins = $args->{'column_joins'};
my @tracking_flags = Bugzilla::Extension::TrackingFlags::Flag->get_all;
foreach my $flag (@tracking_flags) {
diff --git a/extensions/TrackingFlags/lib/Flag.pm b/extensions/TrackingFlags/lib/Flag.pm
index 08886c267..bc422243e 100644
--- a/extensions/TrackingFlags/lib/Flag.pm
+++ b/extensions/TrackingFlags/lib/Flag.pm
@@ -214,6 +214,17 @@ sub get_all {
values %{ $cache->{'tracking_flags'} };
}
+# avoids the overhead of pre-loading if just the field names are required
+sub get_all_names {
+ my $self = shift;
+ my $cache = Bugzilla->request_cache;
+ if (!exists $cache->{'tracking_flags_names'}) {
+ $cache->{'tracking_flags_names'} =
+ Bugzilla->dbh->selectcol_arrayref("SELECT name FROM tracking_flags ORDER BY name");
+ }
+ return @{ $cache->{'tracking_flags_names'} };
+}
+
sub remove_from_db {
my $self = shift;
my $dbh = Bugzilla->dbh;