Repository navigation
Fix for group by in sub-query - #881
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Grouped membership subqueries can silently drop scalar computations and inconsistently suppress grouping keys across set-operation operands, producing incorrect comparisons or column-count errors.
2 open issues
What changed in this PR
This PR addresses grouped aggregate subqueries in SQLProvider by omitting grouping keys from IN/NOT IN select lists while preserving them for standalone grouped queries.
Changes:
- Introduces explicit grouping metadata and shared select-list formatting across database providers.
- Adds regression tests for grouped membership subqueries and standalone key preservation.
- Updates release notes, cleans up documentation directives, and upgrades two test dependencies.
| File | Description |
|---|---|
| tests/SqlProvider.Tests/more/SubqueryCompositionTests.fs | Tests grouped IN/NOT IN and standalone key preservation. |
| tests/SqlProvider.Core.Tests/MySql/SqlProvider.Core.Tests.fsproj | Upgrades MySqlConnector to 2.3.1. |
| tests/SqlProvider.Core.Tests/MsSqlSsdt/MsSqlSsdt.Tests/MsSqlSsdt.Tests.fsproj | Updates FSharp.Core to 10.0.109. |
| src/SQLProvider.Runtime/Providers.SQLite.fs | Applies shared grouped select-list handling for SQLite. |
| src/SQLProvider.Runtime/Providers.Postgresql.fs | Applies shared grouped select-list handling for PostgreSQL. |
| src/SQLProvider.Runtime/Providers.Oracle.fs | Applies shared grouped select-list handling for Oracle. |
| src/SQLProvider.Runtime/Providers.Odbc.fs | Applies shared grouped select-list handling for ODBC. |
| src/SQLProvider.Runtime/Providers.MySql.fs | Applies shared grouped select-list handling for MySQL. |
| src/SQLProvider.Runtime/Providers.MsSqlServer.Ssdt.fs | Applies shared grouped select-list handling for SSDT. |
| src/SQLProvider.Runtime/Providers.MsSqlServer.fs | Applies shared grouped select-list handling for SQL Server. |
| src/SQLProvider.Runtime/Providers.MsSqlServer.Dynamic.fs | Applies shared grouped select-list handling for dynamic SQL Server. |
| src/SQLProvider.Runtime/Providers.MSAccess.fs | Applies shared grouped select-list handling for Access. |
| src/SQLProvider.Runtime/Providers.Firebird.fs | Applies shared grouped select-list handling for Firebird. |
| src/SQLProvider.Runtime/Providers.DuckDb.fs | Applies shared grouped select-list handling for DuckDB. |
| src/SQLProvider.Common/SqlRuntime.QueryExpression.fs | Adds conversion mode controlling grouping-key selection. |
| src/SQLProvider.Common/SqlRuntime.Linq.fs | Uses key-suppression mode for membership subqueries. |
| src/SQLProvider.Common/SqlRuntime.Common.fs | Adds grouping metadata and shared select-list formatter. |
| docs/RELEASE_NOTES.md | Documents the grouped-subquery fix. |
| docs/content/index.fsx | Removes the leading hide directive. |
| docs/content/core/mssql.fsx | Removes duplicate hide and include directives. |
| docs/content/core/general.fsx | Removes a redundant hide directive. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Value-changing numeric conversions and name-only member matching can bypass projection validation, causing membership SQL to compare underlying values rather than the projected values.
2 open issues
2 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.


Fix for group by in sub-query 746