Class E201_NullCheckBaseIdAmbiguity
Reproduces the ambiguous _id defect in the PVT CTE.
See docs/BUG_PVT_NULLCHECK_AMBIGUOUS_ID.md.
A props filter == null switches the PVT CTE into the two-table form
(FROM _objects o_src LEFT JOIN _values v), while the base-field filter
is compiled without a table alias. _id is the only column present in
BOTH _objects and _values, so the combination produces
column reference "_id" is ambiguous.
Four cases: two controls that must stay green, the repro, and a control that
pins the diagnosis to _id specifically (_id_parent exists only
in _objects, so it must stay green even in the two-table form).
Scope: verified against redb.Postgres.Pro. MSSql.Pro and SQLite.Pro generate
the same shape but are out of scope for now.
[ExampleMeta("E201", "NullCheck + base Id: ambiguous _id in PVT CTE", "Query", ExampleTier.Pro, 200, new string[] { "Sql", "Debug", "Bug", "Pro", "Pvt", "NullCheck" }, RelatedApis = new string[] { "IRedbQueryable.ToSqlStringAsync", "IRedbQueryable.WhereRedb" })]
public class E201_NullCheckBaseIdAmbiguity : ExampleBase
Inheritance
Inherited Members
Methods
RunAsync(IRedbService)
Run the example and return result.
public override Task<ExampleResult> RunAsync(IRedbService redb)