cockroach: github.com/cockroachdb/cockroach/pkg/sql/tests Index | Files

package tests

import "github.com/cockroachdb/cockroach/pkg/sql/tests"

Index

Package Files

command_filters.go data.go end_txn_trigger.go server_params.go

func CheckEndTransactionTrigger Uses

func CheckEndTransactionTrigger(args storagebase.FilterArgs) *roachpb.Error

CheckEndTransactionTrigger verifies that an EndTransactionRequest that includes intents for the SystemDB keys sets the proper trigger.

func CheckKeyCount Uses

func CheckKeyCount(t *testing.T, kvDB *client.DB, span roachpb.Span, numKeys int)

CheckKeyCount checks that the number of keys in the provided span matches numKeys.

func CreateKVInterleavedTable Uses

func CreateKVInterleavedTable(t *testing.T, sqlDB *gosql.DB, numRows int)

CreateKVInterleavedTable is like CreateKVTable, but it interleaves table t.intlv inside of t.kv and adds rows to both.

func CreateKVTable Uses

func CreateKVTable(sqlDB *gosql.DB, name string, numRows int) error

CreateKVTable creates a basic table named t.<name> that stores key/value pairs with numRows of arbitrary data.

type CommandFilters Uses

type CommandFilters struct {
    syncutil.RWMutex
    // contains filtered or unexported fields
}

CommandFilters provides facilities for registering "TestingCommandFilters" (i.e. functions to be run on every replica command). CommandFilters is thread-safe. CommandFilters also optionally does replay protection if filters need it.

func CreateTestServerParams Uses

func CreateTestServerParams() (base.TestServerArgs, *CommandFilters)

CreateTestServerParams creates a set of params suitable for SQL tests. It enables some EndTransaction sanity checking and installs a flexible TestingEvalFilter. TODO(andrei): this function is not used consistently by SQL tests. Figure out if the EndTransaction checks are important.

func (*CommandFilters) AppendFilter Uses

func (c *CommandFilters) AppendFilter(
    filter storagebase.ReplicaCommandFilter, idempotent bool,
) func()

AppendFilter registers a filter function to run after all the previously registered filters. idempotent specifies if this filter can be safely run multiple times on the same command. If this property doesn't hold, CommandFilters will start tracking commands for replay protection, which might be expensive. Returns a closure that the client must run for doing cleanup when the filter should be deregistered.

func (*CommandFilters) RunFilters Uses

func (c *CommandFilters) RunFilters(args storagebase.FilterArgs) *roachpb.Error

RunFilters executes the registered filters, stopping at the first one that returns an error.

Package tests imports 14 packages (graph). Updated 2019-09-13. Refresh now. Tools for package owners.