-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into model2-update
- Loading branch information
Showing
40 changed files
with
11,733 additions
and
10,475 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
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
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,5 @@ | ||
[tikv-importer] | ||
backend = "local" | ||
|
||
[mydumper.csv] | ||
header = true |
12 changes: 12 additions & 0 deletions
12
br/tests/lightning_check_partial_imported/data/db01.tbl01-schema.sql
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,12 @@ | ||
CREATE TABLE tbl01 ( | ||
`id` INTEGER, | ||
`val` VARCHAR(64), | ||
`aaa` CHAR(66) DEFAULT NULL, | ||
`bbb` CHAR(10) NOT NULL, | ||
`ccc` CHAR(42) DEFAULT NULL, | ||
`ddd` CHAR(42) DEFAULT NULL, | ||
`eee` CHAR(66) DEFAULT NULL, | ||
`fff` VARCHAR(128) DEFAULT NULL, | ||
KEY `aaa` (`aaa`), | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
6 changes: 6 additions & 0 deletions
6
br/tests/lightning_check_partial_imported/data/db01.tbl01.csv
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,6 @@ | ||
id,val,aaa,bbb,ccc,ddd,eee,fff | ||
1,"v01","a01","b01","c01","d01","e01","f01" | ||
2,"v02","a02","b02","c02","d02","e02","f02" | ||
3,"v03","a03","b03","c03","d03","e03","f03" | ||
4,"v04","a04","b04","c04","d04","e04","f04" | ||
5,"v05","a05","b05","c05","d05","e05","f05" |
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,47 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2022 PingCAP, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
MYDIR=$(dirname "${BASH_SOURCE[0]}") | ||
set -eux | ||
|
||
check_cluster_version 4 0 0 'local backend' || exit 0 | ||
|
||
export GO_FAILPOINTS="github.com/pingcap/tidb/br/pkg/lightning/restore/FailBeforeStartImportingIndexEngine=return" | ||
set +e | ||
if run_lightning; then | ||
echo "The first import doesn't fail as expected" >&2 | ||
exit 1 | ||
fi | ||
set -e | ||
|
||
data_records=$(tail -n +2 "${MYDIR}/data/db01.tbl01.csv" | wc -l | xargs echo ) | ||
run_sql "SELECT COUNT(*) FROM db01.tbl01 USE INDEX();" | ||
check_contains "${data_records}" | ||
|
||
export GO_FAILPOINTS="" | ||
set +e | ||
if run_lightning --check-requirements=1; then | ||
echo "The pre-check doesn't find out the non-empty table problem" | ||
exit 2 | ||
fi | ||
set -e | ||
|
||
run_sql "TRUNCATE TABLE db01.tbl01;" | ||
run_lightning --check-requirements=1 | ||
run_sql "SELECT COUNT(*) FROM db01.tbl01;" | ||
check_contains "${data_records}" | ||
run_sql "SELECT COUNT(*) FROM db01.tbl01 USE INDEX();" | ||
check_contains "${data_records}" |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.