← Back to team overview

maria-developers team mailing list archive

Re: Getting started with the coding.

 

Hello Sriram,



On 05/21/2014 07:47 AM, sriram patil wrote:
Hi Alexander,

I have started working on "CREATE OR REPLACE DATABASE" implementation. I
thought this one has the least complexity among all the other commands.
I am getting my hand-on debugging the source code too.

I have made the required changes in sql_yacc.yy. The command is parsed
properly. Handled the error where CREATE OR REPLACE and IF NOT EXISTS
cannot occur at the same time.

Excellent.

I just added a new table with all objects into
https://mariadb.atlassian.net/browse/MDEV-5359
indicating which objects support/miss the features.
Please have a look.


After finishing with DATABASE, I'd suggest to make
"DROP IF EXISTS" work for the remaining two object
types: USER and ROLE, so we have "DROP IF EXISTS"
working in all contexts.

Then implement "CREATE OR REPLACE" and "CREATE IF NOT EXISTS"
for the objects missing these features.

Note, "CREATE IF NOT EXISTS" is more important than "CREATE OR REPLACE".



This is how I am thinking of proceeding with the implementation,

In method mysql_create_db after checking the flag HA_LEX_CREATE_REPLACE.
I am removing the database by calling mysql_rm_db and then the current
implementation will take care of creating the new db with the same name.

This seems correct? Or is there anything I need to consider?

Looks fine from a glance. Please send the current patch.

Thanks.


Thanks,
Sriram


References