Bug #1327 Client event notification

Submitted: 18 Sep 2003 0:46 Modified: 28 Nov 2005 9:41
Reporter: Erland Lewin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[18 Sep 2003 0:46] Erland Lewin
Description:
I would like functions/SQL commands in the MySQL API/Language so that a client application can be notified when things happen in the database.

I am considering writing a server that could wait until a row is created in a certain table, and then take action depending on the contents of that row.

How to repeat:
Duh! It's a Feature Request!

Suggested fix:
Instead of polling the table, a blocking SQL call such as "WAIT UNTIL TABLE_INSERTION( <table> )" would be a nice solution. 

Note that this could also be solved by asynchronous callbacks, but just as well, and probably simpler implementationwise by calls which block until a condition is satisfied. This lets the client handle asynchronicity by having multiple threads.

Note that this is different from Triggers in that it is a client application that is notified rather than code in the server.
[26 Nov 2005 12:22] Valeriy Kravchuk
Thank you for a feature request. 

I am not sure that server should bother with any callbacks set by clients. If client want to check something, it should try. Poll is a good way to do it. And you may create a threaded client applications for MySQL, really (see http://dev.mysql.com/doc/refman/5.0/en/threaded-clients.html). 

Can you provide any example of other DBMS that does what you asked for?
[5 Aug 2013 19:32] Daniƫl van Eeden
Please keep it somewhat compatible to LISTEN/NOTIFY in PostgreSQL.

http://www.postgresql.org/docs/devel/static/sql-listen.html
http://www.postgresql.org/docs/devel/static/sql-notify.html

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.