Skip to content

Commit d460937

Browse files
committed
Added test
1 parent cc491ad commit d460937

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
#### Fixed
44

5-
- [#1262](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1262) Fix distinct alias when multiple databases used
5+
- [#1262](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1262) Fix distinct alias when multiple databases used.
66

77
## v8.0.0
88

99
#### Changed
1010

11-
- [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter
12-
- [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1
11+
- [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter.
12+
- [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1.
1313

1414
#### Fixed
1515

16-
- [#1215](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1215) Fix mismatched foreign key errors
16+
- [#1215](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1215) Fix mismatched foreign key errors.
1717

1818
Please check [7-2-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/7-2-stable/CHANGELOG.md) for previous changes.

test/cases/adapter_test_sqlserver.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,13 @@ def setup
616616
assert_equal Task.where("starting < ?", DateTime.current).count, 1
617617
end
618618
end
619+
620+
describe "distinct select query" do
621+
it "generated SQL does not contain unnecessary alias projection" do
622+
sqls = capture_sql do
623+
Post.includes(:comments).joins(:comments).first
624+
end
625+
assert_no_match(/AS alias_0/, sqls.first)
626+
end
627+
end
619628
end

0 commit comments

Comments
 (0)