MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / scanPlaceholder

Method scanPlaceholder

pkg/sql/scanner/scan.go:808–824  ·  view source on GitHub ↗
(lval ScanSymType)

Source from the content-addressed store, hash-verified

806}
807
808func (s *Scanner) scanPlaceholder(lval ScanSymType) {
809 s.lastAttemptedID = int32(lexbase.PLACEHOLDER)
810 start := s.pos
811 for lexbase.IsDigit(s.peek()) {
812 s.pos++
813 }
814 lval.SetStr(s.in[start:s.pos])
815
816 placeholder, err := NewPlaceholderFn(lval.Str())
817 if err != nil {
818 lval.SetID(lexbase.ERROR)
819 lval.SetStr(err.Error())
820 return
821 }
822 lval.SetID(lexbase.PLACEHOLDER)
823 lval.SetUnionVal(placeholder)
824}
825
826// scanHexString scans the content inside x'....'.
827func (s *Scanner) scanHexString(lval ScanSymType, ch int) bool {

Callers 1

ScanMethod · 0.80

Calls 7

peekMethod · 0.95
IsDigitFunction · 0.92
SetStrMethod · 0.65
StrMethod · 0.65
SetIDMethod · 0.65
ErrorMethod · 0.65
SetUnionValMethod · 0.65

Tested by

no test coverage detected