classShowTargets
final class ShowTargets
Resolves the table a SHOW or DESCRIBE reports on.
Rule: MYSQL-SHOW-TARGET-001. The name resolves by CORE-TABLE-LOOKUP-001 in the database written after FROM or IN when there is one (it replaces a database written before the table name), else in the database written with the name, else in the current database; common table expressions are not visible. The fact of the InspectedTable node is that resolution with the shape of the table: one slot per declared column, an open shape for an undeclared table or an incomplete column list, an empty shape for a missing or conflicting name, which is a diagnostic (the server reports ER_NO_SUCH_TABLE). Terminates: one pass over the columns. Source: https://dev.mysql.com/doc/refman/8.4/en/show-columns.html ("SHOW COLUMNS FROM mytable FROM mydb" equals "SHOW COLUMNS FROM
- mydb.mytable"). Status: Implemented.
Methods§
public function derive(
Derivation $derivation,
InspectedTable $table,
?Name $database = null,
): RelationFactResolves the inspected table, records its fact and answers it.
Parameters
$derivation | Derivation | |
$table | InspectedTable | |
$database | ?Name |
Returns
Called from 5
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Explain\DescribeTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Explain/DescribeTable.php:52
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowColumns::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowColumns.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateTable.php:58
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateView::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateView.php:48
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowKeys::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowKeys.php:59
Calls 9
- new QualifiedName line 45
- method-call Derivation::table() line 46
- method-call Derivation::environment() line 46
- new OutputSlot line 50
- new Known line 50
- method-call Derivation::target() line 53
- new RelationFact line 53
- new RowShape line 53
- new IncompleteMembers line 53
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ShowTargetsTestcalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\MySql\Statement\Utility\Explain\DescribeTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Explain/DescribeTable.php:52
- new SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowColumns::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowColumns.php:60
- new SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateTable.php:58
- new SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateView::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateView.php:48
- new SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowKeys::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowKeys.php:59
Method calls 5
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Explain\DescribeTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Explain/DescribeTable.php:52
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowColumns::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowColumns.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateTable.php:58
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowCreateView::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowCreateView.php:48
- method-call SqlSemantics\Platform\MySql\Statement\Utility\Show\Schema\ShowKeys::deriveStatement() packages/sql-semantics-mysql/src/Statement/Utility/Show/Schema/ShowKeys.php:59