@@ -129,8 +129,7 @@ func (sr *SchemasReplace) rewriteKeyForDB(key []byte, cf string) ([]byte, error)
129
129
130
130
dbMap , exist := sr .DbMap [dbID ]
131
131
if ! exist {
132
- // db filtered out
133
- return nil , nil
132
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find db id:%v in maps" , dbID )
134
133
}
135
134
136
135
rawMetaKey .UpdateField (meta .DBkey (dbMap .DbID ))
@@ -148,8 +147,7 @@ func (sr *SchemasReplace) rewriteDBInfo(value []byte) ([]byte, error) {
148
147
149
148
dbMap , exist := sr .DbMap [dbInfo .ID ]
150
149
if ! exist {
151
- // db filtered out
152
- return nil , nil
150
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find db id:%v in maps" , dbInfo .ID )
153
151
}
154
152
155
153
dbInfo .ID = dbMap .DbID
@@ -208,14 +206,12 @@ func (sr *SchemasReplace) rewriteKeyForTable(
208
206
209
207
dbReplace , exist := sr .DbMap [dbID ]
210
208
if ! exist {
211
- // db filtered out
212
- return nil , nil
209
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find db id:%v in maps" , dbID )
213
210
}
214
211
215
212
tableReplace , exist := dbReplace .TableMap [tableID ]
216
213
if ! exist {
217
- // table filtered out
218
- return nil , nil
214
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find table id:%v in maps" , tableID )
219
215
}
220
216
221
217
rawMetaKey .UpdateKey (meta .DBkey (dbReplace .DbID ))
@@ -241,14 +237,12 @@ func (sr *SchemasReplace) rewriteTableInfo(value []byte, dbID int64) ([]byte, er
241
237
// construct or find the id map.
242
238
dbReplace , exist = sr .DbMap [dbID ]
243
239
if ! exist {
244
- // db filtered out
245
- return nil , nil
240
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find db id:%v in maps" , dbID )
246
241
}
247
242
248
243
tableReplace , exist = dbReplace .TableMap [tableInfo .ID ]
249
244
if ! exist {
250
- // table filtered out
251
- return nil , nil
245
+ return nil , errors .Annotatef (berrors .ErrInvalidArgument , "failed to find table id:%v in maps" , tableInfo .ID )
252
246
}
253
247
254
248
// update table ID and partition ID.
0 commit comments