Skip to content

Commit

Permalink
update: 优化lang参数设置,自动转换为小写字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Apr 3, 2020
1 parent d5bb6cc commit ec01295
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions session/session_inception.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ func (s *session) ExecuteInc(ctx context.Context, sql string) (recordSets []sqle
}
}

s.Inc.Lang = strings.Replace(strings.ToLower(s.Inc.Lang), "-", "_", 1)

if lowerSql == "select database()" {
return s.execute(ctx, sql)
} else if strings.HasPrefix(lowerSql, "select high_priority") {
Expand Down Expand Up @@ -6185,6 +6187,9 @@ func (s *session) executeInceptionSet(node *ast.InceptionSetStmt, sql string) ([
if err != nil {
return nil, err
}
if prefix == "lang" {
s.Inc.Lang = strings.Replace(strings.ToLower(s.Inc.Lang), "-", "_", 1)
}
}
}

Expand Down

0 comments on commit ec01295

Please sign in to comment.