[MDEV-13502] [DRAFT] Support external references in derived tables Created: 2017-08-11 Updated: 2017-08-11 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
A motivating example of the CONNECT BY task includes a subquery with outer
A problem with outer references comes from this:
Attached is a patch by igor which adds support for outside references in the parser. The execution part is not done yet, though. This task is about adding support for query execution. |
| Comments |
| Comment by Sergei Petrunia [ 2017-08-11 ] | |||||||||||||||||||||||||||||||||||||||||
|
Quoting from Igor's email: With the above changes I had the following results:
delete from t2 where a=7;
Of course the result sets are incorrect because the derived table now is filled only once. The refill is controlled by the flag JOIN_TAB::preread_init_done. So when resolving an external reference within the specification of a derived table we have to attach a pointer every time when we read a new row from the derived table the flag preread_init_done for DT must be set to off. So the first task would be : For each table T build the lists of pointers to all derived tables that refer to some fields of T . |