capabilities

package
v0.21.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnspecifiedServerVersion = vterrors.Errorf(vtrpcpb.Code_INTERNAL, "server version unspecified")
)

Functions

func MySQLVersionHasCapability

func MySQLVersionHasCapability(serverVersion string, capability FlavorCapability) (bool, error)

MySQLVersionHasCapability is specific to MySQL flavors (of all versions) and answers whether the given server version has the requested capability.

func ServerVersionAtLeast

func ServerVersionAtLeast(serverVersion string, parts ...int) (bool, error)

ServerVersionAtLeast returns true if current server is at least given value. Example: if input is []int{8, 0, 23}... the function returns 'true' if we're on MySQL 8.0.23, 8.0.24, ...

Types

type CapableOf

type CapableOf func(capability FlavorCapability) (bool, error)

func MySQLVersionCapableOf

func MySQLVersionCapableOf(serverVersion string) CapableOf

MySQLVersionCapableOf returns a CapableOf function specific to MySQL flavors

type FlavorCapability

type FlavorCapability int
const (
	NoneFlavorCapability                        FlavorCapability = iota // default placeholder
	FastDropTableFlavorCapability                                       // supported in MySQL 8.0.23 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-23.html
	TransactionalGtidExecutedFlavorCapability                           //
	InstantDDLFlavorCapability                                          // ALGORITHM=INSTANT general support
	InstantAddLastColumnFlavorCapability                                //
	InstantAddDropVirtualColumnFlavorCapability                         //
	InstantAddDropColumnFlavorCapability                                // Adding/dropping column in any position/ordinal.
	InstantChangeColumnDefaultFlavorCapability                          //
	InstantExpandEnumCapability                                         //
	InstantChangeColumnVisibilityCapability                             //
	MySQLUpgradeInServerFlavorCapability                                //
	DynamicRedoLogCapacityFlavorCapability                              // supported in MySQL 8.0.30 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-30.html
	DisableRedoLogFlavorCapability                                      // supported in MySQL 8.0.21 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-21.html
	CheckConstraintsCapability                                          // supported in MySQL 8.0.16 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html
	PerformanceSchemaDataLocksTableCapability                           // supported in MySQL 8.0.1 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
	InstantDDLXtrabackupCapability                                      // Supported in 8.0.32 and above, solving a MySQL-vs-Xtrabackup bug starting 8.0.29
	ReplicaTerminologyCapability                                        // Supported in 8.0.26 and above, using SHOW REPLICA STATUS and all variations.
	BinaryLogStatus                                                     // Supported in 8.2.0 and above, uses SHOW BINARY LOG STATUS
	RestrictFKOnNonStandardKey                                          // Supported in 8.4.0 and above, restricts usage of non-standard indexes for foreign keys.
)

Jump to

Keyboard shortcuts

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