MySQL Forums
Forum List  »  InnoDB

cache affects update
Posted by: Mauricio Chamati
Date: February 04, 2016 10:12AM

I am doing a very common update in database, lets assume it is:
update table_generic set amount = amount + in_amount where id = 1000;

Scenario: This update is used in a procedure that interacts with other huge tables (15MM records). This procedure is invoked as a queue about 20 times in 1 second. I am sure the queue works, according to the logs.

Then, the last possibility is that MySQL, in this particular update, did once (among millions invokations) used a cached value for amount field.

So, considering the procedure variable in_amount = 10.5, imagine that the database has the values:

then I updated it to:

then I updated it to:

then, the bug occurs and it gets the cached value for amount field of 10.5, and I get as result of the update:

Does that ever occur to anyone of you? Could that be a possible cause?
Questions are raised as the system is running for the last 3 years with no problem and after a long time of auditing, this is the unique possible cause.

Options: ReplyQuote

Written By
cache affects update
February 04, 2016 10:12AM
February 06, 2016 07:19PM

Sorry, you can't reply to this topic. It has been closed.

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.