Skip to content

Commit 6e1a79b

Browse files
committed
Drop cross-project references from ORM test comments
1 parent ba424cf commit 6e1a79b

3 files changed

Lines changed: 25 additions & 28 deletions

File tree

Tests/Data/ExpressionQueryTranslatorTests.cs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -770,13 +770,13 @@ public void StringConstant_WithMultipleSingleQuotes_ShouldBeParameterized()
770770

771771
#region Closure-capture Chain Parameterization Tests
772772

773-
// Reproduces the EXACT closure shape generated by an async method with two levels
774-
// of nested if-blocks that capture an outer-method local. Mirrors
775-
// <c>BrokerPortfolioRepository.SearchAsync</c>: outer state-machine field
776-
// (tenantId), first if-block DC (referencing the state-machine), and a nested
777-
// else-block DC (referencing the first DC). The lambda inside the inner block
778-
// then reads tenantId through a 3-link chain: innerDC → outerDC → methodDC →
779-
// tenantId. The compiler-generated tree shape is:
773+
// Reproduces the closure shape generated by an async method with two levels
774+
// of nested if-blocks that capture an outer-method local: outer
775+
// state-machine field (tenantId), first if-block DC (referencing the
776+
// state-machine), and a nested else-block DC (referencing the first DC).
777+
// The lambda inside the inner block then reads tenantId through a 3-link
778+
// chain: innerDC → outerDC → methodDC → tenantId. The compiler-generated
779+
// tree shape is:
780780
// MemberAccess(tenantId)
781781
// MemberAccess(CS$&lt;&gt;8__locals1)
782782
// MemberAccess(CS$&lt;&gt;8__locals2)
@@ -962,11 +962,11 @@ public void Where_NavigationProperty_OrContainsFk_EmitsJoin()
962962
}
963963

964964
/// <summary>
965-
/// Reproduction of the downstream Broker failure: an entity with
966-
/// inheritance (TestBrokerBase) carrying [RelationSingle] audit FKs
967-
/// (CreatedBy/ModifiedBy → TestBrokerUser) plus another [RelationSingle]
968-
/// User on the derived entity. Where-predicate on User.Email must emit
969-
/// the INNER JOIN to TestBrokerUser, otherwise SQL Server reports
965+
/// Inheritance + RelationSingle interaction: an entity with
966+
/// <see cref="TestBrokerBase"/> audit FKs (CreatedBy/ModifiedBy →
967+
/// <see cref="TestBrokerUser"/>) plus another [RelationSingle] User on
968+
/// the derived entity. Where-predicate on User.Email must emit the INNER
969+
/// JOIN, otherwise SQL Server reports
970970
/// "multi-part identifier 'User.Email' could not be bound".
971971
/// </summary>
972972
[TestMethod]
@@ -990,12 +990,12 @@ public void Where_BrokerPortfolio_NavigationToUserEmail_EmitsJoin()
990990
}
991991

992992
/// <summary>
993-
/// Reproduction of the original Broker bug: SearchAsync built a single
994-
/// Where with three OR'ed Like predicates over p.User.Email / FirstName /
995-
/// LastName. ORM 1.0.29 translated this without the implicit JOIN, so
996-
/// SQL Server failed with "multi-part identifier 'User.Email' could not
997-
/// be bound". A single INNER JOIN must be emitted, and all three OR
998-
/// branches must reference the joined alias.
993+
/// A single Where with three OR'ed Like predicates over the same
994+
/// navigation (p.User.Email / FirstName / LastName) must emit a single
995+
/// INNER JOIN, and all three OR branches must reference the joined
996+
/// alias. Earlier the translator skipped the implicit JOIN and SQL
997+
/// Server failed with "multi-part identifier 'User.Email' could not be
998+
/// bound".
999999
/// </summary>
10001000
[TestMethod]
10011001
public void Where_BrokerPortfolio_OrAcrossUserColumns_EmitsSingleJoin()
@@ -1017,8 +1017,7 @@ public void Where_BrokerPortfolio_OrAcrossUserColumns_EmitsSingleJoin()
10171017
sql.Contains("[Ecng_TestBrokerUser]").AssertTrue(
10181018
$"Expected join target [Ecng_TestBrokerUser], got: {sql}");
10191019

1020-
// All three branches must qualify columns with the joined alias —
1021-
// the buggy translator emitted bare [Email]/[FirstName]/[LastName].
1020+
// All three branches must qualify columns with the joined alias.
10221021
sql.Contains("[User].[Email]").AssertTrue(
10231022
$"Expected qualified [User].[Email], got: {sql}");
10241023
sql.Contains("[User].[FirstName]").AssertTrue(

Tests/Data/OrmTestEntities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ public async ValueTask LoadAsync(SettingsStorage storage, IStorage db, Cancellat
364364
}
365365

366366
/// <summary>
367-
/// Mirrors BaseBrokerEntity from the Broker project: abstract base with
368-
/// audit FKs as RelationSingle navigation properties.
367+
/// Abstract base with two RelationSingle audit FKs (Created/Modified) for
368+
/// regression tests around FK-cycle resolution and inheritance-driven joins.
369369
/// </summary>
370370
public abstract class TestBrokerBase : IDbPersistable
371371
{

Tests/Data/QueryTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,10 @@ public void Select_Top()
9393
}
9494

9595
/// <summary>
96-
/// Repro for downstream Broker bug: when an entity has [RelationSingle] User,
97-
/// ExpressionQueryTranslator emits an INNER JOIN with alias = nav member name
98-
/// ("User"). Query.Table(name, alias) currently appends the alias *unquoted*,
99-
/// so PostgreSQL receives <c>"User" User</c> and fails with
100-
/// <c>42601: syntax error at or near "User"</c>. Aliases must be quoted just
101-
/// like table names so reserved words don't break the parser.
96+
/// Aliases that collide with reserved words (e.g. <c>User</c> on PostgreSQL)
97+
/// must be quoted just like table names; otherwise the joined SQL ends up
98+
/// with bare <c>"User" User</c> and PostgreSQL reports
99+
/// <c>42601: syntax error at or near "User"</c>.
102100
/// </summary>
103101
[TestMethod]
104102
[DataRow("SqlServer")]

0 commit comments

Comments
 (0)