maria-developers team mailing list archive
Mailing list archive
Report for week 5:
This week I was able to make INSERT...SELECT...RETURNING return the listed
fields from the INSERT table. From the parsing stage in sql_parse.cc, the
context and the first table gets masked , so I stored the previous values
in another variable just before they are masked and swapped it before and
after calling setup_fields() and setup_wild in select_insert :: prepare().
This makes the items and expressions in returning_list point to insert
table before the above functions are called, and then swapping it back for
the rest of the prepare() function. Here is the link to test cases and code:
Test and result:
I also tested my code for some complex queries like subquery in RETURNING
and checked if it outputs error message when invalid expressions are used.
It was working correctly. Here is the link for the same:
I was also thinking about other ways to get the items and expressions in
returning_list, this is one of the ways in which it could be implemented.
the link to GDoc:
I understand this is too big a change for the grammar and I am trying to
find alternate solution.
I also changed the variable names and made them more descriptive.