Merged r23609 from trunk to 6.0-stable (#40728).

git-svn-id: https://svn.redmine.org/redmine/branches/6.0-stable@23614 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2025-04-09 07:00:55 +00:00
parent 3bd0bca1c2
commit d9b6a2c6df

View File

@@ -164,12 +164,19 @@ class TimeEntryQuery < Query
end
def base_scope
TimeEntry.visible.
joins(:project, :user).
includes(:activity).
references(:activity).
left_join_issue.
where(statement)
scope = TimeEntry.visible
.joins(:project, :user)
.includes(:activity)
.references(:activity)
.left_join_issue
.where(statement)
if Redmine::Database.mysql? && ActiveRecord::Base.connection.supports_optimizer_hints?
# Provides MySQL with a hint to use a better join order and avoid slow response times
scope.optimizer_hints('JOIN_ORDER(time_entries, projects, users)')
else
scope
end
end
def results_scope(options={})