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

Commit

Permalink
dependency: update TiDB and integration test (#982) (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Sep 3, 2020
1 parent 17b2fbc commit 4f55045
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 75 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ require (
github.com/pingcap/errcode v0.3.0 // indirect
github.com/pingcap/errors v0.11.5-0.20200820035142-66eb5bf1d1cd
github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad
github.com/pingcap/log v0.0.0-20200828042413-fce0951f1463
github.com/pingcap/parser v0.0.0-20200821073936-cf85e80665c4
github.com/pingcap/tidb v1.1.0-beta.0.20200825092018-e52cb3714e24
github.com/pingcap/tidb v1.1.0-beta.0.20200901032733-f82e5320ad75
github.com/pingcap/tidb-tools v4.0.5-0.20200828085514-03575b185007+incompatible
github.com/prometheus/client_golang v1.5.1
github.com/rakyll/statik v0.1.6
Expand Down
12 changes: 10 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ github.com/ngaut/unistore v0.0.0-20200806113332-5b9f73333a19 h1:N8pW0PTJEGTyHzZu
github.com/ngaut/unistore v0.0.0-20200806113332-5b9f73333a19/go.mod h1:RtZJKyiaHRiII+b9/g/4339rSikSvfrUJmIbrUkYVi4=
github.com/ngaut/unistore v0.0.0-20200820080223-c734bcc4ea53 h1:mamcR5THP4UTx6dMZp00LUq5kMILU6o2FnHEWzYZQhE=
github.com/ngaut/unistore v0.0.0-20200820080223-c734bcc4ea53/go.mod h1:85S5ZgzoHtTMyaEYhaWnxv9OWMBfyhTNuWypXCfVn/0=
github.com/ngaut/unistore v0.0.0-20200828072424-1c0ede06a3fc h1:aWjX4/AooiJvLllPt+d7+4umIgFDKooKfLH+IRaQiGU=
github.com/ngaut/unistore v0.0.0-20200828072424-1c0ede06a3fc/go.mod h1:iSlx5Ub/926GvQn6+d2B2C16wJJwgQIsi6k/bEU0vl4=
github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
Expand Down Expand Up @@ -559,12 +561,16 @@ github.com/pingcap/kvproto v0.0.0-20200803054707-ebd5de15093f h1:y247vlXfpe8MYGt
github.com/pingcap/kvproto v0.0.0-20200803054707-ebd5de15093f/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20200810113304-6157337686b1 h1:hv22UEhdqeIqa5Jx0oeqDQNGHUBSW3LVOx02gqbd5Gg=
github.com/pingcap/kvproto v0.0.0-20200810113304-6157337686b1/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20200828054126-d677e6fd224a h1:/FW9upn9/MJ8e6SdiGZcJ4MeZLXdYUG+L5RHp1OhPR4=
github.com/pingcap/kvproto v0.0.0-20200828054126-d677e6fd224a/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9 h1:AJD9pZYm72vMgPcQDww9rkZ1DnWfl0pXV3BOWlkYIjA=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfEgRJ4T9NGgGTxdHpJerent7rM=
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad h1:SveG82rmu/GFxYanffxsSF503SiQV+2JLnWEiGiF+Tc=
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200828042413-fce0951f1463 h1:Jboj+s4jSCp5E1WDgmRUv5rIFKFHaaSWuSZ4wMwXIcc=
github.com/pingcap/log v0.0.0-20200828042413-fce0951f1463/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/parser v0.0.0-20190506092653-e336082eb825/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA=
github.com/pingcap/parser v0.0.0-20200424075042-8222d8b724a4/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4=
github.com/pingcap/parser v0.0.0-20200507022230-f3bf29096657/go.mod h1:9v0Edh8IbgjGYW2ArJr19E+bvL8zKahsFp+ixWeId+4=
Expand All @@ -574,6 +580,7 @@ github.com/pingcap/parser v0.0.0-20200609110328-c65941b9fbb3/go.mod h1:vQdbJqobJ
github.com/pingcap/parser v0.0.0-20200623082809-b74301ac298b/go.mod h1:vQdbJqobJAgFyiRNNtXahpMoGWwPEuWciVEK5A20NS0=
github.com/pingcap/parser v0.0.0-20200730092557-34a468e9b774/go.mod h1:vQdbJqobJAgFyiRNNtXahpMoGWwPEuWciVEK5A20NS0=
github.com/pingcap/parser v0.0.0-20200731033026-84f62115187c/go.mod h1:vQdbJqobJAgFyiRNNtXahpMoGWwPEuWciVEK5A20NS0=
github.com/pingcap/parser v0.0.0-20200813083329-a4bff035d3e2/go.mod h1:vQdbJqobJAgFyiRNNtXahpMoGWwPEuWciVEK5A20NS0=
github.com/pingcap/parser v0.0.0-20200821073936-cf85e80665c4 h1:ATFD3gmwkSHcPt5DuQK3dZwqDU49WXOq/zRmwPJ6Nks=
github.com/pingcap/parser v0.0.0-20200821073936-cf85e80665c4/go.mod h1:vQdbJqobJAgFyiRNNtXahpMoGWwPEuWciVEK5A20NS0=
github.com/pingcap/pd/v4 v4.0.0-rc.1.0.20200422143320-428acd53eba2 h1:JTzYYukREvxVSKW/ncrzNjFitd8snoQ/Xz32pw8i+s8=
Expand Down Expand Up @@ -602,8 +609,9 @@ github.com/pingcap/tidb v1.1.0-beta.0.20200803051932-e291f8fbd1e0/go.mod h1:YFuu
github.com/pingcap/tidb v1.1.0-beta.0.20200805053026-cd3e5ed82671/go.mod h1:+r9tlyUKG2zYzs2ajvEHiQlTx6WM0K2L1yabCHZwgGw=
github.com/pingcap/tidb v1.1.0-beta.0.20200806060043-574540aa06ba/go.mod h1:NHcZH46dkYwDd2IWUJaLOB0m54j7v2P5WdS4FvPR81w=
github.com/pingcap/tidb v1.1.0-beta.0.20200810064414-d81150394f9d/go.mod h1:vLYo4E7Q6kzKYTskhP2MHBsodmZIRRUU63qdiFjlULA=
github.com/pingcap/tidb v1.1.0-beta.0.20200825092018-e52cb3714e24 h1:NfFsiiS+LIZhZ6WLShr3GDLfdUldv+xUJWFZUDzpN+w=
github.com/pingcap/tidb v1.1.0-beta.0.20200825092018-e52cb3714e24/go.mod h1:njoJ91eP93pIoDn6PNNMkHnXlZHuW+DemVExnNjKQPk=
github.com/pingcap/tidb v1.1.0-beta.0.20200820085534-0d997f2b8b3c/go.mod h1:z7Hn1KY8Crt9cHhWtbGPKMBcjvmSJXIoOjO4rMk165w=
github.com/pingcap/tidb v1.1.0-beta.0.20200901032733-f82e5320ad75 h1:kV9usN6vnG5cMNNNADlNPm5TPifLYBKYbGOZvG31ldI=
github.com/pingcap/tidb v1.1.0-beta.0.20200901032733-f82e5320ad75/go.mod h1:VXxiC2f+HY3/5phR1841YJrX4on56kTEXrtEzRezcj4=
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.0-rc.1.0.20200421113014-507d2bb3a15e+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
github.com/pingcap/tidb-tools v4.0.0-rc.1.0.20200514040632-f76b3e428e19+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM=
Expand Down
14 changes: 0 additions & 14 deletions syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2128,20 +2128,6 @@ func (s *Syncer) trackDDL(usedSchema string, sql string, tableNames [][]*filter.
}
}

// try to drop appropriate index before drop column
if atStmt, ok := stmt.(*ast.AlterTableStmt); ok && len(atStmt.Specs) > 0 && atStmt.Specs[0].Tp == ast.AlterTableDropColumn {
if indexInfos, err := s.schemaTracker.GetSingleColumnIndices(usedSchema, atStmt.Table.Name.O, atStmt.Specs[0].OldColumnName.Name.O); err == nil {
for _, info := range indexInfos {
if err2 := s.schemaTracker.DropIndex(usedSchema, atStmt.Table.Name.O, info.Name.O); err2 != nil {
s.tctx.L().Warn("can't auto drop index before drop column",
zap.String("index", info.Name.O),
zap.String("column", atStmt.Specs[0].OldColumnName.Name.O),
log.ShortError(err2))
}
}
}
}

if shouldExecDDLOnSchemaTracker {
if err := s.schemaTracker.Exec(s.tctx.Ctx, usedSchema, sql); err != nil {
s.tctx.L().Error("cannot track DDL", zap.String("schema", usedSchema), zap.String("statement", sql), log.WrapStringerField("location", ec.currentLocation), log.ShortError(err))
Expand Down
3 changes: 3 additions & 0 deletions tests/handle_error/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ function clean_table() {
run_sql_both_source "drop table if exists ${db}.${ta2};"
run_sql_tidb "drop table if exists ${db}.${tb};"
run_sql_tidb "drop table if exists ${db}.${ta};"
run_sql_tidb "drop table if exists ${db}.${tb1};"
run_sql_tidb "drop table if exists ${db}.${tb2};"

run_sql_tidb "drop database if exists dm_meta;"
}
108 changes: 51 additions & 57 deletions tests/handle_error/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,65 +140,65 @@ function DM_SKIP_ERROR_SHARDING() {
run_case SKIP_ERROR_SHARDING "double-source-optimistic" "init_table 11 12 21 22" "clean_table" "optimistic"
}

# replace add foreign key with database name
# two source, no sharding
# replace add column unique
# one source, one table, no sharding
function DM_REPLACE_ERROR_CASE() {
run_sql_source1 "insert into ${db}.${tb2} values(1,1);"
run_sql_source1 "insert into ${db}.${tb1} values(2,1);"
run_sql_source1 "insert into ${db}.${tb1} values(1,1);"

# error in TiDB
run_sql_source1 "alter table ${db}.${tb1} add constraint fk foreign key (b) references ${tb2}(a);"
run_sql_source1 "insert into ${db}.${tb2} values(3,3);"
run_sql_source1 "insert into ${db}.${tb1} values(4,3);"
run_sql_source1 "alter table ${db}.${tb1} add column c int unique;"
run_sql_source1 "insert into ${db}.${tb1} values(2,2,2);"

run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"No database selected" 1
"unsupported add column .* constraint UNIQUE KEY" 1

# replace sql
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb1} add constraint fk foreign key (b) references ${tb2}(a);" \
"handle-error test replace alter table ${db}.${tb1} add column c int;alter table ${db}.${tb1} add unique(c);" \
"\"result\": true" 2

run_sql_source1 "insert into ${db}.${tb2} values(5,5);"
run_sql_source1 "insert into ${db}.${tb1} values(6,5);"
run_sql_source1 "insert into ${db}.${tb1} values(3,3,3);"

run_sql_tidb_with_retry "select count(1) from ${db}.${tb1};" "count(1): 4"
run_sql_tidb_with_retry "select count(1) from ${db}.${tb2};" "count(1): 4"
run_sql_tidb_with_retry "select count(1) from ${db}.${tb1};" "count(1): 3"
}

function DM_REPLACE_ERROR() {
run_case REPLACE_ERROR "double-source-no-sharding" \
"run_sql_source1 \"create table ${db}.${tb2} (a int unique, b int);\"; \
run_sql_source1 \"create table ${db}.${tb1} (a int unique, b int);\"" \
"run_sql_source1 \"create table ${db}.${tb1} (a int unique, b int);\"" \
"clean_table" ""
}

# replace add column without unique, add foreign key with database name
# replace add column unique twice
# two source, 4 tables
# source1: tb1 first ddl -> tb1 second ddl -> tb2 first ddl -> tb2 second ddl
# source2: tb1 first ddl -> tb2 first ddl -> tb1 second ddl -> tb2 second ddl
function DM_REPLACE_ERROR_SHARDING_CASE() {
run_sql_source1 "insert into ${db}.${ta1} values(1,1),(3,3),(5,5),(7,7);"
run_sql_source2 "insert into ${db}.${ta1} values(2,2),(4,4),(6,6),(8,8);"

# 11/21 first ddl
run_sql_source1 "alter table ${db}.${tb1} add column c int unique;"
run_sql_source2 "alter table ${db}.${tb1} add column c int unique;"
# 11 second ddl
run_sql_source1 "alter table ${db}.${tb1} add constraint foreign key (c) references ${ta1}(a);"
run_sql_source1 "insert into ${db}.${tb1} values(1,1,1);"
run_sql_source2 "insert into ${db}.${tb1} values(2,2,2);"

# 11 second ddl
run_sql_source1 "alter table ${db}.${tb1} add column d int unique;"
run_sql_source1 "insert into ${db}.${tb1} values(3,3,3,3);"

# 12/22 first ddl
run_sql_source1 "alter table ${db}.${tb2} add column c int unique;"
run_sql_source2 "alter table ${db}.${tb2} add column c int unique;"
run_sql_source1 "insert into ${db}.${tb2} values(4,4,4);"
run_sql_source2 "insert into ${db}.${tb2} values(5,5,5);"

# 21 second ddl
run_sql_source2 "alter table ${db}.${tb1} add constraint foreign key (c) references ${ta1}(a);"
run_sql_source2 "insert into ${db}.${tb1} values(2,2,2);"
run_sql_source2 "alter table ${db}.${tb1} add column d int unique;"
run_sql_source2 "insert into ${db}.${tb1} values(6,6,6,6);"

# 12/22 second ddl
run_sql_source1 "alter table ${db}.${tb2} add constraint foreign key (c) references ${ta1}(a);"
run_sql_source1 "insert into ${db}.${tb2} values(3,3,3);"
run_sql_source2 "alter table ${db}.${tb2} add constraint foreign key (c) references ${ta1}(a);"
run_sql_source2 "insert into ${db}.${tb2} values(4,4,4);"
run_sql_source1 "alter table ${db}.${tb2} add column d int unique;"
run_sql_source2 "alter table ${db}.${tb2} add column d int unique;"
run_sql_source1 "insert into ${db}.${tb2} values(7,7,7,7);"
run_sql_source2 "insert into ${db}.${tb2} values(8,8,8,8);"

# 11/21 first ddl: unsupport error
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
Expand All @@ -220,72 +220,70 @@ function DM_REPLACE_ERROR_SHARDING_CASE() {

# split 12,22 first ddl into two ddls
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-01,mysql-replica-02 replace alter table ${db}.${tb2} add column c int;alter table ${db}.${tb2} add unique(c)" \
"handle-error test -s mysql-replica-01,mysql-replica-02 replace alter table ${db}.${tb2} add column c int;alter table ${db}.${tb2} add unique(c);" \
"\"result\": true" 3

# 11/21 second ddl: no database selected
# 11/21 second ddl: unsupport error
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"No database selected" 2
# replace 11/21 second ddl with database name
"unsupported add column .* constraint UNIQUE KEY" 2

# split 11/21 second ddl into two ddls
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test replace alter table ${db}.${tb1} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test replace alter table ${db}.${tb1} add column d int;alter table ${db}.${tb1} add unique(d);" \
"\"result\": true" 3

# 12/22 second ddl: detect conflict
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"detect inconsistent DDL sequence from source" 2

# replace 12/22 second ddl with database name one by one
# split 11/21 second ddl into two ddls one by one
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb2} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb2} add column d int;alter table ${db}.${tb2} add unique(d);" \
"\"result\": true" 2
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb2} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb2} add column d int;alter table ${db}.${tb2} add unique(d);" \
"\"result\": true" 2
else
# 11 second ddl: no database selected, 22 first ddl: unsupport error
# 11 second ddl, 22 first ddl: unsupport error
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"unsupported add column .* constraint UNIQUE KEY" 1 \
"No database selected" 1
"unsupported add column .* constraint UNIQUE KEY" 2

# replace 11 second ddl
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb1} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb1} add column d int;alter table ${db}.${tb1} add unique(d);" \
"\"result\": true" 2

# replace 22 first ddl
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb2} add column c int;" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb2} add column c int;alter table ${db}.${tb2} add unique(c);" \
"\"result\": true" 2

# 12 first ddl: unsupport error, 21 second ddl: no database selected
# 12 first ddl, 21 second ddl: unsupport error
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"unsupported add column .* constraint UNIQUE KEY" 1 \
"No database selected" 1
"unsupported add column .* constraint UNIQUE KEY" 2

# replace 12 first ddl
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb2} add column c int;" \
"handle-error test -s mysql-replica-01 replace alter table ${db}.${tb2} add column c int;alter table ${db}.${tb2} add unique(c);" \
"\"result\": true" 2

# replace 21 second ddl
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb1} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test -s mysql-replica-02 replace alter table ${db}.${tb1} add column d int;alter table ${db}.${tb1} add unique(d);" \
"\"result\": true" 2

# 12 first ddl, 22 second ddl: no database selected
# 12 first ddl, 22 second ddl: unspport error
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"No database selected" 2
"unsupported add column .* constraint UNIQUE KEY" 2

# replace 12/22 second ddl with database name
# replace 12/22 second ddl
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"handle-error test replace alter table ${db}.${tb2} add constraint foreign key (c) references ${db}.${ta1}(a);" \
"handle-error test replace alter table ${db}.${tb2} add column d int;alter table ${db}.${tb1} add unique(d);" \
"\"result\": true" 3

fi
Expand All @@ -294,26 +292,22 @@ function DM_REPLACE_ERROR_SHARDING_CASE() {
"query-status test" \
"\"stage\": \"Running\"" 2 \

run_sql_tidb_with_retry "select count(1) from ${db}.${tb}" "count(1): 4"
run_sql_tidb_with_retry "select count(1) from ${db}.${tb}" "count(1): 8"
}

function DM_REPLACE_ERROR_SHARDING() {
run_case REPLACE_ERROR_SHARDING "double-source-pessimistic" \
"run_sql_source1 \"create table ${db}.${tb1} (a int, b int);\"; \
run_sql_source1 \"create table ${db}.${tb2} (a int, b int);\"; \
run_sql_source2 \"create table ${db}.${tb1} (a int, b int);\"; \
run_sql_source2 \"create table ${db}.${tb2} (a int, b int);\"; \
run_sql_source1 \"create table ${db}.${ta1} (a int unique, b int);\"; \
run_sql_source2 \"create table ${db}.${ta1} (a int unique, b int);\"" \
run_sql_source2 \"create table ${db}.${tb2} (a int, b int);\"" \
"clean_table" "pessimistic"

run_case REPLACE_ERROR_SHARDING "double-source-optimistic" \
"run_sql_source1 \"create table ${db}.${tb1} (a int, b int);\"; \
run_sql_source1 \"create table ${db}.${tb2} (a int, b int);\"; \
run_sql_source2 \"create table ${db}.${tb1} (a int, b int);\"; \
run_sql_source2 \"create table ${db}.${tb2} (a int, b int);\"; \
run_sql_source1 \"create table ${db}.${ta1} (a int unique, b int);\"; \
run_sql_source2 \"create table ${db}.${ta1} (a int unique, b int);\"" \
run_sql_source2 \"create table ${db}.${tb2} (a int, b int);\"" \
"clean_table" "optimistic"
}

Expand Down

0 comments on commit 4f55045

Please sign in to comment.