In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "MYSQL GAP lock in the same query segment can not be compatible", in daily operation, I believe many people in MYSQL GAP lock in the same query segment can not be compatible with the problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, I hope to answer everyone "MYSQL GAP lock in the same query segment can not be compatible" doubts helpful! Next, please follow the small series to learn together!
MYSQL lock, has always been a hot spot of research, which GAP lock research has been very HOT, if someone asks, in the same query segment, whether GAP lock can be "compatible." How do you answer? We don't answer directly here. Let's do an experiment.
Let's be clear about how this experiment was done.
use test;
CREATE TABLE IF NOT EXISTS `gap_test`(
`id` INT UNSIGNED AUTO_INCREMENT,
`name` VARCHAR(20) ,
`age` tinyint ,
`date` DATETIME,
PRIMARY KEY ( `id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 row_format = DYNAMIC;
insert into `gap_test` (name,age,date) values ('austin',18,now());
insert into `gap_test` (name,age,date) values ('tim',28,now());
insert into `gap_test` (name,age,date) values ('johnny',16,now());
insert into `gap_test` (name,age,date) values ('jason',17,now());
insert into `gap_test` (name,age,date) values ('winnset',38,now());
create index ix_gap_test_age on gap_test(age);
Here's the initial data.
Scenario 1,
Session 1
Session 2
Below we look at the lock information
lock generated, but no gap lock
2 Case 2
session 1
session 2
information
case 3
session 1
Session 2
results
case 4
session 1
session 2
The result is unlocked.
case 5
session 1
session 2
results
case 6
session 1
session 2
results
case 7
session 1
session 2
results
case 8
session 1
session 2
results
At this point, the study of "MYSQL GAP lock can be compatible in the same query segment" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.