Report for week 10:

Hello!

Report for Week 10:

Hello!

This week I worked on adding system variable feature_insert_returning which is useful for feedback plugin. This variable increments each time INSERT...RETURNING or REPLACE...RETURNING is used. Before beginning, I did some reading about feedback plugin and referred feature_subquery for adding feature_insert_returning. Initially I was facing difficulty in finding the test file that was to be updated. I was searching for test file in sys_vars test suite. Zulip conversation helped me find the right test file and also a missed step for publishing variable for SHOW STATUS. I have made necessary changes in the code and have updated the test and result file.

I also found out that the current implementation was not showing the expected output when AUTO_INCREMENT is used and the fields are not given explicitly. On using RETURNING it was showing the value of all the rows in auto_increment field as 0. Fixed that by calling send_data() after write_record(). This also fixed another thing. The previous implementation, for INSERT ... ON DUPLICATE KEY UPDATE...RETURNING was not showing the updated value in the result set.
Example: If the table t1 has 1 row: id1=1 and val1='A'.
The below statement
INSERT INTO t1(id1,val1) VALUES(1,'B') ON DUPLICATE KEY UPDATE val1='C' returning *;
was showing id1=1 and val='B' for the result even if it inserts val1='C'. Now it is fixed and is returning val1='C'.
I have updated the result file for insert_returning.

I also fixed line endings for tests and added more comments to make our implementation more understandable. I github repo is up to date with the latest changes.

Regards,
Rucha Deodhar.