Actually I use the following sentence read on another question in this page:
SELECT UPDATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'dbname'
AND TABLE_NAME = 'tabname'
But I think that it is using a lot of process time, it will be more easy if mysql-server sends me a signal when the table is updated so I can wait until my program detects that signal.
Is this possible? I’m programming in C.
Thank you very much.
You can use a trigger combined with a UDF progammed in C(++) to do the notification.
Here’s dummy code.
You’ll have to do a trigger for insert/delete and update. 3x per table.
You cannot add a trigger to the system tables IIRC, because these are really views and not actual tables.
You’ll need to write a UDF in C(++) called
changenotificationthat does the notification for you.Links:
http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html
http://www.mysqludf.org/
http://dev.mysql.com/doc/refman/5.0/en/triggers.html
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html