This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore: fix several bugs related to column permutations (#437)
* fix multi error in column permutation * add unit test * add a integration test * rename test db * change log
- Loading branch information
Showing
10 changed files
with
287 additions
and
10 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,3 @@ | ||
[mydumper] | ||
strict-format = true | ||
max-region-size = 200 |
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 @@ | ||
CREATE DATABASE `perm` IF NOT EXISTS; |
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,22 @@ | ||
CREATE TABLE `test` ( | ||
`id` int(11) NOT NULL, | ||
`contract_no` varchar(64) DEFAULT NULL, | ||
`fund_seq_no` varchar(64) DEFAULT NULL, | ||
`term_no` int(11) DEFAULT NULL, | ||
`contract_type` varchar(8) DEFAULT NULL, | ||
`internal_transfer_tag` varchar(8) DEFAULT NULL, | ||
`prin_amt` int(11) DEFAULT NULL, | ||
`start_date` varchar(8) DEFAULT NULL, | ||
`end_date` varchar(8) DEFAULT NULL, | ||
`batch_date` varchar(8) DEFAULT NULL, | ||
`crt_time` timestamp DEFAULT CURRENT_TIMESTAMP, | ||
`region_code` varchar(8) DEFAULT NULL, | ||
`credit_code` varchar(64) DEFAULT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin | ||
PARTITION BY RANGE COLUMNS(batch_date) ( | ||
PARTITION `P20200224` VALUES LESS THAN ("2020-02-05 00:00:00"), | ||
PARTITION `P20200324` VALUES LESS THAN ("2020-03-05 00:00:00"), | ||
PARTITION `P20200424` VALUES LESS THAN ("2020-04-05 00:00:00"), | ||
PARTITION `P20200524` VALUES LESS THAN ("2020-05-05 00:00:00"), | ||
PARTITION `P_MAXVALUE` VALUES LESS THAN MAXVALUE | ||
); |
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 @@ | ||
contract_no,fund_seq_no,term_no,contract_type,internal_transfer_tag,prin_amt,start_date,end_date,region_code,credit_code | ||
2020061000019011020164030595,202006100001901102016403059520200629,1,01,N,356,20200210,20200720,000000, | ||
2020061000019011020164030596,202006100001901102016403059520200628,1,01,N,3561,20200310,20200720,000001, | ||
2020061000019011020164030597,202006100001901102016403059520200627,1,01,N,3562,20200410,20200720,000002,33 | ||
2020061000019011020164030598,108319xx0185-202006100001901102016403059520200626,12,02,Y,26368,20200510,20200620,000003, | ||
2020061000019011020164030599,202006100001901102016403059520200625,1,01,N,3960,20200610,20200720,000005,999 |
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,18 @@ | ||
set -eu | ||
|
||
for BACKEND in local importer tidb; do | ||
if [ "$BACKEND" = 'local' ]; then | ||
check_cluster_version 4 0 0 'local backend' || continue | ||
fi | ||
run_sql 'DROP DATABASE IF EXISTS perm' | ||
|
||
run_lightning --backend $BACKEND | ||
|
||
run_sql 'select count(*) from perm.test_perm;' | ||
check_contains "count(*): 5" | ||
|
||
run_sql "SELECT fund_seq_no, region_code, credit_code FROM perm.test_perm WHERE contract_no = '2020061000019011020164030597';" | ||
check_contains "fund_seq_no: 202006100001901102016403059520200627" | ||
check_contains "region_code: 000002" | ||
check_contains "credit_code: 33" | ||
done |