diff --git a/domain/domain.go b/domain/domain.go index ca5eb267e6..835d24832f 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -853,8 +853,12 @@ func (do *Domain) GetEtcdClient() *clientv3.Client { // should be called only once in BootstrapSession. func (do *Domain) LoadPrivilegeLoop(ctx sessionctx.Context) error { ctx.GetSessionVars().InRestrictedSQL = true + _, err := ctx.(sqlexec.SQLExecutor).ExecuteInternal(context.Background(), "set @@autocommit = 1") + if err != nil { + return err + } do.privHandle = privileges.NewHandle() - err := do.privHandle.Update(ctx) + err = do.privHandle.Update(ctx) if err != nil { return err }