classTableNames
final class TableNames
Resolves the tables a server administration statement names and reports a table named twice.
Rule: MYSQL-SERVER-TABLES-001. Each name resolves by MYSQL-CHANGE-TARGET-001 (the current database or the database written; common table expressions are not visible) and its resolution is the relation fact of the node that holds it. The server adds every table of the list to the statement's table list (Query_block::add_table_to_list without TL_OPTION_ALIAS), which rejects a second entry whose alias (the table name when no alias is written) and database equal an earlier one's with ER_NONUNIQ_TABLE; that is the diagnostic NonUniqueTable, compared under the context's relation name comparison. Precision: a declared table contributes the known types of its columns. Terminates: one pass over the list and over the names before each entry. Source: https://dev.mysql.com/doc/refman/8.4/en/lock-tables.html, https://dev.mysql.com/doc/refman/8.4/en/analyze-table.html. Status: Implemented.
Methods§
public function record(
Derivation $derivation,
list<array{Node, QualifiedName, Name|null}> $tables,
): list<RelationFact>Records the resolution of each table at its node and reports a repeated alias or name.
Parameters
$derivation | Derivation | |
$tables | list<array{Node, QualifiedName, Name|null}> | Each node, the table name it holds and its alias |
Returns
list<RelationFact> The facts of the tables in orderCalled from 4
- method-call SqlSemantics\Platform\MySql\Rules\Server\MaintainedTables::derive() packages/sql-semantics-mysql/src/Rules/Server/MaintainedTables.php:49
- method-call SqlSemantics\Platform\MySql\Statement\Server\KeyCache\CacheIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/CacheIndex.php:67
- method-call SqlSemantics\Platform\MySql\Statement\Server\KeyCache\LoadIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/LoadIndex.php:63
- method-call SqlSemantics\Platform\MySql\Statement\Server\Lock\LockTables::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Lock/LockTables.php:58
Calls 5
- new Targets line 45
- method-call Derivation::target() line 50
- method-call Targets::target() line 50
- method-call Derivation::report() line 54
- new NonUniqueTable line 54
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TableNamesTestcalls
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Rules\Server\MaintainedTables::derive() packages/sql-semantics-mysql/src/Rules/Server/MaintainedTables.php:49
- new SqlSemantics\Platform\MySql\Statement\Server\KeyCache\CacheIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/CacheIndex.php:67
- new SqlSemantics\Platform\MySql\Statement\Server\KeyCache\LoadIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/LoadIndex.php:63
- new SqlSemantics\Platform\MySql\Statement\Server\Lock\LockTables::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Lock/LockTables.php:58
Method calls 4
- method-call SqlSemantics\Platform\MySql\Rules\Server\MaintainedTables::derive() packages/sql-semantics-mysql/src/Rules/Server/MaintainedTables.php:49
- method-call SqlSemantics\Platform\MySql\Statement\Server\KeyCache\CacheIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/CacheIndex.php:67
- method-call SqlSemantics\Platform\MySql\Statement\Server\KeyCache\LoadIndex::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/KeyCache/LoadIndex.php:63
- method-call SqlSemantics\Platform\MySql\Statement\Server\Lock\LockTables::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Lock/LockTables.php:58