test

package
v0.0.0-debug-20260702 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTableData

func CheckTableData(
	t *testing.T,
	de *testutil.TestDisttaeEngine,
	ctx context.Context,
	dbName string,
	tableName string,
	tableID uint64,
	indexName string,
)

func CreateDBAndTableForCNConsumerAndGetAppendData

func CreateDBAndTableForCNConsumerAndGetAppendData(
	t *testing.T,
	de *testutil.TestDisttaeEngine,
	ctx context.Context,
	databaseName string,
	tableName string,
	rowCount int,
) *containers.Batch

func CreateDBAndTableForHNSWAndGetAppendData

func CreateDBAndTableForHNSWAndGetAppendData(
	t *testing.T,
	de *testutil.TestDisttaeEngine,
	ctx context.Context,
	databaseName string,
	tableName string,
	rowCount int,
) *containers.Batch

func GetTestISCPExecutorOption

func GetTestISCPExecutorOption() *iscp.ISCPExecutorOption

Types

type MockAutoIncrementService

type MockAutoIncrementService struct {
	// contains filtered or unexported fields
}

MockAutoIncrementService is a mock implementation of AutoIncrementService for testing

func NewMockAutoIncrementService

func NewMockAutoIncrementService(uuid string) *MockAutoIncrementService

NewMockAutoIncrementService creates a new MockAutoIncrementService

func (*MockAutoIncrementService) Close

func (m *MockAutoIncrementService) Close()

Close closes the service

func (*MockAutoIncrementService) Create

func (m *MockAutoIncrementService) Create(
	ctx context.Context,
	tableID uint64,
	caches []incrservice.AutoColumn,
	txn client.TxnOperator,
) error

Create creates cache for auto-increment columns

func (*MockAutoIncrementService) CurrentValue

func (m *MockAutoIncrementService) CurrentValue(
	ctx context.Context,
	tableID uint64,
	col string,
) (uint64, error)

CurrentValue returns current value of an auto-increment column

func (*MockAutoIncrementService) Delete

func (m *MockAutoIncrementService) Delete(
	ctx context.Context,
	tableID uint64,
	txn client.TxnOperator,
) error

Delete deletes auto-increment cache for a table

func (*MockAutoIncrementService) GetLastAllocateTS

func (m *MockAutoIncrementService) GetLastAllocateTS(
	ctx context.Context,
	tableID uint64,
	colName string,
) (timestamp.Timestamp, error)

GetLastAllocateTS returns the last allocate timestamp

func (*MockAutoIncrementService) InsertValues

func (m *MockAutoIncrementService) InsertValues(
	ctx context.Context,
	tableID uint64,
	vecs []*vector.Vector,
	rows int,
	estimate int64,
) (uint64, error)

InsertValues inserts auto-increment values into vectors

func (*MockAutoIncrementService) Reload

func (m *MockAutoIncrementService) Reload(ctx context.Context, tableID uint64) error

Reload reloads auto-increment cache

func (*MockAutoIncrementService) Reset

func (m *MockAutoIncrementService) Reset(
	ctx context.Context,
	oldTableID, newTableID uint64,
	keep bool,
	txn client.TxnOperator,
) error

Reset resets auto-increment cache

func (*MockAutoIncrementService) UUID

func (m *MockAutoIncrementService) UUID() string

UUID returns the uuid of this increment service

type UpstreamSQLHelper

type UpstreamSQLHelper struct {
	// contains filtered or unexported fields
}

UpstreamSQLHelper handles special SQL statements (CREATE/DROP SNAPSHOT, OBJECTLIST, GET OBJECT, GETDDL) by routing them through frontend processing logic without requiring a Session

func NewUpstreamSQLHelper

func NewUpstreamSQLHelper(
	txnOp client.TxnOperator,
	engine engine.Engine,
	accountID uint32,
	executor executor.SQLExecutor,
	txnClient client.TxnClient,
) *UpstreamSQLHelper

NewUpstreamSQLHelper creates a new UpstreamSQLHelper txnClient is optional - if provided, it will be used to create new transactions when needed

func (*UpstreamSQLHelper) HandleSpecialSQL

func (h *UpstreamSQLHelper) HandleSpecialSQL(
	ctx context.Context,
	query string,
) (bool, *publication.Result, error)

HandleSpecialSQL checks if the SQL is a special statement and handles it directly Returns (handled, result, error) where handled indicates if the statement was handled If a new transaction was created (because there was no txn initially), it will be committed on success or rolled back on error

func (*UpstreamSQLHelper) SetTxnOp

func (h *UpstreamSQLHelper) SetTxnOp(txnOp client.TxnOperator)

SetTxnOp sets the transaction operator (called after StartTxn) This clears the createdTxnOp flag since the txn is now managed externally

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL