bug fixed for Count

This commit is contained in:
Lunny Xiao 2016-09-29 14:10:03 +08:00
parent e2e54d57c9
commit 1f455336b2
3 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
xorm v0.6.0.0927
xorm v0.6.0.0929

View File

@ -1140,7 +1140,11 @@ func (statement *Statement) genCountSQL(bean interface{}) (string, []interface{}
condSQL, condArgs, _ := statement.genConds(bean)
return statement.genSelectSQL("count(*)", condSQL), append(statement.joinArgs, condArgs...)
var selectSql = statement.selectStr
if len(selectSql) <= 0 {
selectSql = "count(*)"
}
return statement.genSelectSQL(selectSql, condSQL), append(statement.joinArgs, condArgs...)
}
func (statement *Statement) genSumSQL(bean interface{}, columns ...string) (string, []interface{}) {

View File

@ -17,7 +17,7 @@ import (
const (
// Version show the xorm's version
Version string = "0.6.0.0927"
Version string = "0.6.0.0929"
)
func regDrvsNDialects() bool {