Home >Database >Mysql Tutorial >mysql非行级所表处理行级锁定_MySQL

mysql非行级所表处理行级锁定_MySQL

WBOY
WBOYOriginal
2016-06-01 13:43:131119browse

bitsCN.com
我们通常能使用代码来处理行级锁定方面的需求。在某些情况下,实际上不需要它,InnoDB表支持行级锁定。通过

MyISAM表,能够在表中使用标志列,并完成类似下面的操作: UPDATE tbl_name SET row_flag=1 WHERE id=ID;如果找到行,而且原始行中的row_flag不是1,对于受影响的行数,MySQL返回1。 你可以认为MySQL将前述查询更改为: UPDATE tbl_name SET row_flag=1 WHERE id=ID AND row_flag 1; 
  作者 fzxu_05 bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn