Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# xorm
xorm是一个简单而强大的Go语言ORM库. 通过它可以使数据库操作非常简便。
新的在维护版本: [https://gitea.com/xorm/xorm](https://gitea.com/xorm/xorm)

## 说明

Expand Down
5 changes: 2 additions & 3 deletions internal/statements/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ func (statement *Statement) genSelectSql(dialect dialects.Dialect, rownumber str

if dialect.URI().DBType != schemas.MSSQL && dialect.URI().DBType != schemas.ORACLE {
if statement.Start > 0 {
sql = fmt.Sprintf("%v LIMIT %v OFFSET %v", sql, statement.LimitN, statement.Start)
if pLimitN != nil {
sql = fmt.Sprintf("%v LIMIT %v OFFSET %v", sql, *pLimitN, statement.Start)
} else {
sql = fmt.Sprintf("%v LIMIT 0 OFFSET %v", sql, *pLimitN)
sql = fmt.Sprintf("%v LIMIT 0 OFFSET %v", sql, statement.Start)
}
} else if pLimitN != nil {
sql = fmt.Sprintf("%v LIMIT %v", sql, statement.LimitN)
sql = fmt.Sprintf("%v LIMIT %v", sql, *pLimitN)
}
} else if dialect.URI().DBType == schemas.ORACLE {
if statement.Start != 0 || pLimitN != nil {
Expand Down