MCPcopy
hub / github.com/go-sql-driver/mysql / skipLengthEncodedString

Function skipLengthEncodedString

utils.go:548–562  ·  view source on GitHub ↗

returns the number of bytes skipped and an error, in case the string is longer than the input slice

(b []byte)

Source from the content-addressed store, hash-verified

546// returns the number of bytes skipped and an error, in case the string is
547// longer than the input slice
548func skipLengthEncodedString(b []byte) (int, error) {
549 // Get length
550 num, _, n := readLengthEncodedInteger(b)
551 if num < 1 {
552 return n, nil
553 }
554
555 n += int(num)
556
557 // Check data length
558 if len(b) >= n {
559 return n, nil
560 }
561 return n, io.EOF
562}
563
564// returns the number read, whether the value is NULL and the number of bytes read
565func readLengthEncodedInteger(b []byte) (uint64, bool, int) {

Callers 1

readColumnsMethod · 0.85

Calls 1

readLengthEncodedIntegerFunction · 0.85

Tested by

no test coverage detected