当前位置:网站首页>mysql间隙锁失效?
mysql间隙锁失效?
2022-07-30 05:40:00 【CSDN问答】
想自己测试下间隙锁现象,于是就按照一些博客上的步骤操作,结果并没有出现什么间隙锁的现象,有谁遇到过吗?
下面是操作步骤:
CREATE TABLE test.user (id int(11) NOT NULL,name varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,age int(11) NULL DEFAULT NULL,
PRIMARY KEY (id) USING BTREE,
INDEX index_age(age) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
插入数据
1 xiaoming 12
3 xiaohong 20
5 laowang 36
开启两个事务
session1;
start transaction;
select * fro m yser where age=20; 在普通索引 age上加锁 按说会锁住 12,20 20,20 20,36区间
session2
start transaction;
insert into user values(null,"zhangsan",15);
结果session2中的insert语句应该阻塞才对 但是却执行成功了
另外间隙锁测参数已经是开启了
边栏推荐
- Qt实现单击或双击QTableWidge/View表头进行排序
- 函数(c语言)
- 安装pytorch
- C语言自定义类型一网打尽(结构体、位段/位域、枚举、联合体)
- Ranking of grades (Huazhong University of Science and Technology postgraduate examination questions) (DAY 87)
- CISP-PTE Zhenti Demonstration
- 留念 · 大学时代最后的系统设计图
- [Other] DS5
- 卷王的第一篇博客——编程学习的规划
- My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
猜你喜欢
随机推荐
51.N皇后(回溯法)
Solve the problem that the local nacos is not configured but the localhost8848 connection exception always occurs
爬虫数据是如何收集和整理的?
My first understanding of MySql, and the basic syntax of DDL and DML and DQL in sql statements
【C语言】字符串的比较
[详解C语言]一文带你玩转数组
net start mysql MySQL service is starting. MySQL service failed to start.The service did not report any errors.
MySql的初识感悟,以及sql语句中的DDL和DML和DQL的基本语法
你怎么看待scanf()中%d的“吃空白”行为?
字符串(一) 哈希
406.根据身高重建队列
C语言指针(指针数组、数组指针、函数指针、传参、回调函数等)超详细
Qt设置窗口可拖动
pycharm专业版 配置pytest
Socket通信编程
Prime numbers (Tsinghua University computer test questions) (DAY 86)
瑞吉外卖项目:新增菜品与菜品分页查询
C语言入门(前期准备工作)——超级详细的建议和教学,带你顺利跨越编程门槛
C语言自定义类型一网打尽(结构体、位段/位域、枚举、联合体)
pwn-ROP









![[Other] DS5](/img/20/6863bb7b58d2e60b35469ba32e5830.png)