Skip to content

Commit

Permalink
try fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 committed Dec 6, 2021
1 parent 1ad6550 commit 5c91575
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dm/step_by_step_contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Edit some code on the `new-branch-name` branch and save your changes to fix the
```sh
docker run --rm --name mysql-3306 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7.22 --log-bin=mysql-bin --port=3306 --bind-address=0.0.0.0 --binlog-format=ROW --server-id=1 --gtid_mode=ON --enforce-gtid-consistency=true > mysql.3306.log 2>&1 &
docker run --rm --name mysql-3307 -p 3307:3307 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7.22 --log-bin=mysql-bin --port=3307 --bind-address=0.0.0.0 --binlog-format=ROW --server-id=1 --gtid_mode=ON --enforce-gtid-consistency=true > mysql.3307.log 2>&1 &
docker run --rm --name mysql-3307 -p 3307:3307 -e MYSQL_ROOT_PASSWORD=123456 mysql:8.0.21 --log-bin=mysql-bin --port=3307 --bind-address=0.0.0.0 --binlog-format=ROW --server-id=1 --gtid_mode=ON --enforce-gtid-consistency=true > mysql.3307.log 2>&1 &
```
3. Run integration test
Expand Down
4 changes: 2 additions & 2 deletions dm/tests/safe_mode/data/db2.prepare.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
drop database if exists `safe_mode_test`;
create database `safe_mode_test`;
use `safe_mode_test`;
create table t2 (id bigint auto_increment, uid int, name varchar(80), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT = 200;
create table t3 (id bigint auto_increment, uid int, name varchar(80), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT = 300;
create table t2 (id bigint auto_increment, uid int, name varchar(80), primary key (`id`), unique key(`uid`)) AUTO_INCREMENT = 200;
create table t3 (id bigint auto_increment, uid int, name varchar(80), primary key (`id`), unique key(`uid`)) AUTO_INCREMENT = 300;
insert into t2 (uid, name) values (40000, 'Remedios Moscote'), (40001, 'Amaranta');
insert into t3 (uid, name) values (30001, 'Aureliano José'), (30002, 'Santa Sofía de la Piedad'), (30003, '17 Aurelianos');
6 changes: 3 additions & 3 deletions dm/tests/sharding/data/db1.increment2.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
create database `sharding2`;
use `sharding2`;
CREATE TABLE `t1` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`)) DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t2` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`)) DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t3` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`)) DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t1` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`));
CREATE TABLE `t2` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`));
CREATE TABLE `t3` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`));
insert into `sharding1`.t1 (uid, name, info, age) values (10007, 'bruce wayne', '{"wealtch": "unknown"}', 1000), (10008, 'connelly', '{"boolean": true}', 1001);
insert into `sharding1`.t2 (uid, name, info, age) values (20009, 'haxwell', '{"key": "value000"}', 3003);
insert into `sharding2`.t1 (uid, name, info, age) values (60001, 'hello', '{"age": 201}', 133), (60002, 'world', '{"age": 202}', 233), (60003, 'final', '{"key": "value", "age": 203}', 333);
Expand Down
4 changes: 2 additions & 2 deletions dm/tests/sharding/data/db1.prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ drop database if exists `sharding1`;
drop database if exists `sharding2`;
create database `sharding1`;
use `sharding1`;
create table t1 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4;
create table t2 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4;
create table t1 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`));
create table t2 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`));
insert into t1 (uid, name) values (10001, 'Gabriel García Márquez'), (10002, 'Cien años de soledad');
insert into t2 (uid, name) values (20001, 'José Arcadio Buendía'), (20002, 'Úrsula Iguarán'), (20003, 'José Arcadio');
2 changes: 1 addition & 1 deletion dm/tests/sharding/data/db2.increment2.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
create database `sharding2`;
use `sharding2`;
CREATE TABLE `t4` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`)) DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t4` (`id` bigint(20) AUTO_INCREMENT, `uid` int(11), `name` varchar(80), `info` varchar(100), `age` int(11), `info_json` json GENERATED ALWAYS AS (`info`) VIRTUAL, `id_gen` int(11) GENERATED ALWAYS AS ((`uid` + 1)) VIRTUAL, create_by DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), UNIQUE KEY `id_gen` (`id_gen`), KEY `multi_col_idx` (`uid`,`id_gen`));
insert into `sharding2`.t4 (uid, name, info) values (70001, 'golang', '{"age": 6}'), (70002, 'rust con', '{"age": 1}'), (70003, 'javascript', '{"key": "value", "age": 20}');
insert into `sharding1`.t2 (uid, name, info) values (50002, 'tyuil', '{"ghjkl;": "as a standby"}'), (50003, 'xxxxx', '{"boolean": false, "k": "v"}');
insert into `sharding1`.t3 (uid, name, info) values (30004, 'hhhhhh', '{"key1": "value000"}');
4 changes: 2 additions & 2 deletions dm/tests/sharding/data/db2.prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ drop database if exists `sharding1`;
drop database if exists `sharding2`;
create database `sharding1`;
use `sharding1`;
create table t2 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4;
create table t3 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT CHARSET=utf8mb4;
create table t2 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT;
create table t3 (id bigint auto_increment, uid int, name varchar(80), info varchar(100), primary key (`id`), unique key(`uid`)) DEFAULT;
insert into t2 (uid, name, info) values (40000, 'Remedios Moscote', '{}');
insert into t3 (uid, name, info) values (30001, 'Aureliano José', '{}'), (30002, 'Santa Sofía de la Piedad', '{}'), (30003, '17 Aurelianos', NULL);

0 comments on commit 5c91575

Please sign in to comment.