set autocommit=0; update tba set name=1 where id=1; update tbb set name=2 where id=1; commit; set autocommit=1;
commit以上的sql相当于一个事务,在不commit时,其他会话时看不到结果,如果此时其他会话更新相同的数据,会堵塞等待。