sessionstates

package
v1.4.0-nextgen.202510.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPreparedStmtTextsFromSetSessionStatesSQL

func ExtractPreparedStmtTextsFromSetSessionStatesSQL(sql string) map[uint32]string

ExtractPreparedStmtTextsFromSetSessionStatesSQL is a best-effort helper to extract stmtID -> SQL text.

Types

type PreparedStmtInfo

type PreparedStmtInfo struct {
	StmtText   string `json:"text"`
	ParamTypes []byte `json:"types,omitempty"`
}

type SessionStates

type SessionStates struct {
	PreparedStmts map[uint32]*PreparedStmtInfo `json:"prepared-stmts,omitempty"`
}

SessionStates mirrors TiDB session states JSON schema partially. Currently we only need prepared statements for traffic capture / replay.

func ParseFromSetSessionStatesSQL

func ParseFromSetSessionStatesSQL(sql string) (SessionStates, error)

ParseFromSetSessionStatesSQL parses a SQL string like: SET SESSION_STATES '...json...' and returns its decoded SessionStates. If sql is not a SET SESSION_STATES statement, it returns an empty SessionStates and nil error.

Jump to

Keyboard shortcuts

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