domain: 'load privilege failed' when autocommit is off (#26691)
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user