File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
pkg/statistics/handle/ddl Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,20 @@ func (h subscriber) handle(
232
232
case model .ActionFlashbackCluster :
233
233
return errors .Trace (storage .UpdateStatsVersion (ctx , sctx ))
234
234
case model .ActionAddIndex :
235
- // No need to update the stats meta for the adding index event.
235
+ // No need to update the stats meta for the adding index event.
236
+ case model .ActionDropSchema :
237
+ miniDBInfo := change .GetDropSchemaInfo ()
238
+ intest .Assert (miniDBInfo != nil )
239
+ for _ , table := range miniDBInfo .Tables {
240
+ // Try best effort to update the stats meta version for gc.
241
+ if err := h .delayedDeleteStats4PhysicalID (ctx , sctx , table .ID ); err != nil {
242
+ logutil .StatsLogger ().Error (
243
+ "Failed to update stats meta version for gc" ,
244
+ zap .Int64 ("tableID" , table .ID ),
245
+ zap .Error (err ),
246
+ )
247
+ }
248
+ }
236
249
default :
237
250
intest .Assert (false )
238
251
logutil .StatsLogger ().Error ("Unhandled schema change event" ,
You can’t perform that action at this time.
0 commit comments