forked from pingcap/dumpling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: dump all generated column table (pingcap#166)
* Fix dump all generated column table
- Loading branch information
Showing
7 changed files
with
133 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# diff Configuration. | ||
|
||
log-level = "info" | ||
|
||
chunk-size = 1000 | ||
|
||
check-thread-count = 4 | ||
|
||
sample-percent = 100 | ||
|
||
use-rowid = false | ||
|
||
use-checksum = true | ||
|
||
fix-sql-file = "fix.sql" | ||
|
||
# tables need to check. | ||
[[check-tables]] | ||
schema = "all_generate_column" | ||
tables = ["~t.*"] | ||
|
||
[[table-config]] | ||
schema = "all_generate_column" | ||
table = "t" | ||
|
||
[[table-config.source-tables]] | ||
instance-id = "source-1" | ||
schema = "all_generate_column" | ||
table = "t" | ||
|
||
[[source-db]] | ||
host = "127.0.0.1" | ||
port = 3306 | ||
user = "root" | ||
password = "" | ||
instance-id = "source-1" | ||
|
||
[target-db] | ||
host = "127.0.0.1" | ||
port = 4000 | ||
user = "root" | ||
password = "" |
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,20 @@ | ||
### tidb-lightning config | ||
|
||
[lightning] | ||
server-mode = false | ||
level = "error" | ||
check-requirements = false | ||
|
||
[tikv-importer] | ||
backend="tidb" | ||
on-duplicate = "error" | ||
|
||
[mydumper] | ||
data-source-dir = "/tmp/dumpling_test_result/sql_res.all_generate_column" | ||
|
||
[tidb] | ||
host = "127.0.0.1" | ||
port = 4000 | ||
user = "root" | ||
password = "" | ||
status-port = 10080 |
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,37 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
cur=$(cd `dirname $0`; pwd) | ||
|
||
DB_NAME="all_generate_column" | ||
TABLE_NAME="t" | ||
|
||
# drop database on tidb | ||
export DUMPLING_TEST_PORT=4000 | ||
run_sql "drop database if exists $DB_NAME;" | ||
|
||
# drop database on mysql | ||
export DUMPLING_TEST_PORT=3306 | ||
run_sql "drop database if exists $DB_NAME;" | ||
|
||
# build data on mysql | ||
run_sql "create database $DB_NAME;" | ||
|
||
# build data with generate column full_name | ||
run_sql "create table $DB_NAME.$TABLE_NAME(a int as (1), b int as (2)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;" | ||
|
||
# insert 100 records | ||
run_sql "insert into $DB_NAME.$TABLE_NAME values $(seq -s, 100 | sed 's/,*$//g' | sed "s/[0-9]*/()/g");" | ||
|
||
# dumping | ||
export DUMPLING_TEST_DATABASE=$DB_NAME | ||
run_dumpling | ||
|
||
cat "$cur/conf/lightning.toml" | ||
# use lightning import data to tidb | ||
run_lightning $cur/conf/lightning.toml | ||
|
||
# check mysql and tidb data | ||
check_sync_diff $cur/conf/diff_config.toml | ||
|
||
|
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