Skip to content

Commit

Permalink
global sort: output clear error message (#54126)
Browse files Browse the repository at this point in the history
close #54096
  • Loading branch information
lance6716 authored Jun 21, 2024
1 parent 4f3aba8 commit 88c087b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package variable
import (
"context"
"encoding/json"
goerr "errors"
"fmt"
"math"
"runtime"
Expand Down Expand Up @@ -2537,6 +2538,11 @@ var defaultSysVars = []*SysVar{
}, SetGlobal: func(ctx context.Context, s *SessionVars, val string) error {
if len(val) > 0 && val != CloudStorageURI.Load() {
if err := ValidateCloudStorageURI(ctx, val); err != nil {
// convert annotations (second-level message) to message so clientConn.writeError
// will print friendly error.
if goerr.As(err, new(*errors.Error)) {
err = errors.New(err.Error())
}
return err
}
}
Expand Down

0 comments on commit 88c087b

Please sign in to comment.