Re: [Maria-developers] [GSOC 2014] "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" Project
Hi, Sriram! First: please don't forget to cc: the list maria-developers@lists.launchpad.net Thank you. On Mar 18, sriram patil wrote:
Hi Sergei,
I was going through the source code and was able to figure out the flow of query execution and major functions through which a query goes before execution.
The query execution majorly dwells in the "sql" directory of the source code. So, I think I will have to make changes in the following files throughout the project,
- sql_parse.cc (do_command, dispatch_command, mysql_execute_command)
Yes. And also sql_yacc.yy - to extend the parser. And the implementation of these commands, for example, sql_acl.cc for CREATE/DROP USER, sql_trigger.cc for CREATE/DROP TRIGGER, etc.
- sql_prepare.cc (Prepared_statement::execute_loop, Prepared_statement::execute)
No, hopefully, this will work automatically.
What I am not sure about is will I have to create a handler for some of these commands?
You are not creating new commands
And will lower level storage engine code changes required?
I don't think so.
I am interested to work on "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" project as part of GSOC 2014. I want to apply my subject knowledge at a bigger level which will also give me an idea about the practical issues while implementing the features.
Regards, Sergei
Hi, Sriram! On Mar 18, Sriram Patil wrote:
Hi Sergei,
Thank you for such a quick reply. I will look into the files you have mentioned.
Also, is there any particular format for the proposal draft? Or may be if you expect some points to be mentioned clearly in the proposal draft.
No particular format, look at templates of other organizations, if you want something to start from. You could mention, for example, what exactly do you plan to do in this project, how, the timeline. A bit about yourself. And so on. Regards, Sergei
Hi Sergei, I studied lex and yacc and understood complete parser written in sql_yacc.yy. Also went through the constants and symbols declared in lex.h, sql_yacc.h, sql_cmd.h. I found out that OR REPLACE and IF NOT EXISTS is already implemented for tables. The IF NOT EXISTS rule is also defined for index in yacc file but not handled in the execution code. And for other object types we need to add the rules in yacc files and also need to change the code in "mysql_create_<object_type>" functions in respective files. The OR REPLACE and IF NOT EXISTS are handled in the create execution itself. I found two flags in LEX class which are used for the purpose, create_info.options and check_exists. So, are all the things that I have compiled correct? I have an initial draft of my proposal ready. I will upload it on the GSOC portal today, please review. Should I also email the same to you? Looking forward to your reply. Thanks, Sriram On Tue, Mar 18, 2014 at 9:53 PM, Sergei Golubchik <serg@mariadb.org> wrote:
Hi, Sriram!
On Mar 18, Sriram Patil wrote:
Hi Sergei,
Thank you for such a quick reply. I will look into the files you have mentioned.
Also, is there any particular format for the proposal draft? Or may be if you expect some points to be mentioned clearly in the proposal draft.
No particular format, look at templates of other organizations, if you want something to start from.
You could mention, for example, what exactly do you plan to do in this project, how, the timeline. A bit about yourself. And so on.
Regards, Sergei
Hi, sriram! On Mar 19, sriram patil wrote:
Hi Sergei,
I studied lex and yacc and understood complete parser written in sql_yacc.yy. Also went through the constants and symbols declared in lex.h, sql_yacc.h, sql_cmd.h.
Right
I found out that OR REPLACE and IF NOT EXISTS is already implemented for tables. The IF NOT EXISTS rule is also defined for index in yacc file but not handled in the execution code. And for other object types we need to add the rules in yacc files and also need to change the code in "mysql_create_<object_type>" functions in respective files.
Right
The OR REPLACE and IF NOT EXISTS are handled in the create execution itself. I found two flags in LEX class which are used for the purpose, create_info.options and check_exists.
So, are all the things that I have compiled correct?
Yes
I have an initial draft of my proposal ready. I will upload it on the GSOC portal today, please review. Should I also email the same to you?
No, please don't. I get an email automatically for every new proposal. Regards, Sergei
Hi Sriram. If you could add "CREATE VIEW … FORCE" too, that would be awesome. See the Oracle Enterprise docs for the behavior: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8004.htm Thanks, James. -------------------------------------------- On Wed, 3/19/14, Sergei Golubchik <serg@mariadb.org> wrote: Subject: Re: [Maria-developers] [GSOC 2014] "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" Project To: "sriram patil" <spsrirampatil@gmail.com> Cc: maria-developers@lists.launchpad.net Date: Wednesday, March 19, 2014, 12:22 PM Hi, sriram! On Mar 19, sriram patil wrote:
Hi Sergei,
I studied lex and yacc and understood complete parser written in sql_yacc.yy. Also went through the constants and symbols declared in lex.h, sql_yacc.h, sql_cmd.h.
Right
I found out that OR REPLACE and IF NOT EXISTS is already implemented for tables. The IF NOT EXISTS rule is also defined for index in yacc file but not handled in the execution code. And for other object types we need to add the rules in yacc files and also need to change the code in "mysql_create_<object_type>" functions in respective files.
Right
The OR REPLACE and IF NOT EXISTS are handled in the create execution itself. I found two flags in LEX class which are used for the purpose, create_info.options and check_exists.
So, are all the things that I have compiled correct?
Yes
I have an initial draft of my proposal ready. I will upload it on the GSOC portal today, please review. Should I also email the same to you?
No, please don't. I get an email automatically for every new proposal. Regards, Sergei _______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi James, Replying again cause the text did not appear in the mailing list. Sure, I will try and implement that feature too. Thank you very much for the suggestion. Thanks, Sriram On Thu, Mar 20, 2014 at 4:02 AM, James Briggs <james.briggs@yahoo.com>wrote:
Hi Sriram.
If you could add "CREATE VIEW ... FORCE" too, that would be awesome.
See the Oracle Enterprise docs for the behavior: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8004.htm
Thanks, James.
-------------------------------------------- On Wed, 3/19/14, Sergei Golubchik <serg@mariadb.org> wrote:
Subject: Re: [Maria-developers] [GSOC 2014] "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" Project To: "sriram patil" <spsrirampatil@gmail.com> Cc: maria-developers@lists.launchpad.net Date: Wednesday, March 19, 2014, 12:22 PM
Hi, sriram!
On Mar 19, sriram patil wrote:
Hi Sergei,
I studied lex and yacc and understood complete parser written in sql_yacc.yy. Also went through the constants and symbols declared in lex.h, sql_yacc.h, sql_cmd.h.
Right
I found out that OR REPLACE and IF NOT EXISTS is already implemented for tables. The IF NOT EXISTS rule is also defined for index in yacc file but not handled in the execution code. And for other object types we need to add the rules in yacc files and also need to change the code in "mysql_create_<object_type>" functions in respective files.
Right
The OR REPLACE and IF NOT EXISTS are handled in the create execution itself. I found two flags in LEX class which are used for the purpose, create_info.options and check_exists.
So, are all the things that I have compiled correct?
Yes
I have an initial draft of my proposal ready. I will upload it on the GSOC portal today, please review. Should I also email the same to you?
No, please don't. I get an email automatically for every new proposal.
Regards, Sergei
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi Sriram. 1) Here's a worklog related to your project: WL#3129: Consistent clauses in CREATE and DROP https://dev.mysql.com/worklog/ 2) Maybe you can do a follow-on GSOC next year on this worklog: WL#5047: SQL command class hierarchy. There's lots of low-hanging fruit enhancing SQL options, yet at the same time very useful to end-users. 3) You can see my notes and references for adding new MySQL commands here: Howto Add a New Command to the MySQL Server http://www.jebriggs.com/blog/2013/05/howto-add-a-new-command-to-the-mysql-se... James. -------------------------------------------- On Thu, 3/20/14, sriram patil <spsrirampatil@gmail.com> wrote: Subject: Re: [Maria-developers] [GSOC 2014] "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" Project To: "James Briggs" <james.briggs@yahoo.com> Cc: maria-developers@lists.launchpad.net Date: Thursday, March 20, 2014, 5:34 AM Hi James, Replying again cause the text did not appear in the mailing list. Sure, I will try and implement that feature too. Thank you very much for the suggestion. Thanks, Sriram On Thu, Mar 20, 2014 at 4:02 AM, James Briggs <james.briggs@yahoo.com> wrote: Hi Sriram. If you could add "CREATE VIEW … FORCE" too, that would be awesome. See the Oracle Enterprise docs for the behavior: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8004.htm Thanks, James.
Hi James, That worklog surely helped me. Now I know what needs to be added for each object type. I have missed three of them while putting up my proposal. Also, it seems the CREATE OR REPLACE and IF [NOT] EXISTS issue is hanging there from a long time. The follow-up project idea is great! That huge switch-case statement in mysql_command_execute can be fixed with the mentioned object oriented approach for command execution. And that blog of yours really simplifies it all. I will need to go through that procedure a lot of times during this project. I am so much excited now after I saw the complete worklog and so many things to work on. Thanks a lot, Sriram On Fri, Mar 21, 2014 at 3:45 AM, James Briggs <james.briggs@yahoo.com>wrote:
Hi Sriram.
1) Here's a worklog related to your project: WL#3129: Consistent clauses in CREATE and DROP https://dev.mysql.com/worklog/
2) Maybe you can do a follow-on GSOC next year on this worklog: WL#5047: SQL command class hierarchy.
There's lots of low-hanging fruit enhancing SQL options, yet at the same time very useful to end-users.
3) You can see my notes and references for adding new MySQL commands here:
Howto Add a New Command to the MySQL Server
http://www.jebriggs.com/blog/2013/05/howto-add-a-new-command-to-the-mysql-se...
James.
-------------------------------------------- On Thu, 3/20/14, sriram patil <spsrirampatil@gmail.com> wrote:
Subject: Re: [Maria-developers] [GSOC 2014] "CREATE OR REPLACE, CREATE IF NOT EXISTS, and DROP IF EXISTS" Project To: "James Briggs" <james.briggs@yahoo.com> Cc: maria-developers@lists.launchpad.net Date: Thursday, March 20, 2014, 5:34 AM
Hi James, Replying again cause the text did not appear in the mailing list. Sure, I will try and implement that feature too. Thank you very much for the suggestion.
Thanks, Sriram
On Thu, Mar 20, 2014 at 4:02 AM, James Briggs <james.briggs@yahoo.com> wrote:
Hi Sriram.
If you could add "CREATE VIEW ... FORCE" too, that would be awesome.
See the Oracle Enterprise docs for the behavior:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_8004.htm
Thanks, James.
participants (3)
-
James Briggs
-
Sergei Golubchik
-
Sriram Patil