bug fixed for Sync2 when mysql engine is myisam
This commit is contained in:
parent
025e2a20e5
commit
90c454a96a
|
@ -105,6 +105,10 @@ func isPKZero(pk core.PK) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func equalNoCase(s1, s2 string) bool {
|
||||||
|
return strings.ToLower(s1) == strings.ToLower(s2)
|
||||||
|
}
|
||||||
|
|
||||||
func indexNoCase(s, sep string) int {
|
func indexNoCase(s, sep string) int {
|
||||||
return strings.Index(strings.ToLower(s), strings.ToLower(sep))
|
return strings.Index(strings.ToLower(s), strings.ToLower(sep))
|
||||||
}
|
}
|
||||||
|
|
|
@ -3998,7 +3998,7 @@ func (s *Session) Sync2(beans ...interface{}) error {
|
||||||
|
|
||||||
var oriTable *core.Table
|
var oriTable *core.Table
|
||||||
for _, tb := range tables {
|
for _, tb := range tables {
|
||||||
if tb.Name == table.Name {
|
if equalNoCase(tb.Name, table.Name) {
|
||||||
oriTable = tb
|
oriTable = tb
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -4023,7 +4023,7 @@ func (s *Session) Sync2(beans ...interface{}) error {
|
||||||
for _, col := range table.Columns() {
|
for _, col := range table.Columns() {
|
||||||
var oriCol *core.Column
|
var oriCol *core.Column
|
||||||
for _, col2 := range oriTable.Columns() {
|
for _, col2 := range oriTable.Columns() {
|
||||||
if col.Name == col2.Name {
|
if equalNoCase(col.Name, col2.Name) {
|
||||||
oriCol = col2
|
oriCol = col2
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -4146,7 +4146,7 @@ func (s *Session) Sync2(beans ...interface{}) error {
|
||||||
for _, table := range tables {
|
for _, table := range tables {
|
||||||
var oriTable *core.Table
|
var oriTable *core.Table
|
||||||
for _, structTable := range structTables {
|
for _, structTable := range structTables {
|
||||||
if table.Name == structTable.Name {
|
if equalNoCase(table.Name, structTable.Name) {
|
||||||
oriTable = structTable
|
oriTable = structTable
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue