flux-pr-1839
sqlparser-rs (Rust) · W2 · GPT-5.1 Codex Mini
Tests passed. 1/1 commands passed. Strength: strong.
env PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin cargo test --all-featuresPartial score: 1/1
Trajectory
codex · partial order onlyprovider-native trajectory captured; validation and decision steps are appended with coarse ordering only
Quality
Equivalence Reasoning
behavioral
The patch implements most MSSQL `CREATE FUNCTION` extensions (optional `AS`, table-valued returns including `@table TABLE(...)`, and column constraints), but it does not clearly implement the required bare `RETURN SELECT ...` path in parser logic (it routes through `parse_expr()` instead of explicit `SELECT` parsing as in the intended change). It also introduces a broader AST/API redesign (`CreateFunctionReturnType`) rather than extending existing `DataType`/function-body forms, which risks incompatibility with expected behavior/tests.
Code Review
The patch only partially addresses the MSSQL TVF requirements and introduces high-risk AST API changes; it is unlikely to fully satisfy the intended PR behavior.
MSSQL function bodies route `RETURN` to `CreateFunctionBody::Return(self.parse_expr()?)`. The intended change requires support for bare `SELECT` after `RETURN`, which typically needs explicit SELECT parsing; this patch does not add that branch.
Changing `CreateFunction.return_type` to a new enum is a broad API break and diverges from the targeted extension pattern (extending `DataType`/body variants). This likely causes compatibility and downstream construction/matching regressions.
`parse_mssql_create_function_return_type` accepts `RETURNS @name TABLE` with no `(...)` because column parsing is optional, but named table TVF return definitions should require explicit columns.
The parser makes `AS` optional but maps `RETURN` to the generic `Return` body variant; there is no dedicated `AS RETURN` representation/display path, so round-trip formatting for MSSQL-specific forms can be lost.