The mysql update data increases the field amount and returns 1, but the final data is not updated.

problem description

the system has a way to increase the user"s balance. Use mysql to increase the balance field update table set column = column + n . The database uses the rds, version of aws MySQL 5.6.27

.

the environmental background of the problems and what methods you have tried

occasionally the amount is not added, but the printed log shows normal, and 1 is returned after update. Using (java+spring+mybatis), at first the default update returns the number of matched, and then the number of affected is changed to 1. But the result is still not modified successfully

the following log:

add_point, count:1, user_id:XXX, point:XXX

related codes

update user_info set point = point + -sharp{point} where id = -sharp{userId}

what result do you expect? What is the error message actually seen?

expect the user balance to be added correctly, but not actually. But my own unit test, running multiple threads has not been able to reproduce.

Aug.19,2021
Is

rolled back with an exception


plus transaction commit?

Menu