Skip to content

Commit

Permalink
syncer: remove improper ignored error (pingcap#1585)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Apr 15, 2021
1 parent 0d9e82b commit 89e7399
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 5 additions & 6 deletions syncer/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ func ignoreDDLError(err error) bool {

errCode := errors.ErrCode(mysqlErr.Number)
switch errCode {
case infoschema.ErrDatabaseExists.Code(), infoschema.ErrDatabaseNotExists.Code(), infoschema.ErrDatabaseDropExists.Code(),
infoschema.ErrTableExists.Code(), infoschema.ErrTableNotExists.Code(), infoschema.ErrTableDropExists.Code(),
infoschema.ErrColumnExists.Code(), infoschema.ErrColumnNotExists.Code(),
infoschema.ErrIndexExists.Code(), tddl.ErrCantDropFieldOrKey.Code():
return true
case tmysql.ErrDupKeyName:
case infoschema.ErrDatabaseExists.Code(), infoschema.ErrDatabaseDropExists.Code(),
infoschema.ErrTableExists.Code(), infoschema.ErrTableDropExists.Code(),
infoschema.ErrColumnExists.Code(),
infoschema.ErrIndexExists.Code(),
infoschema.ErrKeyNameDuplicate.Code(), tddl.ErrCantDropFieldOrKey.Code():
return true
default:
return false
Expand Down
8 changes: 8 additions & 0 deletions tests/all_mode/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ function run() {
check_log_not_contains $WORK_DIR/worker1/log/dm-worker.log "Error .* Table .* doesn't exist"
check_log_not_contains $WORK_DIR/worker2/log/dm-worker.log "Error .* Table .* doesn't exist"

# test Db not exists should be reported

run_sql_tidb "drop database all_mode"
run_sql_source1 "create table all_mode.db_error (c int primary key);"
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status $ILLEGAL_CHAR_NAME" \
"Error 1049: Unknown database" 1

export GO_FAILPOINTS=''

run_sql_both_source "SET @@GLOBAL.SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"
Expand Down

0 comments on commit 89e7399

Please sign in to comment.