Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
precheck: support primary/unique key check #870 (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMHDBJD authored Aug 13, 2020
1 parent 21a6e6e commit cd0ea4b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad
github.com/pingcap/parser v0.0.0-20200616075836-fab06dab2086
github.com/pingcap/tidb v1.1.0-beta.0.20200423094549-0ad7ce6cdae6
github.com/pingcap/tidb-tools v4.0.3-0.20200717061805-6483ba1f6311+incompatible
github.com/pingcap/tidb-tools v4.0.5-0.20200805025317-02a16e0521cb+incompatible
github.com/prometheus/client_golang v1.2.1
github.com/prometheus/procfs v0.0.7 // indirect
github.com/rakyll/statik v0.1.6
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306084441-875bd09aa3d5+incomp
github.com/pingcap/tidb-tools v4.0.0-beta.1.0.20200306084441-875bd09aa3d5+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tidb-tools v4.0.3-0.20200717061805-6483ba1f6311+incompatible h1:ZqnNs4xV2X/Ba8EK5N4+XvMaoL6cd94F5YseaRxZARs=
github.com/pingcap/tidb-tools v4.0.3-0.20200717061805-6483ba1f6311+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tidb-tools v4.0.5-0.20200805025317-02a16e0521cb+incompatible h1:obFDQU7XvnCj8CiaXFP+bWaiQDp15Ueynk8cC0s5Utk=
github.com/pingcap/tidb-tools v4.0.5-0.20200805025317-02a16e0521cb+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330 h1:rRMLMjIMFulCX9sGKZ1hoov/iROMsKyC8Snc02nSukw=
github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI=
github.com/pingcap/tipb v0.0.0-20200417094153-7316d94df1ee h1:XJQ6/LGzOSc/jo33AD8t7jtc4GohxcyODsYnb+kZXJM=
Expand Down
2 changes: 1 addition & 1 deletion tests/dmctl_command/data/db1.prepare.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
drop database if exists `dmctl_command`;
create database `dmctl_command`;
use `dmctl_command`;
create table t1 (id int, name varchar(20));
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');
2 changes: 1 addition & 1 deletion tests/filter_user_cancel/data/db1.prepare.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
drop database if exists `filter_user_cancel`;
create database `filter_user_cancel`;
use `filter_user_cancel`;
create table t1 (id int, name varchar(20));
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');
2 changes: 1 addition & 1 deletion tests/full_mode/data/db1.prepare.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
drop database if exists `full_mode`;
create database `full_mode`;
use `full_mode`;
create table t1 (id int, name varchar(20));
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');
insert into t1 (id, name) values (3, 'Eddard Stark');
update t1 set name = 'Arya Stark' where id = 1;
Expand Down
2 changes: 1 addition & 1 deletion tests/full_mode/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function run() {
check_contains 'Query OK, 3 rows affected'

# test load data with `"` in the table name
run_sql "create table full_mode.\`tb\"1\` (id int,name varchar(10));" $MYSQL_PORT1 $MYSQL_PASSWORD1
run_sql "create table full_mode.\`tb\"1\` (id int,name varchar(10),primary key(\`id\`));" $MYSQL_PORT1 $MYSQL_PASSWORD1
run_sql "insert into full_mode.\`tb\"1\` values(1,'haha');" $MYSQL_PORT1 $MYSQL_PASSWORD1
run_sql "insert into full_mode.\`tb\"1\` values(2,'hihi');" $MYSQL_PORT1 $MYSQL_PASSWORD1

Expand Down
2 changes: 1 addition & 1 deletion tests/incremental_mode/data/db1.prepare.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
drop database if exists `incremental_mode`;
create database `incremental_mode`;
use `incremental_mode`;
create table t1 (id int, name varchar(20));
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');

0 comments on commit cd0ea4b

Please sign in to comment.