Skip to content

Commit

Permalink
修改Join()多次调用连接的SQL缺少空格的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tuoz committed Apr 24, 2013
1 parent 8c660b1 commit e4393a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (orm *Model) ScanPK(output interface{}) *Model {
//The join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
func (orm *Model) Join(join_operator, tablename, condition string) *Model {
if orm.JoinStr != "" {
orm.JoinStr = orm.JoinStr + fmt.Sprintf("%v JOIN %v ON %v", join_operator, tablename, condition)
orm.JoinStr = orm.JoinStr + fmt.Sprintf(" %v JOIN %v ON %v", join_operator, tablename, condition)
} else {
orm.JoinStr = fmt.Sprintf("%v JOIN %v ON %v", join_operator, tablename, condition)
}
Expand Down

0 comments on commit e4393a3

Please sign in to comment.