classLegacyGrantRule
final class LegacyGrantRule
Lowers GRANT and REVOKE of MySQL 5.6 and 5.7.
Rule: MYSQL-ACCOUNT-GRANT-LEGACY-001. Scope: grant, revoke (5.x productions), grant_command, revoke_command. The statements are the same structures as the 8.0 ones; GRANT also carries the account clauses of 5.x (IDENTIFIED per account, REQUIRE, resource limits in WITH), and 5.6 REVOKE reads its accounts with the GRANT account list. The marker clear_privileges holds no operand. Constructs: GrantPrivileges, GrantProxy, RevokePrivileges, RevokeAll, RevokeProxy. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/5.7/en/grant.html, https://dev.mysql.com/doc/refman/5.7/en/revoke.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers grant: GRANT clear_privileges grant_command.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 17
- static-call ImplementationGap::production() line 68
- method-call Form::node() line 70
- method-call Lowering::form() line 71
- new UserListRule line 72
- new IdentificationRule line 72
- new ClauseRule line 73
- new GrantProxy line 75
- method-call UserListRule::granted() line 75
- method-call ClauseRule::grantOption() line 75
- class-const LegacyGrantRule::KINDS() line 77
- method-call LegacyGrantRule::table() line 78
- new PrivilegeRule line 79
- new GrantPrivileges line 81
- method-call PrivilegeRule::privileges() line 82
- method-call PrivilegeRule::level() line 84
- method-call ClauseRule::tls() line 86
- method-call ClauseRule::grantOptions() line 87
Lowers revoke: REVOKE clear_privileges revoke_command.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 13
- static-call ImplementationGap::production() line 99
- method-call Form::node() line 101
- method-call Lowering::form() line 102
- new PrivilegeRule line 103
- method-call PrivilegeRule::words() line 105
- new RevokeAll line 107
- method-call LegacyGrantRule::users() line 107
- new RevokeProxy line 110
- class-const LegacyGrantRule::KINDS() line 112
- method-call LegacyGrantRule::table() line 113
- new RevokePrivileges line 115
- method-call PrivilegeRule::privileges() line 115
- method-call PrivilegeRule::level() line 115
public function table(Form $command): voidConfirms the optional TABLE word of a command that names no routine kind.
Parameters
$command | Form |
Called from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::grant() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:78
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:113
public function users(Node $list): non-empty-list<UserSpecification>Lowers the accounts of a 5.x REVOKE: a grant_list (5.6) or a user_list (5.7).
Parameters
$list | Node |
Returns
non-empty-list<UserSpecification>Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:107
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:110
- method-call SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:115
Calls 5
- method-call UserListRule::granted() line 138
- new UserListRule line 138
- new IdentificationRule line 138
- method-call GrantRule::specifications() line 141
- new GrantRule line 141
Private surface 2§
Implementation details, listed for orientation only.
private const KINDS = ['grant_command: grant_privileges ON opt_table grant_ident TO_SYM grant_list re…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
LegacyGrantRuleTestcalls
Relations§
Instantiated in 1
Method calls 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:55
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:55