code: func GetInfoSchema(ctx sessionctx.Context) infoschema.InfoSchema {
  	sessVar := ctx.GetSessionVars()
  	var is infoschema.InfoSchema
  	if snap := sessVar.SnapshotInfoschema; snap != nil {
  		is = snap.(infoschema.InfoSchema)
  		logutil.Logger(context.Background()).Info("use snapshot schema", zap.Uint64("conn", sessVar.ConnectionID), zap.Int64("schemaVersion", is.SchemaMetaVersion()))
  	} else {
  		is = sessVar.TxnCtx.InfoSchema.(infoschema.InfoSchema)
  	}
  	return is
  }
docs: // GetInfoSchema gets TxnCtx InfoSchema if snapshot schema is not set,
  // Otherwise, snapshot schema is returned.