refactor(sql): promote the single-row limit onto ISqlDialect
Claude-Session: https://claude.ai/code/session_01GASWkNEi68FSCtvr6rLoEW
This commit is contained in:
@@ -48,6 +48,19 @@ public class SqlServerDialectTests
|
||||
d.ListColumnsSql.ShouldContain("@table");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleRowLimit_isTSqlsTop1_inThePrefixPosition_withItsOwnTrailingSpace()
|
||||
{
|
||||
var d = new SqlServerDialect();
|
||||
|
||||
// The planner concatenates "SELECT " + prefix + columns with no separator of its own, so the
|
||||
// trailing space belongs to the fragment. T-SQL has no end-of-statement limit clause.
|
||||
d.SingleRowLimitPrefix.ShouldBe("TOP 1 ");
|
||||
d.SingleRowLimitSuffix.ShouldBe("");
|
||||
string.Concat("SELECT ", d.SingleRowLimitPrefix, "[a]", d.SingleRowLimitSuffix)
|
||||
.ShouldBe("SELECT TOP 1 [a]");
|
||||
}
|
||||
|
||||
// ---- extra guards on the injection boundary (beyond the plan's golden set) ----
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user