classInstanceRule
final class InstanceRule
Lowers KILL, SHUTDOWN, RESTART, CLONE and ALTER INSTANCE.
Rule: MYSQL-INSTANCE-001. Scope: kill, kill_option, shutdown_stmt, restart_server_stmt, clone_stmt, opt_datadir_ssl, opt_ssl, alter_instance_stmt, alter_instance_action. The KILL identifier goes through the expression family. The equals sign of DATA DIRECTORY is optional (LeafNoise). The server raises a syntax error in the grammar actions, rejected as such here, when a space surrounds the colon between the CLONE account and port, when ROTATE names another key than INNODB (or, from MySQL 8.0, BINLOG), and when ENABLE or DISABLE names other than INNODB REDO_LOG. Constructs: Kill, Shutdown, Restart, CloneLocal, CloneInstance, AlterInstance with RotateMasterKey, ReloadTls, RedoLogSwitch, ReloadKeyring. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/kill.html, https://dev.mysql.com/doc/refman/8.4/en/clone.html, https://dev.mysql.com/doc/refman/8.4/en/alter-instance.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers an instance statement.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When the server rejects the statement while it parses itCalled from 1
Calls 10
- new Kill line 77
- method-call InstanceRule::scope() line 77
- method-call Form::node() line 77
- new Shutdown line 78
- new Restart line 79
- method-call InstanceRule::local() line 80
- method-call InstanceRule::remote() line 81
- new AlterInstance line 82
- method-call InstanceRule::action() line 82
- static-call ImplementationGap::production() line 83
Lowers the modifier of KILL: a node of kill_option.
Parameters
$option | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 94
- class-const KillScope::Connection() line 98
- class-const KillScope::Query() line 99
- static-call ImplementationGap::production() line 100
public function local(Form $form): CloneLocalLowers CLONE LOCAL DATA DIRECTORY.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Form::node() line 111
- new CloneLocal line 113
public function remote(Form $form): CloneInstanceLowers CLONE INSTANCE FROM.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When a space surrounds the colon before the portCalled from 1
Calls 8
- method-call Form::node() line 124
- method-call Form::token() line 125
- new AnalysisException line 126
- method-call Lowering::form() line 131
- method-call InstanceRule::ssl() line 133
- method-call InstanceRule::directory() line 134
- static-call ImplementationGap::production() line 135
- new CloneInstance line 138
Lowers the data directory and the SSL choice of CLONE INSTANCE.
Parameters
$form | Form |
Returns
array{Text, bool|null}Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 2
- method-call Form::node() line 149
- method-call InstanceRule::ssl() line 151
public function ssl(Node $ssl): ?boolLowers REQUIRE [NO] SSL: a node of opt_ssl.
Parameters
$ssl | Node |
Returns
?boolThrows
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Server\Instance\InstanceRule::remote() packages/sql-semantics-mysql/src/Lowering/Server/Instance/InstanceRule.php:133
- method-call SqlSemantics\Platform\MySql\Lowering\Server\Instance\InstanceRule::directory() packages/sql-semantics-mysql/src/Lowering/Server/Instance/InstanceRule.php:151
Calls 2
- method-call Lowering::form() line 161
- static-call ImplementationGap::production() line 167
public function action(Node $action): InstanceActionLowers the action of ALTER INSTANCE: a node of alter_instance_action.
Parameters
$action | Node |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When a name is not the one the server expectsCalled from 1
Calls 7
- method-call Lowering::form() line 179
- class-const InstanceRule::RELOADS() line 180
- new ReloadTls line 183
- method-call InstanceRule::rotate() line 187
- method-call InstanceRule::redo() line 188
- new ReloadKeyring line 190
- static-call ImplementationGap::production() line 191
public function rotate(Node $name): RotateMasterKeyLowers ROTATE … MASTER KEY from its name: a node of ident_or_text.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When the name is not one the release acceptsCalled from 1
Calls 6
- class-const GrammarRelease::MySql5744() line 204
- function-call
in_arrayline 205 - function-call
strtoupperline 205 - new AnalysisException line 206
- function-call
implodeline 206 - new RotateMasterKey line 209
public function redo(bool $enable, Form $form): RedoLogSwitchLowers ENABLE or DISABLE INNODB REDO_LOG.
Parameters
$enable | bool | |
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleAnalysisException When the names are not INNODB REDO_LOGCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Server\Instance\InstanceRule::action() packages/sql-semantics-mysql/src/Lowering/Server/Instance/InstanceRule.php:188
- method-call SqlSemantics\Platform\MySql\Lowering\Server\Instance\InstanceRule::action() packages/sql-semantics-mysql/src/Lowering/Server/Instance/InstanceRule.php:189
Calls 4
- method-call Form::node() line 220
- function-call
strtoupperline 222 - new AnalysisException line 223
- new RedoLogSwitch line 226
Private surface 2§
Implementation details, listed for orientation only.
private const RELOADS = ['alter_instance_action: RELOAD TLS_SYM' => [null, false], 'alter_instance_acti…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
InstanceRuleTestcalls