Details
Description
This is a part of diwas joshi's GSoC project.
Make the parser support
SELECT ... FROM table_func(parameters)
There is no execution yet. Attempt to run the statement should return an error.
The following is expected to work:
- The parser should allow this statement
- setup_tables() in SELECT code should check if parameters are base constants.
- If they are not, emit an error.
- If they are constants (i.e. everything would be ok), emit an error anyway. This way, we can have a minimal test suite.
- name resolution in other parts e.g. UPDATE/DELETE can be ignored for now.
Gliffy Diagrams
Attachments
Issue Links
- is part of
-
MDEV-8100 Table functions (aka SQL functions returning tables)
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
This task required adding another rule for, using table functions in select queries, under table_factor in sql_yacc, but that was creating shift/reduce conflicts. Based on my discussion with Sergei on irc, we realized the problem seems to be in how the grammar handles bison's limitations. So we fixed it by factoring out the conflicting code in two rules into table_factor_part2. This fixed the problem. There was one more requirement of checking if the parameters are base constants or not. This was done by iterating over item_list and using basic_const_item(). Finally the input is getting parsed.