mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-31 08:59:51 -06:00
add env var for disable fast fixed-width access
This commit is contained in:
@@ -17,6 +17,7 @@ package val
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -26,6 +27,16 @@ import (
|
||||
"github.com/dolthub/dolt/go/store/hash"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if v := os.Getenv("DOLT_DISABLE_FIXED_ACCESS"); v != "" {
|
||||
disableFixedAccess = true
|
||||
}
|
||||
}
|
||||
|
||||
// disableFixedAccess disables fast-access optimizations for
|
||||
// not-null, fixed-width tuple values. See |makeFixedAccess|.
|
||||
var disableFixedAccess = false
|
||||
|
||||
// TupleDesc describes a Tuple set.
|
||||
// Data structures that contain Tuples and algorithms that process Tuples
|
||||
// use a TupleDesc's types to interpret the fields of a Tuple.
|
||||
@@ -73,6 +84,10 @@ func IterAddressFields(td TupleDesc, cb func(int, Type)) {
|
||||
type FixedAccess [][2]ByteSize
|
||||
|
||||
func makeFixedAccess(types []Type) (acc FixedAccess) {
|
||||
if disableFixedAccess {
|
||||
return nil
|
||||
}
|
||||
|
||||
acc = make(FixedAccess, 0, len(types))
|
||||
|
||||
off := ByteSize(0)
|
||||
|
||||
Reference in New Issue
Block a user