fixed memory leak in func (stmt *Statement) ParseWithSpecialTableName
This commit is contained in:
parent
a9d27293de
commit
5d5f13686b
@ -491,11 +491,14 @@ func (stmt *Statement) Parse(value interface{}) (err error) {
|
||||
|
||||
func (stmt *Statement) ParseWithSpecialTableName(value interface{}, specialTableName string) (err error) {
|
||||
if stmt.Schema, err = schema.ParseWithSpecialTableName(value, stmt.DB.cacheStore, stmt.DB.NamingStrategy, specialTableName); err == nil && stmt.Table == "" {
|
||||
if tables := strings.Split(stmt.Schema.Table, "."); len(tables) == 2 {
|
||||
tables := strings.Split(stmt.Schema.Table, ".")
|
||||
if len(tables) == 2 {
|
||||
stmt.TableExpr = &clause.Expr{SQL: stmt.Quote(stmt.Schema.Table)}
|
||||
stmt.Table = tables[1]
|
||||
tables = nil
|
||||
return
|
||||
}
|
||||
tables = nil
|
||||
|
||||
stmt.Table = stmt.Schema.Table
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user