classExplainRule
final class ExplainRule
Lowers EXPLAIN, DESCRIBE, HELP and USE.
Rule: MYSQL-EXPLAIN-LOWERING-001. Scope: describe, explanable_command (5.6), explainable_command (5.7), opt_extended_describe (5.x), describe_command, opt_describe_column, describe_stmt, explain_stmt, explainable_stmt, opt_explain_options, opt_explain_format, opt_explain_into, opt_explain_for_schema (8.0 and later), help, use. Constructs: DescribeTable, Explain, ExplainConnection, Help, UseDatabase. The explained statement is lowered by the query and data manipulation families. DESC, DESCRIBE and EXPLAIN are the same keyword (UtilityNoise). Terminates: every part is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/explain.html, https://dev.mysql.com/doc/refman/8.4/en/help.html, https://dev.mysql.com/doc/refman/8.4/en/use.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers a node of describe, describe_stmt, explain_stmt, help or use.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 11
- new Help line 81
- method-call Form::node() line 81
- new UseDatabase line 83
- method-call ExplainRule::verb() line 86
- new DescribeTable line 88
- new InspectedTable line 88
- method-call ExplainRule::column() line 88
- method-call ExplainRule::legacy() line 93
- method-call Lowering::form() line 93
- method-call ExplainRule::modern() line 97
- static-call ImplementationGap::production() line 103
public function verb(Node $verb): voidConfirms that a node is describe_command.
Parameters
$verb | Node |
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:91
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:95
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:99
Calls 2
- method-call Lowering::form() line 114
- static-call ImplementationGap::production() line 116
Lowers the column pattern of DESCRIBE: a node of opt_describe_column.
Parameters
$column | Node |
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 127
- static-call ImplementationGap::production() line 133
Lowers EXPLAIN of MySQL 5.x from its opt_extended_describe and its explained command.
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call Form::node() line 147
- class-const ExplainRule::MODIFIERS() line 149
- static-call ImplementationGap::production() line 149
- new ExplainConnection line 152
- new Explain line 154
- method-call ExplainRule::explained() line 154
Lowers EXPLAIN of MySQL 8.0 and later from its options, the variable of an INTO written before the statement, and its explainable_stmt.
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::statement() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:101
Calls 8
- method-call OptionRule::options() line 164
- new OptionRule line 164
- new ExplainConnection line 167
- method-call Form::node() line 167
- class-const ExplainRule::EXPLAINED() line 169
- method-call OptionRule::database() line 169
- new Explain line 171
- method-call ExplainRule::explained() line 171
Lowers the statement of an explained-statement production through the family that owns it.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::legacy() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:154
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::modern() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:171
Calls 4
- method-call Form::node() line 181
- class-const ExplainRule::EXPLAINED() line 181
- static-call ImplementationGap::production() line 181
- class-const ExplainRule::QUERIES() line 183
Private surface 4§
Implementation details, listed for orientation only.
private const MODIFIERS = ['opt_extended_describe: EXTENDED_SYM' => \SqlSemantics\Platform\MySql\Statemen…private const EXPLAINED = ['explanable_command: select' => 0, 'explanable_command: insert' => 0, 'explana…private const QUERIES = ['select' => true, 'select_stmt' => true]private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExplainRuleTestcalls