[Maria-developers] Some questions on GSOC project User Defined Event
Hi, what is the difference between a trigger and user defined event? In postgres there is a clear distintion between trigger and event trigger. Triggers are activated when DML statements are executed whereas event triggers are activated when DDL statements are executed. But in soliddb (from which our post in JIRA page is inspired), it seems like user defined events can be activated for DML statements. What is it that can't be done with triggers and can be done with user defined event? Why is the restriction that events can only be posted and received by stored procedures only? Cheers, Savita
you should read the following post: http://www.sitepoint.com/how-to-create-mysql-events/ -- Regards, Kalyankumar Ramaseshan On Sat, Mar 8, 2014 at 10:59 PM, Savita Agrawal <savitarit0@gmail.com> wrote:
Hi,
what is the difference between a trigger and user defined event?
In postgres there is a clear distintion between trigger and event trigger. Triggers are activated when DML statements are executed whereas event triggers are activated when DDL statements are executed.
But in soliddb (from which our post in JIRA page is inspired), it seems like user defined events can be activated for DML statements. What is it that can't be done with triggers and can be done with user defined event?
Why is the restriction that events can only be posted and received by stored procedures only?
Cheers, Savita
_______________________________________________ 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 Kalyan, Event support is already there in mariadb. Events are the jobs which are run in certain time interval. I am asking about a new project idea which is mentioned in mariadb gsoc page. It is unclear to me, what are the use cases of user defined events( Events and user defined events are not the same, simply because it is mentioned in the page as a new project idea. :) ) As far as I know user defined events are supposed to save applications resources used in polling. But I think the application developer could have created a trigger and udf and use lib_mysqludf_sys<https://github.com/mysqludf/lib_mysqludf_sys#readme> to invoke external application. But there are security issues in this method. Is it the primary/only reason for this project? On Sun, Mar 9, 2014 at 12:15 AM, Kalyankumar Ramaseshan < rkalyankumar@gmail.com> wrote:
you should read the following post:
http://www.sitepoint.com/how-to-create-mysql-events/
-- Regards, Kalyankumar Ramaseshan
On Sat, Mar 8, 2014 at 10:59 PM, Savita Agrawal <savitarit0@gmail.com> wrote:
Hi,
what is the difference between a trigger and user defined event?
In postgres there is a clear distintion between trigger and event trigger. Triggers are activated when DML statements are executed whereas
event triggers are activated when DDL statements are executed.
But in soliddb (from which our post in JIRA page is inspired), it seems
like user defined events can be activated for DML statements. What is it that can't be done with triggers and can be done with user defined event?
Why is the restriction that events can only be posted and received by
stored procedures only?
Cheers, Savita
_______________________________________________ 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, If we want the application developers to take advantage from events occurring on a table then we could reuse a plugin from drizzle database which one of friends developed as part of gsoc last year. This plugin allows the drizzle client to call a function wait_for(type_of_event, table_name, num_of_events, time_out) and returns when this event occurs in the table the given number fo times. Currently drizzle uses this in their replication slave as well. I am not sure how stable this plugin is. p.s.: I apologize for sending so many emails. On Sun, Mar 9, 2014 at 1:08 AM, Savita Agrawal <savitarit0@gmail.com> wrote:
Hi Kalyan,
Event support is already there in mariadb. Events are the jobs which are run in certain time interval. I am asking about a new project idea which is mentioned in mariadb gsoc page. It is unclear to me, what are the use cases of user defined events( Events and user defined events are not the same, simply because it is mentioned in the page as a new project idea. :) )
As far as I know user defined events are supposed to save applications resources used in polling. But I think the application developer could have created a trigger and udf and use lib_mysqludf_sys<https://github.com/mysqludf/lib_mysqludf_sys#readme> to invoke external application. But there are security issues in this method. Is it the primary/only reason for this project?
On Sun, Mar 9, 2014 at 12:15 AM, Kalyankumar Ramaseshan < rkalyankumar@gmail.com> wrote:
you should read the following post:
http://www.sitepoint.com/how-to-create-mysql-events/
-- Regards, Kalyankumar Ramaseshan
On Sat, Mar 8, 2014 at 10:59 PM, Savita Agrawal <savitarit0@gmail.com> wrote:
Hi,
what is the difference between a trigger and user defined event?
In postgres there is a clear distintion between trigger and event trigger. Triggers are activated when DML statements are executed
whereas event triggers are activated when DDL statements are executed.
But in soliddb (from which our post in JIRA page is inspired), it seems
like user defined events can be activated for DML statements. What is it that can't be done with triggers and can be done with user defined event?
Why is the restriction that events can only be posted and received by
stored procedures only?
Cheers, Savita
_______________________________________________ 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, Savita! On Mar 09, Savita Agrawal wrote:
If we want the application developers to take advantage from events occurring on a table then we could reuse a plugin from drizzle database which one of friends developed as part of gsoc last year. This plugin allows the drizzle client to call a function wait_for(type_of_event, table_name, num_of_events, time_out) and returns when this event occurs in the table the given number fo times. Currently drizzle uses this in their replication slave as well. I am not sure how stable this plugin is.
Yes, it's similar, in a sense. But our GSoC task is about SQL interface for this feature, not about protocol or C-API changes. Regards, Sergei
Hi, Savita! On Mar 09, Savita Agrawal wrote:
As far as I know user defined events are supposed to save applications resources used in polling. But I think the application developer could have created a trigger and udf and use lib_mysqludf_sys to invoke external application. But there are security issues in this method. Is it the primary/only reason for this project?
It has little to do with external applications. The idea is to be able to wait for something to happen. It might be used with external applications, I agree: WAIT EVENT WHEN mysqldump_finished BEGIN ... END and then run mysqldump (in another window) that will POST mysqldump_finished. But waiting could also be useful without external applications. Regards, Sergei
Hi, Savita! On Mar 08, Savita Agrawal wrote:
what is the difference between a trigger and user defined event?
A main difference: a trigger is automatially run by DBMS when something happens. User defined event - you need to wait for it, it's more procedural programming.
In postgres there is a clear distintion between trigger and event trigger. Triggers are activated when DML statements are executed whereas event triggers are activated when DDL statements are executed.
No, that's unrelated.
But in soliddb (from which our post in JIRA page is inspired), it seems like user defined events can be activated for DML statements. What is it that can't be done with triggers and can be done with user defined event?
Waiting for something to happen. You cannot wait with a trigger.
Why is the restriction that events can only be posted and received by stored procedures only?
I'd say, events can be posted from anywhere, not only a stored procedure. But received - yes, only there, because we don't support compund statements outside of a stored routine yet. Regards, Sergei
participants (3)
-
Kalyankumar Ramaseshan
-
Savita Agrawal
-
Sergei Golubchik