Commit 9512e45
Emit a table-valued function without LATERAL. Fix #1277
VisitCrossApply and VisitOuterApply put LATERAL in front of whatever EF Core
hands them. In Firebird's grammar LATERAL is a prefix on a derived table only:
<table-primary> ::=
<table-or-query-name> [[AS] correlation-name]
| [LATERAL] <derived-table> [<correlation-or-recognition>]
| <parenthesized-joined-table>
<table-or-query-name> ::=
table-name | query-name | [package-name.]procedure-name [(<procedure-args>)]
A selectable procedure is the other alternative, and its arguments may already
reference streams declared earlier in the FROM clause. So a correlated queryable
function needs no LATERAL - and cannot have one, which is why it did not parse.
JOIN LATERAL "GetCustomerOrderCountByYear"("c"."Id") AS "g" ON TRUE
-- Dynamic SQL Error, SQL error code = -104, Token unknown
JOIN "GetCustomerOrderCountByYear"("c"."Id") AS "g" ON TRUE
-- works, on Firebird 3 as well
The two visitors now share one GenerateApplySource, which emits the call as it
is emitted anywhere else and keeps LATERAL for the sources that need it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent d5982a1 commit 9512e45
1 file changed
Lines changed: 21 additions & 25 deletions
Lines changed: 21 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 288 | + | |
| 289 | + | |
306 | 290 | | |
307 | 291 | | |
308 | 292 | | |
| |||
312 | 296 | | |
313 | 297 | | |
314 | 298 | | |
315 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
316 | 304 | | |
317 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
318 | 316 | | |
319 | 317 | | |
320 | 318 | | |
321 | 319 | | |
322 | | - | |
| 320 | + | |
323 | 321 | | |
324 | 322 | | |
325 | 323 | | |
326 | 324 | | |
327 | 325 | | |
328 | 326 | | |
329 | 327 | | |
330 | | - | |
| 328 | + | |
| 329 | + | |
331 | 330 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | 331 | | |
336 | 332 | | |
337 | 333 | | |
| |||
0 commit comments