diff options
author | Alexandru Croitor <acroitor@gitlab.com> | 2019-08-20 16:48:03 +0300 |
---|---|---|
committer | Alexandru Croitor <acroitor@gitlab.com> | 2019-08-21 16:10:20 +0300 |
commit | 84ed493507e1818ee239fd8c780ec704386de21a (patch) | |
tree | 29e06538bd15b7b354eb62742007fc96fff088f4 /spec/lib/gitlab/sql/union_spec.rb | |
parent | 68d745835c80b8b045de1d42887e91fb0e66a3b6 (diff) | |
download | gitlab-ce-84ed493507e1818ee239fd8c780ec704386de21a.tar.gz |
Improve epic inherited dates update performance7332-inherit-epic-dates-ce
* Uses a single update statement to update start_date, due_date,
start_date_sourcing_milestone_id, start_date_sourcing_epic_id,
due_date_sourcing_milestone_id, due_date_sourcing_epic_id
* Moves inherited dates update of multiple epics to an async worker
Diffstat (limited to 'spec/lib/gitlab/sql/union_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sql/union_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/lib/gitlab/sql/union_spec.rb b/spec/lib/gitlab/sql/union_spec.rb index fe6422c32b6..b77bd3a1d2a 100644 --- a/spec/lib/gitlab/sql/union_spec.rb +++ b/spec/lib/gitlab/sql/union_spec.rb @@ -12,7 +12,7 @@ describe Gitlab::SQL::Union do it 'returns a String joining relations together using a UNION' do union = described_class.new([relation_1, relation_2]) - expect(union.to_sql).to eq("#{to_sql(relation_1)}\nUNION\n#{to_sql(relation_2)}") + expect(union.to_sql).to eq("(#{to_sql(relation_1)})\nUNION\n(#{to_sql(relation_2)})") end it 'skips Model.none segements' do @@ -20,7 +20,7 @@ describe Gitlab::SQL::Union do union = described_class.new([empty_relation, relation_1, relation_2]) expect {User.where("users.id IN (#{union.to_sql})").to_a}.not_to raise_error - expect(union.to_sql).to eq("#{to_sql(relation_1)}\nUNION\n#{to_sql(relation_2)}") + expect(union.to_sql).to eq("(#{to_sql(relation_1)})\nUNION\n(#{to_sql(relation_2)})") end it 'uses UNION ALL when removing duplicates is disabled' do |