[MDEV-26831] New name resolution Created: 2021-10-14  Updated: 2023-11-30

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: 11.5

Type: New Feature Priority: Critical
Reporter: Oleksandr Byelkin Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Blocks
blocks MDEV-19078 Support lateral derived tables Open
blocks MDEV-32283 CTE renaming columns too early in uni... Open
Relates
relates to MDEV-28196 Correlated derived tables not supported Open

 Description   

To unlock some impossible now features like dependent subqueries in a FROM clause name (but probably not only this) resolution should be redone to separate it from other info collecting.

  • First pass should create array of name of fields (Item_type_holder) for SELECTs and TABLE_LISTs, including unfolding "*" in SELECTs (inner -> out, Post-order tree traversal) (actually it would be better to have just iterators fr fields, so it is not needed)
  • Second pass (or two) only create connection between place of name usage (Item_ident) and a field descriptor in the table above (possible in any order now) (can be done by pre-made on parser list of names which need to be resolved)
  • Third pass collect type information for all Items, calculate type compatibility (Post-order tree traversal).
  • Forth pass "normalize" tree:
    • add correct Item in place of resolved names
    • constant calculation/conversion
    • ...

All changes made once and on statement mem_root memory.



 Comments   
Comment by Oleksandr Byelkin [ 2023-03-08 ]

Where we resolve names:

  • tables
    • usual tables
      • hash
      • array
    • views
    • nornal joins
  • select list
  • SP variables

Other objects to resolve (probably out of this MDEV context):

  • order/group elements
  • aggregate functions
Generated at Thu Feb 08 09:48:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.