forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rocksdb_bulk_load_allow_sk option in mysqldump - this enables bul…
…k loading secondary keys in mysqldump output Summary: See title Reference Patch: facebook@309f324 Differential Revision: D14864271
- Loading branch information
Showing
6 changed files
with
210 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
create table r1 (id1 int, id2 int, id3 varchar(100), id4 int, value1 int, value2 int, value3 int, value4 int, primary key (id1, id2, id3, id4), KEY (value1, value2, value3)); | ||
insert into r1 values (1,1,1,1,1,1,1,1); | ||
insert into r1 values (1,1,1,2,2,2,2,2); | ||
insert into r1 values (1,1,2,1,3,3,3,3); | ||
insert into r1 values (1,1,2,2,4,4,4,4); | ||
insert into r1 values (1,2,1,1,5,5,5,5); | ||
insert into r1 values (1,2,1,2,6,6,6,6); | ||
insert into r1 values (1,2,2,1,7,7,7,7); | ||
insert into r1 values (1,2,2,2,8,8,8,8); | ||
insert into r1 values (2,1,1,1,9,9,9,9); | ||
insert into r1 values (2,1,1,2,10,10,10,10); | ||
insert into r1 values (2,1,2,1,11,11,11,11); | ||
insert into r1 values (2,1,2,2,12,12,12,12); | ||
insert into r1 values (2,2,1,1,13,13,13,13); | ||
insert into r1 values (2,2,1,2,14,14,14,14); | ||
insert into r1 values (2,2,2,1,15,15,15,15); | ||
insert into r1 values (2,2,2,2,16,16,16,16); | ||
BEGIN; | ||
insert into r1 values (5,5,5,5,5,5,5,5); | ||
update r1 set value1=value1+100 where id1=1 and id2=1 and id3='1'; | ||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!50503 SET NAMES utf8mb4 */; | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
/*!50601 SELECT count(*) INTO @is_mysql8 FROM information_schema.TABLES WHERE table_schema='performance_schema' AND table_name='session_variables' */; | ||
/*!50601 SET @check_rocksdb = CONCAT( 'SELECT count(*) INTO @is_rocksdb_supported FROM ', IF (@is_mysql8, 'performance', 'information'), '_schema.session_variables WHERE variable_name=\'rocksdb_bulk_load\'') */; | ||
/*!50601 PREPARE s FROM @check_rocksdb */; | ||
/*!50601 EXECUTE s */; | ||
/*!50601 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load=1', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @enable_bulk_load */; | ||
/*!50601 EXECUTE s */; | ||
-- CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE='binlog.000001', SOURCE_LOG_POS=5506; | ||
DROP TABLE IF EXISTS `r1`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!50503 SET character_set_client = utf8mb4 */; | ||
CREATE TABLE `r1` ( | ||
`id1` int NOT NULL, | ||
`id2` int NOT NULL, | ||
`id3` varchar(100) NOT NULL, | ||
`id4` int NOT NULL, | ||
`value1` int DEFAULT NULL, | ||
`value2` int DEFAULT NULL, | ||
`value3` int DEFAULT NULL, | ||
`value4` int DEFAULT NULL, | ||
PRIMARY KEY (`id1`,`id2`,`id3`,`id4`), | ||
KEY `value1` (`value1`,`value2`,`value3`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
/* ORDERING KEY (DESC) : (null) */; | ||
|
||
LOCK TABLES `r1` WRITE; | ||
/*!40000 ALTER TABLE `r1` DISABLE KEYS */; | ||
INSERT INTO `r1` VALUES (2,2,'2',2,16,16,16,16),(2,2,'2',1,15,15,15,15),(2,2,'1',2,14,14,14,14),(2,2,'1',1,13,13,13,13),(2,1,'2',2,12,12,12,12),(2,1,'2',1,11,11,11,11),(2,1,'1',2,10,10,10,10),(2,1,'1',1,9,9,9,9),(1,2,'2',2,8,8,8,8),(1,2,'2',1,7,7,7,7),(1,2,'1',2,6,6,6,6),(1,2,'1',1,5,5,5,5),(1,1,'2',2,4,4,4,4),(1,1,'2',1,3,3,3,3),(1,1,'1',2,2,2,2,2),(1,1,'1',1,1,1,1,1); | ||
/*!40000 ALTER TABLE `r1` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
/*!50601 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load=0', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @disable_bulk_load */; | ||
/*!50601 EXECUTE s */; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
|
||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!50503 SET NAMES utf8mb4 */; | ||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | ||
/*!40103 SET TIME_ZONE='+00:00' */; | ||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
/*!50601 SELECT count(*) INTO @is_mysql8 FROM information_schema.TABLES WHERE table_schema='performance_schema' AND table_name='session_variables' */; | ||
/*!50601 SET @check_rocksdb = CONCAT( 'SELECT count(*) INTO @is_rocksdb_supported FROM ', IF (@is_mysql8, 'performance', 'information'), '_schema.session_variables WHERE variable_name=\'rocksdb_bulk_load\'') */; | ||
/*!50601 PREPARE s FROM @check_rocksdb */; | ||
/*!50601 EXECUTE s */; | ||
/*!50601 SET @bulk_load_allow_sk = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load_allow_sk=1', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @bulk_load_allow_sk */; | ||
/*!50601 EXECUTE s */; | ||
/*!50601 SET @enable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load=1', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @enable_bulk_load */; | ||
/*!50601 EXECUTE s */; | ||
-- CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE='binlog.000001', SOURCE_LOG_POS=5506; | ||
DROP TABLE IF EXISTS `r1`; | ||
/*!40101 SET @saved_cs_client = @@character_set_client */; | ||
/*!50503 SET character_set_client = utf8mb4 */; | ||
CREATE TABLE `r1` ( | ||
`id1` int NOT NULL, | ||
`id2` int NOT NULL, | ||
`id3` varchar(100) NOT NULL, | ||
`id4` int NOT NULL, | ||
`value1` int DEFAULT NULL, | ||
`value2` int DEFAULT NULL, | ||
`value3` int DEFAULT NULL, | ||
`value4` int DEFAULT NULL, | ||
PRIMARY KEY (`id1`,`id2`,`id3`,`id4`), | ||
KEY `value1` (`value1`,`value2`,`value3`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
/*!40101 SET character_set_client = @saved_cs_client */; | ||
/* ORDERING KEY (DESC) : (null) */; | ||
|
||
LOCK TABLES `r1` WRITE; | ||
/*!40000 ALTER TABLE `r1` DISABLE KEYS */; | ||
INSERT INTO `r1` VALUES (2,2,'2',2,16,16,16,16),(2,2,'2',1,15,15,15,15),(2,2,'1',2,14,14,14,14),(2,2,'1',1,13,13,13,13),(2,1,'2',2,12,12,12,12),(2,1,'2',1,11,11,11,11),(2,1,'1',2,10,10,10,10),(2,1,'1',1,9,9,9,9),(1,2,'2',2,8,8,8,8),(1,2,'2',1,7,7,7,7),(1,2,'1',2,6,6,6,6),(1,2,'1',1,5,5,5,5),(1,1,'2',2,4,4,4,4),(1,1,'2',1,3,3,3,3),(1,1,'1',2,2,2,2,2),(1,1,'1',1,1,1,1,1); | ||
/*!40000 ALTER TABLE `r1` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
/*!50601 SET @disable_bulk_load = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load=0', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @disable_bulk_load */; | ||
/*!50601 EXECUTE s */; | ||
/*!50601 SET @disable_bulk_load_allow_sk = IF (@is_rocksdb_supported, 'SET SESSION rocksdb_bulk_load_allow_sk=0', 'SET @dummy = 0') */; | ||
/*!50601 PREPARE s FROM @disable_bulk_load_allow_sk */; | ||
/*!50601 EXECUTE s */; | ||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; | ||
|
||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
|
||
rollback; | ||
drop table r1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--force-restart --binlog_format=row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
create table r1 (id1 int, id2 int, id3 varchar(100), id4 int, value1 int, value2 int, value3 int, value4 int, primary key (id1, id2, id3, id4), KEY (value1, value2, value3)); | ||
insert into r1 values (1,1,1,1,1,1,1,1); | ||
insert into r1 values (1,1,1,2,2,2,2,2); | ||
insert into r1 values (1,1,2,1,3,3,3,3); | ||
insert into r1 values (1,1,2,2,4,4,4,4); | ||
insert into r1 values (1,2,1,1,5,5,5,5); | ||
insert into r1 values (1,2,1,2,6,6,6,6); | ||
insert into r1 values (1,2,2,1,7,7,7,7); | ||
insert into r1 values (1,2,2,2,8,8,8,8); | ||
insert into r1 values (2,1,1,1,9,9,9,9); | ||
insert into r1 values (2,1,1,2,10,10,10,10); | ||
insert into r1 values (2,1,2,1,11,11,11,11); | ||
insert into r1 values (2,1,2,2,12,12,12,12); | ||
insert into r1 values (2,2,1,1,13,13,13,13); | ||
insert into r1 values (2,2,1,2,14,14,14,14); | ||
insert into r1 values (2,2,2,1,15,15,15,15); | ||
insert into r1 values (2,2,2,2,16,16,16,16); | ||
|
||
BEGIN; | ||
insert into r1 values (5,5,5,5,5,5,5,5); | ||
update r1 set value1=value1+100 where id1=1 and id2=1 and id3='1'; | ||
|
||
--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=BINLOG_START/ | ||
--exec ASAN_OPTIONS="detect_leaks=0" $MYSQL_DUMP --skip-comments --source-data=2 --print-ordering-key --rocksdb --order-by-primary-desc --rocksdb_bulk_load test | ||
|
||
--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=BINLOG_START/ | ||
--exec ASAN_OPTIONS="detect_leaks=0" $MYSQL_DUMP --skip-comments --source-data=2 --print-ordering-key --rocksdb --order-by-primary-desc --rocksdb_bulk_load --rocksdb_bulk_load_allow_sk test | ||
|
||
rollback; | ||
|
||
drop table r1; |