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

Method UnsafeBytes

pkg/sql/sem/tree/datum.go:1315–1317  ·  view source on GitHub ↗

UnsafeBytes returns the raw bytes avoiding allocation. It is "Unsafe" because the contract is that callers must not to mutate the bytes but there is nothing stopping that from happening.

()

Source from the content-addressed store, hash-verified

1313// the contract is that callers must not to mutate the bytes but there is
1314// nothing stopping that from happening.
1315func (d *DString) UnsafeBytes() []byte {
1316 return encoding.UnsafeConvertStringToBytes(string(*d))
1317}
1318
1319// DCollatedString is the Datum for strings with a locale. The struct members
1320// are intended to be immutable.

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected