final class ClauseRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers the account clauses shared by CREATE USER, ALTER USER and GRANT.

Rule: MYSQL-ACCOUNT-CLAUSE-001. Scope: require_clause, require_list, require_list_element, opt_and, connect_options, connect_option_list, connect_option, grant_options, grant_option_list, grant_option, opt_grant_option, opt_account_lock_password_expire_options, opt_account_lock_password_expire_option_list, opt_account_lock_password_expire_option, password_expire, opt_user_attribute. Every clause keeps its options in source order and every number and string its exact value; AND between REQUIRE conditions is an optional word. Constructs: TlsRequirement, TlsCondition, ResourceLimit, GrantOptionRight, AccountOption, UserComment. Terminates: the lists are flattened iteratively; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html, https://dev.mysql.com/doc/refman/5.7/en/grant.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function conditions(Node $list): list<TlsCondition>

Lowers the conditions of a require_list, confirming the optional AND between them.

Parameters

$listNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 6
public function grantOption(Node $clause): bool
public function option(Node $option): AccountOption

Lowers one password or locking option.

Parameters

$optionNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 7
public function expire(Node $expire): void

Confirms the MySQL 5.7 password_expire production, whose marker holds no operand.

Parameters

$expireNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 2

Private surface 6§

Implementation details, listed for orientation only.

private const OPTIONS = ['opt_account_lock_password_expire_option: ACCOUNT_SYM UNLOCK_SYM' => \SqlSeman…
private const NUMBERED = ['opt_account_lock_password_expire_option: PASSWORD EXPIRE_SYM INTERVAL_SYM rea…
private const LIMITS = ['connect_option: MAX_QUERIES_PER_HOUR ulong_num' => \SqlSemantics\Platform\MyS…
private const CONDITIONS = ['require_list_element: SUBJECT_SYM TEXT_STRING' => \SqlSemantics\Platform\MySq…
private const LISTS = ['connect_option_list: connect_option_list connect_option' => true, 'connect_op…
private Lowering $lowering

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 6
Method calls 26
Type declarations 1