Skip to content

Commit

Permalink
fix dump panic(#1.2-dev) (#16903)
Browse files Browse the repository at this point in the history
fix dump panic

Approved by: @daviszhen, @sukki37
  • Loading branch information
YANGGMM authored Jun 14, 2024
1 parent 6071110 commit 79577c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/frontend/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ func (ses *Session) AuthenticateUser(ctx context.Context, userInput string, dbNa
// If the login information contains the database name, verify if the database exists
if dbName != "" {
ses.timestampMap[TSCheckDbNameStart] = time.Now()
_, err = executeSQLInBackgroundSession(tenantCtx, ses, "use "+dbName)
_, err = executeSQLInBackgroundSession(tenantCtx, ses, "use `"+dbName+"`")
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1523,7 +1523,7 @@ func (d *dbMigration) Migrate(ctx context.Context, ses *Session) error {
skipRespClient: true,
ses: ses,
}
return doComQuery(ses, tempExecCtx, &UserInput{sql: "use " + d.db})
return doComQuery(ses, tempExecCtx, &UserInput{sql: "use `" + d.db + "`"})
}

type prepareStmtMigration struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/frontend/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ func restoreViews(
if tblInfo, ok := viewMap[key]; ok {
getLogger().Info(fmt.Sprintf("[%s] start to restore view: %v", snapshotName, tblInfo.tblName))

if err = bh.Exec(toCtx, "use "+tblInfo.dbName); err != nil {
if err = bh.Exec(toCtx, "use `"+tblInfo.dbName+"`"); err != nil {
return err
}

Expand Down Expand Up @@ -747,7 +747,7 @@ func recreateTable(

ctx = defines.AttachAccountId(ctx, toAccountId)

if err = bh.Exec(ctx, fmt.Sprintf("use %s", tblInfo.dbName)); err != nil {
if err = bh.Exec(ctx, fmt.Sprintf("use `%s`", tblInfo.dbName)); err != nil {
return
}

Expand Down

0 comments on commit 79577c2

Please sign in to comment.