问题描述
我正在测试innoDB表中的事务支持,只是出于好奇,我试图在MyIsam表上运行相同的事务,但令人惊讶的是它起作用了.我假设在myIsam表上的查询是一个接一个地执行的,而不是在一个原子操作中执行的,并且我不会从START TRANSACTION以及COMMIT和ROLLBACK操作中得到任何错误.我有兴趣,是MyIsam引擎只是忽略此操作还是执行某些操作?
I was testing transaction support in innoDB tables, and just for the curriosity I tried to run the same transaction on MyIsam table, and surprisingly it worked. I am assuming that on myIsam table queries are executed one after another not in one atomic operation and I don't get any errors from START TRANSACTION and COMMIT and ROLLBACK operations. I am interested, is MyIsam engine just ignoring this operations or does it perform some actions?
推荐答案
MyISAM有效地在自动提交模式下工作(因为它不是事务引擎),而只是忽略提交/回滚.
MyISAM effectively works in auto-commit mode (as it's not a transactional engine), and it just ignores the commit/rollback.
实际上,存储引擎是MySQL体系结构中的另一层,与SQL解析器分离,SQL层使用较低级别的API与存储引擎进行通信,这就是存在通用SQL和引擎并支持不同子集的原因的特色.您可以在此处
Actually storage engine is a different layer in the MySQL architecture, separated from the SQL parser, the SQL layer communicates to the storage engine with lower-level API, and that's the reason there is a common SQL and engines, supporting different subset of featured. You can see very high-level overview of the architecture here
这篇关于MyIsam引擎交易支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!