Skip to content

Commit

Permalink
Fix incorrect unquoting of qualified field names from table names wit…
Browse files Browse the repository at this point in the history
…h '.'
  • Loading branch information
fiam committed Feb 20, 2017
1 parent 0407305 commit 3518944
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions orm/driver/sql/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,11 @@ func NewDriver(b Backend, url *config.URL) (*Driver, error) {
return driver, nil
}

// Assume s is quoted
// Assume s is a quoted qualified name. The table name and field
// are separated by a '.'. Note that the table name might contain also
// the '.' character, so we want to look the last occurence of '.'.
func unquote(s string) string {
p := strings.Index(s, ".")
p := strings.LastIndex(s, ".")
return s[p+2 : len(s)-1]
}

Expand Down

0 comments on commit 3518944

Please sign in to comment.