diff --git a/VERSION b/VERSION index 22d10ea8..35d0d470 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -xorm v0.6.0.0927 \ No newline at end of file +xorm v0.6.0.0929 \ No newline at end of file diff --git a/statement.go b/statement.go index 1571f586..d24e8e40 100644 --- a/statement.go +++ b/statement.go @@ -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{}) { diff --git a/xorm.go b/xorm.go index 048d5b4f..81fe5997 100644 --- a/xorm.go +++ b/xorm.go @@ -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 {