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

Method WriteLimit

pkg/ttl/sqlbuilder/sql.go:238–246  ·  view source on GitHub ↗

WriteLimit writes the limit

(n int)

Source from the content-addressed store, hash-verified

236
237// WriteLimit writes the limit
238func (b *SQLBuilder) WriteLimit(n int) error {
239 if b.state != writeSelOrDel && b.state != writeWhere && b.state != writeOrderBy {
240 return errors.Errorf("invalid state: %v", b.state)
241 }
242 b.state = writeLimit
243 b.restoreCtx.WritePlain(" LIMIT ")
244 b.restoreCtx.WritePlain(strconv.Itoa(n))
245 return nil
246}
247
248func (b *SQLBuilder) writeTblName() error {
249 tn := ast.TableName{Schema: b.tbl.Schema, Name: b.tbl.Name}

Callers 3

buildSQLMethod · 0.95
BuildDeleteSQLFunction · 0.95
TestSQLBuilderFunction · 0.95

Calls 2

WritePlainMethod · 0.80
ErrorfMethod · 0.65

Tested by 1

TestSQLBuilderFunction · 0.76