classRenamings
final class Renamings
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): voidRecords the resolution of the old name of each rename and reports new names that exist.
Parameters
$renamings | list<TableRenaming> | The renames in order |
$derivation | Derivation |
Called from 1
Calls 11
- new Targets line 46
- method-call Targets::same() line 52
- method-call Renamings::vacated() line 59
- new RelationFact line 59
- new RowShape line 59
- new MissingTable line 59
- method-call Targets::target() line 59
- method-call Derivation::target() line 61
- method-call Renamings::exists() line 62
- method-call Derivation::report() line 63
- new TableExists line 63
public function vacated(
list<QualifiedName> $vacated,
QualifiedName $name,
Derivation $derivation,
): boolTells whether an earlier rename moved the table of a name away.
Parameters
$vacated | list<QualifiedName> | The old names of the earlier renames |
$name | QualifiedName | |
$derivation | Derivation |
Returns
boolCalled from 2
Calls 2
- method-call Targets::same() line 78
- new Targets line 78
public function exists(
array<int, array{QualifiedName, RelationFact}> $moved,
list<QualifiedName> $vacated,
QualifiedName $name,
Derivation $derivation,
): boolTells whether a table has a name at this point of the statement.
Parameters
$moved | array<int, array{QualifiedName, RelationFact}> | The tables the earlier renames moved, by their current names |
$vacated | list<QualifiedName> | The old names of the earlier renames |
$name | QualifiedName | |
$derivation | Derivation |
Returns
boolCalled from 1
Calls 5
- method-call Targets::same() line 95
- new Targets line 95
- method-call Renamings::vacated() line 99
- method-call Derivation::table() line 102
- method-call Derivation::environment() line 102
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
RenamingsTestcalls