diff options
author | Byron Jones <bjones@mozilla.com> | 2013-10-16 16:26:31 +0200 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-10-16 16:26:31 +0200 |
commit | 4b5b03e55429a6e1c531650aa5be00f624b2bfa2 (patch) | |
tree | 11fce978297727eb1f1054c812ec20f87de2f628 /extensions | |
parent | bebd1cb6430faa08b9937f1bf2c65af8c8f823ef (diff) | |
download | bugzilla-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.pm | 4 | ||||
-rw-r--r-- | extensions/TrackingFlags/lib/Flag.pm | 11 |
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; |