A
A
Alexander2016-03-02 16:13:47
MySQL
Alexander, 2016-03-02 16:13:47

Qt, mysql how to find out about updating in a table?

Hello. I decided to add a check "whether it needs to be updated" to the loading code from the table. In general, I assembled myself such a bike:

QSqlQuery query;
     query.exec ("show table status from "+base);
     while (query.next() && query.value(0).toString()!=table)
     {}
     if  (query.value(12).toString() != updatecheck || query.value(12).toString()=="")
     { и пошла загрузка

With this method, the request to display information for all tables is not particularly pleasing + on some servers, update_time is simply not fixed and the field always remains empty.
Actually the questions are as follows:
what other methods are there?
Method by id of the last update - if the same already existing record was updated twice - there will be no download.
It is possible according to a pre-installed trigger, but this means that it must be + triggers slow down the work of the database as a whole, don't they?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
magazovski, 2016-04-02
@magazovski

You can reliably monitor database updates through the replication stream.
Here is a library https://github.com/Begun/libslave

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question