1 Star 0 Fork 0

妙音/go-mysqlstack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
limit.go 522 Bytes
一键复制 编辑 原始数据 按行查看 历史
BohuTANG 提交于 2017-04-07 19:06 +08:00 . sqlos: add aggregate functions
// Copyright 2015, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Copyright (c) XeLabs
// BohuTANG
package sqltypes
// Limit used to cutoff the rows based on the MySQL LIMIT and OFFSET clauses.
func (result *Result) Limit(offset, limit int) {
count := len(result.Rows)
start := offset
end := offset + limit
if start > count {
start = count
}
if end > count {
end = count
}
result.Rows = result.Rows[start:end]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuender/go-mysqlstack.git
git@gitee.com:xuender/go-mysqlstack.git
xuender
go-mysqlstack
go-mysqlstack
v1.0.2

搜索帮助