final class Renamings
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Follows the renames of one RENAME TABLE statement in order.

Rule: MYSQL-RENAMINGS-001. The server renames left to right. The state is the list of tables the earlier renames moved, each with its current name and the facts of the table it is, and the names they moved away. The old name of a rename denotes, in this order: a table an earlier rename moved to that name; nothing, when an earlier rename moved the table of that name away (MissingTable); otherwise the table the context resolves (MYSQL-CHANGE-TARGET-001). The new name of a rename already exists when a moved table has it, or when the context declares a table of that name (DeclaredTable or ConflictingTables) that no earlier rename moved away; that is the diagnostic TableExists. Names are compared as by MYSQL-CHANGE-TARGET-001. Terminates: one pass over the renames, each comparing with the earlier ones. Source: https://dev.mysql.com/doc/refman/8.4/en/rename-table.html. Status: Implemented.

Methods§

public function derive(list<TableRenaming> $renamings, Derivation $derivation): void

Records the resolution of the old name of each rename and reports new names that exist.

Parameters

$renamingslist<TableRenaming>The renames in order
$derivationDerivation
Called from 1
Calls 11
public function vacated(
    list<QualifiedName> $vacated,
    QualifiedName $name,
    Derivation $derivation,
): bool
public function exists(
    array<int, array{QualifiedName, RelationFact}> $moved,
    list<QualifiedName> $vacated,
    QualifiedName $name,
    Derivation $derivation,
): bool

Tells whether a table has a name at this point of the statement.

Parameters

$movedarray<int, array{QualifiedName, RelationFact}>The tables the earlier renames moved, by their current names
$vacatedlist<QualifiedName>The old names of the earlier renames
$nameQualifiedName
$derivationDerivation

Returns

bool
Called from 1
Calls 5

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Method calls 1