mysql - 对同一个表同时更新2条记录,但更新不同字段,会不会造成数据丢失?
ringa_lee
ringa_lee 2017-04-17 15:23:33
0
3
693

运营要求修改某条记录的权重,但用户参与的时候,会对另外一个字段更新,如果用户和运营的操作是同时进行的话,会不会导致前者或者后者更新丢失 ?

ringa_lee
ringa_lee

ringa_lee

reply all(3)
PHPzhong

Let’s put it this way. When data is updated, a write lock is added. When another operation is to be written, it will enter waiting. until the write lock is released.

阿神

Updating different fields will not work, provided that each of your update statements only updates one field

迷茫

No, make sure the where condition of update is correct

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!