Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add cross-dialect CTE and derived-table parity tests to CrossCutting.Tests #211

Copy link
Copy link

Description

@DaveRMaltby
Issue body actions

Discovered by: /uber-report 2026-05-10 (SqlBuildingBlocks QA)

Context

CrossDialectParityTests.cs uses [Theory] + [MemberData] to verify the same SQL produces equivalent ASTs across all four grammar dialects. It covers basic SELECT, ORDER BY, GROUP BY/HAVING, INNER JOIN, INTERVAL window-frame bounds, and DML basics.

Waves 10 and 16 added CTE resolution and derived-table materialization. Each dialect''s integration tests exercise these independently, but no single [Theory] parses the same CTE or derived-table SQL through all four grammars and compares the resulting AST structures.

Proposed Work

Add to CrossDialectParityTests.cs:

  1. Cte_NonRecursive_ProducesEquivalentAst[Theory] over all 4 SelectGrammars; parses WITH x AS (SELECT a FROM tbl WHERE x > 1) SELECT a FROM x; asserts selectStmt.Ctes.Count == 1, CTE name, and selectStmt.Table is SqlCteTable.
  2. DerivedTable_InFrom_ProducesEquivalentAst[Theory] over all 4 SelectGrammars; parses SELECT dt.a FROM (SELECT a FROM tbl WHERE x > 1) AS dt; asserts FROM table is SqlDerivedTable with the expected inner table name.

Note: recursive CTE cross-dialect is a separate follow-up (dialect support not fully validated across all four).

Acceptance Criteria

  • Both [Theory] methods cover all 4 grammar dialects in their MemberData
  • CTE parity test asserts SqlCteTable type on the rewritten FROM reference
  • Derived-table parity test asserts SqlDerivedTable type on the FROM reference
  • All 8 new theory cases pass under dotnet test --configuration Release
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.