Skip to content

Commit

Permalink
Merge pull request #181 from actiontech/fix_audit_error
Browse files Browse the repository at this point in the history
fix audit error
  • Loading branch information
drivebyer authored Dec 31, 2021
2 parents 26511be + 9c12e50 commit f3d07ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sqle/driver/mysql/optimizer/index/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/actiontech/sqle/sqle/driver/mysql/executor"
"github.com/actiontech/sqle/sqle/driver/mysql/session"
"github.com/actiontech/sqle/sqle/driver/mysql/util"
"github.com/actiontech/sqle/sqle/log"
indexoptimizer "github.com/actiontech/sqle/sqle/pkg/optimizer/index"
"github.com/pingcap/parser/ast"
"github.com/pingcap/parser/format"
Expand Down Expand Up @@ -89,7 +90,9 @@ func (o *Optimizer) Optimize(ctx context.Context, selectStmt *ast.SelectStmt) ([

executionPlan, err := o.GetExecutionPlan(restoredSQL)
if err != nil {
return nil, errors.Wrap(err, "get execution plan when optimize")
// TODO: explain will executed failure, if SQL is collect from MyBatis, it not executable SQL.
log.NewEntry().Errorf("get execution plan failed, sql: %v, error: %v", restoredSQL, err)
return nil, nil
}

executionPlan = removeDrivingTable(executionPlan)
Expand Down

0 comments on commit f3d07ea

Please sign in to comment.