往期文章
8-MySQL OCP认证考试指南 连接情况监控 mysqlbackup
7-MySQL OCP认证考试指南 远程连接 索引基数 查询优化 日志空间清理
6-MySQL OCP认证考试指南 表空间类型 数据文件配置 GTID复制配置
题目原文翻译
Question 161:
The languages table uses MyISAM and the countries table uses the InnoDB storage engine. Both tables are empty. Examine these statements:
BEGIN;
INSERT INTO languages(lang) VALUES("Italian");
INSERT INTO countries(country) VALUES("Italy");
ROLLBACK;
What is the content of both tables after executing these statements?
选项与答案:
✅ D) languages has one row, countries has none.
❌ A) countries has one row, languages has none.
❌ B) Both tables have one row.
❌ C) Both tables are empty.
知识点深度剖析
核心考点:存储引擎的事务支持差异
-
MyISAM(非事务引擎)特性:
-
无事务支持: BEGIN/ROLLBACK对MyISAM表无效 -
即时持久化: INSERT操作立即写入磁盘 -
执行结果: SELECT * FROM languages;
/*
+---------+
| lang |
+---------+
| Italian |
+---------+
*/ -
InnoDB(事务引擎)特性:
-
完整ACID支持: ROLLBACK撤销未提交事务 -
数据回滚: INSERT操作被完全撤销 -
执行结果: SELECT * FROM countries;
/*
Empty set
*/
二、事务流程解析
sequenceDiagram
用户->>+MyISAM: INSERT INTO languages
MyISAM-->>-用户: 立即持久化(无法回滚)
用户->>+InnoDB: INSERT INTO countries
用户->>InnoDB: ROLLBACK
InnoDB-->>-用户: 撤销INSERT操作
存储引擎事务支持矩阵
| 特性 |
|
|
|---|---|---|
| 事务支持 |
|
|
| 回滚能力 |
|
|
| 崩溃恢复 |
|
|
| 锁机制 |
|
|
掌握存储引擎核心差异,轻松攻克MySQL OCP事务管理考点! ⚙️
160道题目解析
《MySQL OCP认证考试指南(1Z0-908)》完整题目解析文档可通过网盘分享链接:

