final class MySqlVersion
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

A supported MySQL release and the lexical rules that changed between releases.

Constants§

public const DIALECT = 'mysql'

The dialect name the resource record uses.

Properties§

public SqlVersion $release

Methods§

public function __construct(public SqlVersion $release)

Parameters

$releaseSqlVersionThe release and its resources
public static function resolve(
    string|null $version = null,
    VersionRegistry $registry = new \SqlParser\Resource\VersionRegistry(),
): self

Resolves a release tag, the newest shipped release when none is given.

Parameters

$versionstring|nullTag such as `mysql-8.4.7`, or null for the default
$registryVersionRegistryRecord of shipped releases

Returns

self The release

Throws

RuntimeException When the release is not shipped
Test cases 46
Called from 2
Calls 4
public function name(): string

Answers the release tag.

Returns

string Tag such as `mysql-8.4.7`
Called from 1
public function id(): int

Answers the release as MySQL numbers it, as in MYSQL_VERSION_ID.

Returns

int Major times ten thousand plus minor times a hundred plus patch
Called from 3
Calls 3
public function hasJsonOperators(): bool

Reports whether -> and ->> are JSON operators, as they are from 5.7 on.

Returns

bool True from 5.7 on
Calls 1
public function hasDollarQuotedStrings(): bool

Reports whether $$ ... $$ is a string literal, as it is from 8.1 on.

Returns

bool True from 8.1 on
Calls 1
public function mergesWithCube(): bool

Reports whether WITH CUBE is read as one token, as it was before 8.0.

Returns

bool True for 5.6 and 5.7
Called from 1
Calls 1

Test cases 47§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 7
Other tests reaching this symbol 40

Relations§

Static calls 2
Method calls 2
Constant reads 1
Type declarations 3