This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Restore with lower case (#240) * restore: use lower string to filter since we use lower string to filter backup Co-authored-by: kennytm <[email protected]> * tools: replace retool by GO111MODULE (#244) * tools: replace retool by GO111MODULE * Makefile: temporarily shut up golangci-lint Co-authored-by: kennytm <[email protected]>
- Loading branch information
Showing
12 changed files
with
523 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright 2020 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, | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -eu | ||
DB="$TEST_NAME" | ||
|
||
run_sql "CREATE DATABASE $DB;" | ||
|
||
run_sql "CREATE TABLE $DB.USERTABLE1 ( \ | ||
YCSB_KEY varchar(64) NOT NULL, \ | ||
FIELD0 varchar(1) DEFAULT NULL, \ | ||
PRIMARY KEY (YCSB_KEY) \ | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" | ||
|
||
run_sql "INSERT INTO $DB.USERTABLE1 VALUES (\"a\", \"b\");" | ||
run_sql "INSERT INTO $DB.USERTABLE1 VALUES (\"aa\", \"b\");" | ||
|
||
# backup table with upper name | ||
echo "backup start..." | ||
run_br --pd $PD_ADDR backup table --db "$DB" --table "USERTABLE1" -s "local://$TEST_DIR/$DB" --ratelimit 5 --concurrency 4 | ||
|
||
run_sql "DROP DATABASE $DB;" | ||
|
||
# restore table with upper name success | ||
echo "restore start..." | ||
run_br --pd $PD_ADDR restore table --db "$DB" --table "USERTABLE1" -s "local://$TEST_DIR/$DB" | ||
|
||
table_count=$(run_sql "use $DB; show tables;" | grep "Tables_in" | wc -l) | ||
if [ "$table_count" -ne "1" ];then | ||
echo "TEST: [$TEST_NAME] failed!" | ||
exit 1 | ||
fi | ||
|
||
run_sql "DROP DATABASE $DB;" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin/ |
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,16 @@ | ||
all: bin/goimports bin/govet bin/revive bin/overalls bin/golangci-lint | ||
|
||
bin/goimports: | ||
go build -o $@ golang.org/x/tools/cmd/goimports | ||
|
||
bin/govet: | ||
go build -o $@ github.com/dnephin/govet | ||
|
||
bin/revive: | ||
go build -o $@ github.com/mgechev/revive | ||
|
||
bin/overalls: | ||
go build -o $@ github.com/go-playground/overalls | ||
|
||
bin/golangci-lint: | ||
go build -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint |
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 @@ | ||
module github.com/pingcap/br/_tools | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/dnephin/govet v0.0.0-20171012192244-4a96d43e39d3 | ||
github.com/go-playground/overalls v0.0.0-20191218162659-7df9f728c018 | ||
github.com/golangci/golangci-lint v1.25.0 | ||
github.com/mgechev/revive v1.0.2 | ||
github.com/yookoala/realpath v1.0.0 // indirect | ||
golang.org/x/tools v0.0.0-20200422205258-72e4a01eba43 | ||
) |
Oops, something went wrong.