MySQL手动执行rollback,内部实现分析
-- 测试手动回滚操作 -- 1手动开启事务 START TRANSACTION -- 2执行更新操作语句 UPDATE FraBakNtuAnalysize SET IsDeleted = 0 WHERE ColData = '2020-02-10' -- 3更新后查询 SELECT DISTINCT DATE_FORMAT( ColData, '%Y-%m-%d' ) AS ColData, IsDeleted FROM FraBakNtuAnalysize WHERE ColData = '2020-02-10' -- 手动执行回滚操作 ROLLBACK -- 查询回滚后,更新操作之前的数据,即未执行更新操作时候的原始数据 SELECT DISTINCT DATE_FORMAT( ColData, '%Y-%m-%d' ) AS ColData, IsDeleted FROM FraBakNtuAnalysize WHERE ColData = '2020-02-10' -- 涉及概念 undolog redolog 等等
undolog redolog binlog 概念阐述:有时间再写
新鲜刺激的东西永远都有,玩之前掂量掂量自己几斤几两