struct增加字段后,Sync执行的时候,语句中表名为空 #426
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#426
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
日志显示:ALTER TABLE ADD
test1
INT NOT NULL DEFAULT -1 ;跟踪发现这里有问题:
} else {
session := engine.NewSession()
session.Statement.RefTable = table
session.Statement.tableName = tbName
defer session.Close()
err = session.addColumn(col.Name)
}
后续addColumn函数中,statement判断表名部分使用了tblname和alttbname,这里只设置了tableName,导致
func (s *Statement) genAddColumnStr(col *core.Column) (string, []interface{}) {
quote := s.Engine.Quote
sql := fmt.Sprintf("ALTER TABLE %v ADD %v;", quote(s.TableName()),
col.String(s.Engine.dialect))
return sql, []interface{}{}
}
s.TableName()函数读不出表名
Is your version the latest xorm?
go get -u -v github.com/go-xorm/xorm
xorm v0.5.5.0711
更新之后,故障依旧
有更多细节代码吗?