classOptionRule
final class OptionRule
Lowers the options of EXPLAIN in MySQL 8.0 and later.
Rule: MYSQL-EXPLAIN-OPTION-LOWERING-001. Scope: opt_explain_options, opt_explain_format, opt_explain_into, opt_explain_for_schema. The format is a name the server compares without regard to case; INTO names a user variable; FOR DATABASE names a database. Terminates: unit productions over strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/explain.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function options(Node $options): array{Name|null, bool, UserVariable|null}Lowers a node of opt_explain_options into the format, ANALYZE and the variable of INTO.
Parameters
$options | Node |
Returns
array{Name|null, bool, UserVariable|null}Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 42
- method-call OptionRule::format() line 45
- method-call OptionRule::into() line 47
- static-call ImplementationGap::production() line 49
Lowers a node of opt_explain_format.
Parameters
$format | Node |
Returns
?NameThrows
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:45
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:46
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:47
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:48
Calls 2
- method-call Lowering::form() line 60
- static-call ImplementationGap::production() line 65
public function into(Node $into): ?UserVariableLowers a node of opt_explain_into.
Parameters
$into | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:47
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\OptionRule::options() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/OptionRule.php:48
Calls 2
- method-call Lowering::form() line 76
- static-call ImplementationGap::production() line 81
Lowers a node of opt_explain_for_schema.
Parameters
$database | Node |
Returns
?NameThrows
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Lowering::form() line 92
- static-call ImplementationGap::production() line 97
Private surface 1§
Implementation details, listed for orientation only.
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
OptionRuleTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::modern() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:164
- new SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::modern() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:169
Method calls 2
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::modern() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:164
- method-call SqlSemantics\Platform\MySql\Lowering\Utility\Explain\ExplainRule::modern() packages/sql-semantics-mysql/src/Lowering/Utility/Explain/ExplainRule.php:169