MCPcopy Create free account
hub / github.com/pingcap/tidb / setStack

Method setStack

pkg/ttl/sqlbuilder/sql.go:381–400  ·  view source on GitHub ↗
(key []types.Datum)

Source from the content-addressed store, hash-verified

379}
380
381func (g *ScanQueryGenerator) setStack(key []types.Datum) error {
382 if key == nil {
383 key = g.keyRangeStart
384 }
385
386 if key == nil {
387 g.stack = g.stack[:0]
388 return nil
389 }
390
391 if err := g.tbl.ValidateKeyPrefix(key); err != nil {
392 return err
393 }
394
395 g.stack = g.stack[:len(key)]
396 for i := 0; i < len(key); i++ {
397 g.stack[i] = key[0 : i+1]
398 }
399 return nil
400}
401
402func (g *ScanQueryGenerator) buildSQL() (string, error) {
403 if g.limit <= 0 {

Callers 1

NextSQLMethod · 0.95

Calls 1

ValidateKeyPrefixMethod · 0.80

Tested by

no test coverage detected