本文整理汇总了Golang中github.com/pingcap/tidb/xapi.SelectResult.Next方法的典型用法代码示例。如果您正苦于以下问题:Golang SelectResult.Next方法的具体用法?Golang SelectResult.Next怎么用?Golang SelectResult.Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pingcap/tidb/xapi.SelectResult
的用法示例。
在下文中一共展示了SelectResult.Next方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: extractHandlesFromIndexResult
// extractHandlesFromIndexResult gets some handles from SelectResult.
// It should be called in a loop until finished or error happened.
func extractHandlesFromIndexResult(idxResult xapi.SelectResult) (handles []int64, finish bool, err error) {
subResult, e0 := idxResult.Next()
if e0 != nil {
err = errors.Trace(e0)
return
}
if subResult == nil {
finish = true
return
}
handles, err = extractHandlesFromIndexSubResult(subResult)
if err != nil {
err = errors.Trace(err)
}
return
}
示例2: extractRowsFromTableResult
func (e *XSelectIndexExec) extractRowsFromTableResult(t table.Table, tblResult *xapi.SelectResult) ([]*Row, error) {
var rows []*Row
for {
subResult, err := tblResult.Next()
if err != nil {
return nil, errors.Trace(err)
}
if subResult == nil {
break
}
subRows, err := e.extractRowsFromSubResult(t, subResult)
if err != nil {
return nil, errors.Trace(err)
}
rows = append(rows, subRows...)
}
return rows, nil
}
示例3: extractHandlesFromIndexResult
func extractHandlesFromIndexResult(idxResult *xapi.SelectResult) ([]int64, error) {
var handles []int64
for {
subResult, err := idxResult.Next()
if err != nil {
return nil, errors.Trace(err)
}
if subResult == nil {
break
}
subHandles, err := extractHandlesFromIndexSubResult(subResult)
if err != nil {
return nil, errors.Trace(err)
}
handles = append(handles, subHandles...)
}
return handles, nil
}