Commit 23c3cf5
Wrap a table-valued function in a derived table after LATERAL. Fix #1277
VisitCrossApply and VisitOuterApply already know that Firebird will not take a
bare source after LATERAL: both special-case a TableExpression and emit
(SELECT * FROM "T") AS "t". The same branch was missing for a
TableValuedFunctionExpression, so a correlated queryable function was emitted as
a bare call and the statement did not parse:
JOIN LATERAL "GetCustomerOrderCountByYear"("c"."Id") AS "g" ON TRUE
-> Dynamic SQL Error, Token unknown
It now emits the wrapped form, with the alias on the derived table so the rest of
the statement keeps referring to it unchanged:
JOIN LATERAL (SELECT * FROM "GetCustomerOrderCountByYear"("c"."Id")) AS "g" ON TRUE
Argument rendering goes through the existing GenerateList helper rather than a
new loop.
UdfDbFunctionFbTests: Failed 12 -> 0, Passed 84 -> 96, Skipped 10, Total 106.
No other test moved. The whole functional suite is Passed 14167, Failed 0,
Skipped 1113, Total 15280, and FirebirdSql.EntityFrameworkCore.Firebird.Tests is
Passed 102, Failed 0. Verified against Firebird 5.0.3.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 869554d commit 23c3cf5
1 file changed
Lines changed: 29 additions & 0 deletions
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
301 | 307 | | |
302 | 308 | | |
303 | 309 | | |
| |||
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
328 | 340 | | |
329 | 341 | | |
330 | 342 | | |
| |||
334 | 346 | | |
335 | 347 | | |
336 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
337 | 366 | | |
338 | 367 | | |
339 | 368 | | |
| |||
0 commit comments